[CMake] Version embedding - how to cause a command when
make is run?
Juan Sanchez
Juan.Sanchez at amd.com
Fri Oct 5 13:25:22 EDT 2007
Ok,
My code was for demonstration purposes only. Of course there are more
generic ways to process the information, perhaps even using CMake itself.
A google search reveals that the last line from "svn status -q " is
often used to get the latest revision number.
In the search for knowledge, it is often beneficial to start with the
particular solution, and then work ones way up to the general solution.
I had missed the part about checks being executed at build time versus
ccmake time. In that situation, I would suggest having cmake abort
rather than update. Otherwise you may run into a situation where the
files change underneath cmake, and cmake doesn't know this has occurred.
Regards,
Juan
Atwood, Robert C wrote:
> 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
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
>
--
Juan Sanchez
Juan.Sanchez at amd.com
800-538-8450 Ext. 54395
512-602-4395
More information about the CMake
mailing list