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

Michael Wild themiwi at gmail.com
Fri Dec 11 16:08:18 EST 2009


On 11. Dec, 2009, at 16:58 , Kolja Waschk wrote:

> Hi, thanks,
> 
>> One question: Why do you need a add_custom_command with all those
>> dependencies? Why does version.cc depend on all the source and header
>> files? What do you write in your version.cc file? Is it something like
> 
> Beside the SVN revision number of the working base, our embedded
> revision information also tells whether the library was built from code
> with local modifications, i.e. whether it equals the source code stored
> in the SVN repository or was changed afterwards.  Changing a single byte
> in a header file already affects that state, so all headers need to be
> watched.
> 
> Kolja

I made some experiments, and I can confirm your observation: only the first file in the IMPLICIT_DEPENDS list gets added. Further, the documentation is inaccurate and doesn't mention that the language has to be prepended to every single file (i.e. <lang> <file> pairs).

Currently I don't quite understand how the whole thing works...

Michael


More information about the CMake mailing list