[CMake] ADD_DEFINITIONS with output from shell

David Cole david.cole at kitware.com
Wed May 7 09:02:43 EDT 2008


See also:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindSubversion.cmake?root=CMake&view=markup

After a FIND_PACKAGE(Subversion) call, simply use the Subversion_WC_INFO
macro to retrieve an "svn info" call as a slew of CMake variables...


HTH,
David


On Wed, May 7, 2008 at 7:03 AM, Andreas Schneider <mail at cynapses.org> wrote:

> 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
>
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080507/ecc2c3f8/attachment.htm>


More information about the CMake mailing list