[CMake] Getting the subversion version using CMake.

David Cole david.cole at kitware.com
Tue Apr 1 09:45:31 EDT 2008


Try this in your top level CMakeLists.txt file:
FIND_PACKAGE(Subversion)
IF(Subversion_FOUND)
  Subversion_WC_INFO("${CMAKE_CURRENT_SOURCE_DIR}" myproj)
  MESSAGE(STATUS "myproj_WC_REVISION='${myproj_WC_REVISION}'")
ENDIF(Subversion_FOUND)

WC == working copy

See the macro definition of Subversion_WC_INFO in CMake's
Modules/FindSubversion.cmake for more info.


HTH,
David


On Mon, Mar 31, 2008 at 8:52 PM, Andrew Maclean <andrew.amaclean at gmail.com>
wrote:

> We want to coordinate versioning with our subversion repository. Has
> anyone done this with CMake?
>
> There is a file called .svn\entries and the fourth line in that file has a
> version number e.g. 660. I am thinking of somehow picking up this number
> and creating a variable to use in our builds.
> Or is there a cleverer way of doing this?
>
> Andrew
>
>
> --
> ___________________________________________
> Andrew J. P. Maclean
> Centre for Autonomous Systems
> The Rose Street Building J04
> The University of Sydney 2006 NSW
> AUSTRALIA
> Ph: +61 2 9351 3283
> Fax: +61 2 9351 7474
> URL: http://www.acfr.usyd.edu.au/
> ___________________________________________
>
> _______________________________________________
> 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/20080401/91f87196/attachment.htm>


More information about the CMake mailing list