1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
From: Roger Shimizu <rosh@debian.org>
Date: Thu, 19 May 2016 22:43:54 +0900
Subject: remove dependency on git command
Get version from $ENV{DEB_VERSION_UPSTREAM}, which is from debian/rules,
instead of "git describe" command.
---
CMakeLists.txt | 31 +++----------------------------
1 file changed, 3 insertions(+), 28 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 667518a..3d2776e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,22 +18,12 @@ find_package(CTargets)
#-----------------------------------------------------------------------
# Retrieve the current version number
-execute_process(
- COMMAND
- ${CMAKE_SOURCE_DIR}/build-aux/calculate version
- ${CMAKE_SOURCE_DIR} .version-stamp
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- RESULT_VARIABLE VERSION_RESULT
- OUTPUT_VARIABLE VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
-if(VERSION_RESULT)
- message(FATAL_ERROR
- "Cannot determine version number: " ${VERSION_RESULT})
-endif(VERSION_RESULT)
+set(VERSION $ENV{DEB_VERSION_UPSTREAM})
message(STATUS "Current version: " ${VERSION})
string(REGEX REPLACE "-.*" "-dev" BASE_VERSION "${VERSION}")
+string(REGEX REPLACE "~rc.*" "-dev" BASE_VERSION "${BASE_VERSION}")
+message(STATUS "Base version: " ${BASE_VERSION})
if(BASE_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-dev)?$")
set(CORK_VERSION_MAJOR "${CMAKE_MATCH_1}")
@@ -44,21 +34,6 @@ else(BASE_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-dev)?$")
endif(BASE_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-dev)?$")
set(CORK_VERSION "${VERSION}")
-execute_process(
- COMMAND
- ${CMAKE_SOURCE_DIR}/build-aux/calculate commit
- ${CMAKE_SOURCE_DIR} .commit-stamp
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- RESULT_VARIABLE GIT_SHA1_RESULT
- OUTPUT_VARIABLE CORK_GIT_SHA1
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
-if(GIT_SHA1_RESULT)
- message(FATAL_ERROR
- "Cannot determine git commit: " ${GIT_SHA1_RESULT})
-endif(GIT_SHA1_RESULT)
-message(STATUS "Current revision: " ${CORK_GIT_SHA1})
-
include(GNUInstallDirs)
#-----------------------------------------------------------------------
|