Find the configure_file call that produces the header and note its output path, for example [build dir]/generated/version.h. Success check: the file on disk already contains the new APP_VERSION after a configure, which confirms generation is not the problem.

Add the generated header to the target that includes it, right after the target is created:

Re-run the configure step so the project files are regenerated with the new source list. Success check: version.h appears in the target's project file inputs.

Change APP_VERSION, configure again, and build with cmake --build build_dir. Expected result: the translation units that include version.h recompile and the program picks up the new version, with no manual touch or clean needed.