summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSebastian Leske <sebastian.leske@sleske.name>2015-08-28 08:14:22 +0200
committerSebastian Leske <sebastian.leske@sleske.name>2015-08-30 00:56:39 +0200
commit425f2b01a68159d084e6cfa4b8cae39b4fb56a28 (patch)
tree8607b03b6f421d0741b955cd6c11f16554f972d3 /cmake
parentdd6b8208c88c0dbcccf3c8d5ea7d6fe159f674c8 (diff)
downloadnavit-425f2b01a68159d084e6cfa4b8cae39b4fb56a28.tar.gz
Fix:build:Detect current git version, remove Subversion checks. We don't do Subversion anymore...
Diffstat (limited to 'cmake')
-rw-r--r--cmake/version.cmake39
1 files changed, 10 insertions, 29 deletions
diff --git a/cmake/version.cmake b/cmake/version.cmake
index 413bf0e83..77c79d12a 100644
--- a/cmake/version.cmake
+++ b/cmake/version.cmake
@@ -2,42 +2,23 @@ FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe DOC "git command line client")
get_filename_component(SOURCE_DIR ${SRC} PATH)
-EXECUTE_PROCESS(
- COMMAND ${GIT_EXECUTABLE} svn info
- COMMAND grep "Revision"
- WORKING_DIRECTORY "${SOURCE_DIR}"
- OUTPUT_VARIABLE VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
-
-if (NOT DEFINED ${NAME})
- set( ${NAME} "unknown" )
-endif()
-
-if (NOT VERSION)
- FIND_PACKAGE(Subversion)
-
- if (Subversion_FOUND)
-
+if (GIT_EXECUTABLE)
EXECUTE_PROCESS(
- COMMAND svnversion
+ COMMAND ${GIT_EXECUTABLE} log -n 1 --format=%h
WORKING_DIRECTORY "${SOURCE_DIR}"
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- endif(Subversion_FOUND)
-
- if (VERSION AND (NOT ${VERSION} MATCHES "^exported"))
- if (STRIP_M)
- string(REGEX REPLACE "M$" "" VERSION ${VERSION})
- endif()
- set( ${NAME} ${VERSION} )
- endif()
else()
- string(REGEX REPLACE "Revision: " "" ${NAME} ${VERSION})
-endif(NOT VERSION)
+ message(STATUS "git not found, cannot record git commit")
+endif(GIT_EXECUTABLE)
set(NAVIT_VARIANT "-")
+if (DEFINED VERSION)
+ set(${NAME} ${VERSION})
+else()
+ set(${NAME} "---")
+endif()
-message (STATUS "SVN-version ${${NAME}}")
+message (STATUS "Git commit: ${${NAME}}")
CONFIGURE_FILE(${SRC} ${DST} @ONLY)