[CMake] Version embedding - how to cause a command when make is run?

Atwood, Robert C r.atwood at imperial.ac.uk
Fri Oct 5 13:11:51 EDT 2007


Hi:

> How about:
> 
>  svn info file:///home/juans/svn_repository/svnroot/ | grep 
> '^Revision:'
> | sed -e 's/^[^0-9]*//'

I don't really like the idea of too much shell-filtering for this (or
similar) purpose. The necessity of such indicates either there's a
feature that people want, that's lacking from the software, or that the
designers of the software intended users to do that sort of thing a
different way. If it's the first, I'd rather suggest the additon of the
feature to the software,  if its' the second, I'd rather learn the
intended way (in this case to ensure traceability of the executable.) 

Also it is less x-platform, you might need to test for 'grep' etc. and
have a fallback option if it's not there, it sort of goes against the
idea of using cmake in the first place it seems to me.

In any case, the CMAKE aspect of this, ensuring that the correct
version-control-software command, whatever it is, is executed at *build*
time rather than only at *ccmake* time,  is probably addressed by Alan's
original reply, and I await some reply from the subversion experts on
the appropriate list, and look more at subversion docs, to find out what
that command actually is!
-- Robert
  



More information about the CMake mailing list