[CMake] ADD_DEFINITIONS with output from shell

Andreas Schneider mail at cynapses.org
Wed May 7 07:03:25 EDT 2008


David Sveningsson wrote:
> Hi, I am converting some makefiles for a large application. One of the 
> makefiles adds the following to CFLAGS:
> 
> -DSVN_REVISION="\"`svn info|grep Revision| awk '{print $2}'`\""
> 
> (it runs some shell commands which will output the current subversion 
> revision)
> 
> I tried searching for a way for cmake to run the above command but I 
> found nothing. Is there a way to accomplish this?

Take a look at:

http://dev.openwengo.org/trac/openwengo/trac.fcgi/browser/owbuild/trunk/owbuild/owbuild/OWGetSvnRevision.cmake


	-- andreas

-- 
http://www.cynapses.org/ - cybernetic synapses


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080507/06bab104/attachment.pgp>


More information about the CMake mailing list