`configure_file` does not document that it only writes to the destination for different content
At the moment, configure_file
always writes the target file, even if there is no actual change. This a problem if the target file time stamp is consumed by the configuration and build process.
In contrast, file(GENERATE OUTPUT ...)
doesn't touch the file unless there is an actual change. However, this command does not substitute variables, and the time this is done may be too late. (I was caught when generating a CPackConfig.cmake, which was not yet generated when CMake made its decision about creating a package target, https://github.com/Kitware/CMake/blob/master/Source/cmGlobalGenerator.cxx#L2221)
So I propose that configure_file
should not overwrite files if must push a change.
(And how often did I write file(CONFIGURE ...)
- this is a different story.)