Targets from sources generated during build time

I have a situation: I have target test with only one source file test.c. I build it with -save-temps, modify the .s (in CMakeFiles/test.dir/) file a bit, and want to create a target test.patched that builds from that patched test.s file (with like, dependency tracking if possible, etc.) Does that work?