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

Atwood, Robert C r.atwood at imperial.ac.uk
Fri Oct 5 09:28:03 EDT 2007


 >> From: Alan W. Irwin (on cmake list)

> > Yes, [svnversion] is the whole point! It is much easier 
> than using individual
> > revision nubmers for each file.
> 
> Although not nearly as informative.  I just tried svnversion, 
> and it only
> gives a range of Revision numbers for the source tree. That's 
> a non-unique
> way of identifying source trees 

How so?
 As I understand the range is the range of project revision nubmers at
which the most recent changes for files has occurred. 

But I am fairly new to SVN after switching from CVS, so I would like to
know how identical svnversion output from different source trees would
come about? Maybe I should ask that on the svn list as well . 


>However, simplicity that usually might work often trumps correct
complexity

Well, I never said I was NOT already doing the other, in fact i said I
WAS doing it! I had some of the aformentioned hair-tearing to get the
'.h' files to record correct revision, in the executable, without a
great deal of repetitive output, as I recall. Complexity that is hard to
get correct often results in incorrect complexity :-/ I can even think
of a few ways that 'correct' method fails. Like  modifying the  source
without checking in.

IN svnversion, the all-important 'M' indicator appears in that case. 
Of course the dreaded 'M' would only tell you that there's little hope
of reconstructing the exact source, that someone failed to use the
revision control suitably -- which would be good to know if true.  

The whole thing can help undertake proper record keeping but I don't
think it should quite take the place of proper record keeping right?.
It'd be nice to be fool-proof but being clever-deliberate-saboteur-proof
is much more difficult and not really required for my project at this
time! I hope.

>  ADD_CUSTOM_COMMAND(TARGET signature.  
> I guess you missed that suggestion.

Not true. I am merely not discussing it at this time because I have not
yet really tried it out, 

I am discussing whether that is actually the way to 'DWIM' , you might
still convince me otherwise!

But thanks for the suggestion and if it is possible to get non-unique
svnversion I'll be glad you pointed out the possiblity!



 




More information about the CMake mailing list