[CMake] Embedding up-to-date version info in built library

Waschk,Kolja cmuser09 at ixo.de
Mon Dec 14 15:21:14 EST 2009


Hi Brad,

> You need the custom command to run every time the build starts:
...
> copy-if-different check.  The key is then to make the library depend
> on this rule at a *target* level, but only on version.h at a *file* level.

Because such a custom target is "always considered out of date", the library
that depends on it is also considered out of date and would be rebuilt, even
though no source code changed. Assembling our 100+ object files into a large
library is fast on Linux but dead slow on Windows/Cygwin. At least it is much
slower than reading and comparing the timestamps of the 100+ files (no,
disabling the virus scanner didn't help much;)



More information about the CMake mailing list