Hi,

 add_custom_target(update_version COMMAND echo updating)
 add_library(mylib version.c)
 add_dependencies(mylib update_version)

We had exactly this configuration for months and the lib was rebuilt
always... but now that you affirm that it /should/ work better, I
had a deeper look again. The actual cause for the rebuild is the
compile time embedded in version.c. The updater script doesn't check
dependencies. It just computes a new version.c and that new version.c
will always be different from the previous one because the time changes. Unless we decide to omit that time info, we need to make
updates of version.c dependent on whether the library should be rebuild
for other reasons. So, we really need to reconsider whether the time info in
that file makes much sense...

Thanks for your help!
Kolja

_______________________________________________
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