# Targets from sources generated during build time

**URL:** <https://discourse.cmake.org/t/targets-from-sources-generated-during-build-time/15278>\
**Category:** Code\
**Created:** [October 30, 2025, 8:40pm UTC](https://discourse.cmake.org/t/targets-from-sources-generated-during-build-time/15278 "2025-10-30T20:40:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![egor\_tensin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/egor_tensin/32/5878_2.png) [@egor\_tensin](https://discourse.cmake.org/u/egor_tensin)\
**Post date:** [October 30, 2025, 8:40pm UTC](https://discourse.cmake.org/t/targets-from-sources-generated-during-build-time/15278/1 "2025-10-30T20:40:30Z")

</div>

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?
