On 07/09/2010 01:23 PM, Johannes Stallkamp wrote:
> Am 09.07.2010 12:56, schrieb Michael Hertling:
>> As the version target is always out of date it will be build each time
>> you (re)build main, but since CONFIGURE_FILE() obviously does not touch
>> the output file as long as it won't change, version.h isn't timestamped,
>> so it doesn't trigger the rebuild of the main target.
> Hey, that's great. I didn't know that CONFIGURE_FILE does not touch
> the output file if the content doesn't change.
> With that knowledge, I can now simplify my scripts which up to now
> checked manually whether the version number changed and only called
> CONFIGURE_FILE if this is the case.
> Where did you find that? Did I miss it in the docs?

No, AFAIK, this feature isn't documented, and I stumbled across it
eventually by accident. Nevertheless, in CMake's sources, one can
see that CONFIGURE_FILE()'s implementation finally uses a method
named "CopyFileIfDifferent()" to write the output file. ;-)
               ^^^^^^^^^^^
Regards,

Michael
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to