Force configure_file to re-run

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Force configure_file to re-run

CMake mailing list

I was wondering if the official advice on re-running ‘configure_file’ has evolved? There’s some answers on StackOverflow about using custom targets / commands to force it but they seem … ugly.

Essentially I want configure_file to re-run each build - I still want the ‘only update the timestamp on the output file to change if the file is really changed’ logic, otherwise I could use file(WRITE).

(I have some variables, expanded in the file which is the input to configure_file, which change fairly often but not every build, so I’d like to use configure_file to check these variables each build, but only touch/modify <output>.h when the variables really did change)

Kind regards,

Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe:

smime.p7s (5K) Download Attachment