[CMake] Making a variable a dependency...

Oliver kfsone Smith osmith at playnet.com
Wed Feb 8 17:09:53 EST 2012


Alexander Neundorf said the following on 2/6/2012 3:56 PM:
> Would it be acceptable if cmake would rerun after every build ?
> You could enforce that e.g. with a add_custom_command( POST_BUILD ... ) which
> could e.g. touch CMakeCache.txt or something.
>
> Better ideas ?
>
We're working in a client/server environment in a fairly agile 
production environment; we need to have /all/ executables correctly 
stamped with the revision they're sourced from.

So I kind of need it run before each build.

Further, one of my problems is that right now the variable gets cached 
in CMakeCache.txt, so I have to delete CMakeCache.txt or do

     cmake -DSubversion_FOUND=NO

or similar.

In the short term, I can just make it always rebuild the revision.h, but 
that has the downside of causing it to /always/ rebuild the library that 
includes it, causing all binaries to relink, and so on, which is fairly 
time consuming (it's a very large project :)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120208/7ea7aedc/attachment.htm>


More information about the CMake mailing list