/[zanavi_public1]/navit/cmake/version.cmake
ZANavi

Contents of /navit/cmake/version.cmake

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations) (download)
Fri Oct 28 21:19:04 2011 UTC (8 years, 2 months ago) by zoff99
File size: 931 byte(s)
import files
1 FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe DOC "git command line client")
2
3 get_filename_component(SOURCE_DIR ${SRC} PATH)
4
5 EXECUTE_PROCESS(
6 COMMAND ${GIT_EXECUTABLE} svn info
7 COMMAND grep "Revision"
8 WORKING_DIRECTORY "${SOURCE_DIR}"
9 OUTPUT_VARIABLE VERSION
10 OUTPUT_STRIP_TRAILING_WHITESPACE
11 )
12
13 if (NOT DEFINED ${NAME})
14 set( ${NAME} "unknown" )
15 endif()
16
17 if (NOT VERSION)
18 FIND_PACKAGE(Subversion)
19
20 if (Subversion_FOUND)
21
22 EXECUTE_PROCESS(
23 COMMAND svnversion
24 WORKING_DIRECTORY "${SOURCE_DIR}"
25 OUTPUT_VARIABLE VERSION
26 OUTPUT_STRIP_TRAILING_WHITESPACE
27 )
28 endif(Subversion_FOUND)
29
30 if (VERSION AND (NOT ${VERSION} MATCHES "^exported"))
31 set( ${NAME} ${VERSION} )
32 endif()
33 else()
34 string(REGEX REPLACE "Revision: " "" ${NAME} ${VERSION})
35 endif(NOT VERSION)
36
37 set(NAVIT_VARIANT "-")
38
39 message (STATUS "SVN-version ${${NAME}}")
40 CONFIGURE_FILE(${SRC} ${DST} @ONLY)

   
Visit the ZANavi Wiki