summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorjkoan <jkoan@users.noreply.github.com>2017-06-25 03:49:45 +0200
committerPierre GRANDIN <pgrandin@users.noreply.github.com>2017-06-24 18:49:45 -0700
commit1d82081603d4ea967db0bf2e5e982bdb97ba07ec (patch)
tree2d4bf5e40644fe654439cfac97f52f7d12b4cb52 /cmake
parent12628850a99b25d0a8a61cde038cca8af4ef1b12 (diff)
downloadnavit-1d82081603d4ea967db0bf2e5e982bdb97ba07ec.tar.gz
Use datecode insted of Tags as Android id (#274)
* Remove all git repo test and use date to get rid of all tags * Del rests... * Dont delete to much? :D
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/version.cmake40
1 files changed, 12 insertions, 28 deletions
diff --git a/cmake/version.cmake b/cmake/version.cmake
index eddf0b479..8f82d9f61 100755
--- a/cmake/version.cmake
+++ b/cmake/version.cmake
@@ -2,34 +2,18 @@ FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe DOC "git command line client")
get_filename_component(SOURCE_DIR ${SRC} PATH)
-if (GIT_EXECUTABLE)
- EXECUTE_PROCESS(
- COMMAND ${GIT_EXECUTABLE} log "--format=%h %d"
- WORKING_DIRECTORY "${SOURCE_DIR}"
- OUTPUT_VARIABLE VERSION
- ERROR_VARIABLE GIT_ERROR
- OUTPUT_STRIP_TRAILING_WHITESPACE
- ERROR_STRIP_TRAILING_WHITESPACE
- )
- if(NOT VERSION)
- message(STATUS "Cannot determine current git commit - git error: '${GIT_ERROR}'")
- set(VERSION "0000")
- endif()
-else()
- message(STATUS "git not found, cannot record git commit")
- set(VERSION "0000")
-endif(GIT_EXECUTABLE)
-
-string(REGEX MATCH "R[0-9]+" VERSION_NUM ${VERSION} )
-if(NOT VERSION_NUM)
- message(STATUS "I can't find a release tag. This is probably not Navit's official tree")
- message(STATUS "It's OK, I will default to 0000")
- set(VERSION_NUM "0000")
-endif()
-string(REPLACE "R" "" VERSION_NUM ${VERSION_NUM} )
-if(NOT VERSION_NUM)
- set(VERSION_NUM "0000")
-endif()
+string(TIMESTAMP VERSION "%y%m%d%H%M")
+
+string(REGEX MATCH "[0-9]+" VERSION_NUM ${VERSION} )
+if(NOT VERSION_NUM)
+ message(STATUS "I can't find a release tag. This is probably not Navit's official tree")
+ message(STATUS "It's OK, I will default to 0000")
+ set(VERSION_NUM "0000")
+endif()
+string(REPLACE "R" "" VERSION_NUM ${VERSION_NUM} )
+if(NOT VERSION_NUM)
+ set(VERSION_NUM "0000")
+endif()
string(REGEX MATCH "^[a-z0-9]+" VERSION ${VERSION} )