[CMake] Force configure_file to re-run

James Turner james.turner at kdab.com
Sat Aug 11 04:44:34 EDT 2018


Hi,

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 foo.in 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,
James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4155 bytes
Desc: not available
URL: <https://cmake.org/pipermail/cmake/attachments/20180811/1f7e1850/attachment.bin>


More information about the CMake mailing list