aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-18 14:24:01 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-18 14:24:01 +0000
commit5914e5c6e26b81c717bbc6bcaa8449645618c542 (patch)
treeaf1562fa8b2aff14d5dab9640795e34e6ac4dce7 /CMakeLists.txt
parent98e6d85b7953e52a5b8771cfc75c89fe10c68c60 (diff)
downloadrspamd-5914e5c6e26b81c717bbc6bcaa8449645618c542.tar.gz
rspamd-5914e5c6e26b81c717bbc6bcaa8449645618c542.zip
Support GIT_ID variable
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt38
1 files changed, 5 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index add82c152..263249f38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,11 @@ SET(RSPAMD_VERSION_MAJOR 1)
SET(RSPAMD_VERSION_MINOR 1)
SET(RSPAMD_VERSION_PATCH 0)
+IF(GIT_ID)
+ SET(GIT_VERSION 1)
+ SET(RSPAMD_ID "${GIT_ID}")
+ENDIF()
+
SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}.${RSPAMD_VERSION_PATCH}")
SET(RSPAMD_MASTER_SITE_URL "https://rspamd.com")
@@ -984,39 +989,6 @@ IF(NOT DESTDIR)
SET(DESTDIR $ENV{DESTDIR})
ENDIF(NOT DESTDIR)
-# Try to detect tip version from hg
-SET(ID "unknown")
-FIND_PROGRAM(HG "git")
-
-IF(HG)
- EXECUTE_PROCESS(COMMAND "${HG}" rev-parse --verify HEAD
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
- OUTPUT_VARIABLE HG_ID ERROR_QUIET)
- IF(HG_ID)
- STRING(SUBSTRING "${HG_ID}" 0 10 RSPAMD_ID)
- MESSAGE(STATUS "Git revision: ${RSPAMD_ID}")
- ELSE(HG_ID)
- FIND_FILE(HG_ARCH ".hg_archival.txt" "${CMAKE_CURRENT_SOURCE_DIR}")
- IF(HG_ARCH)
- FILE(READ ${HG_ARCH} HG_ID)
- IF(HG_ID)
- STRING(REGEX MATCH "node: [0-9a-z]+" _tmp "${HG_ID}")
- STRING(SUBSTRING "${_tmp}" 6 12 RSPAMD_ID)
- ENDIF(HG_ID)
- ENDIF(HG_ARCH)
- ENDIF(HG_ID)
-ELSE(HG)
-# Now check .hg_archival.txt
- FIND_FILE(HG_ARCH ".hg_archival.txt" "${CMAKE_CURRENT_SOURCE_DIR}")
- IF(HG_ARCH)
- FILE(READ ${HG_ARCH} HG_ID)
- IF(HG_ID)
- STRING(REGEX MATCH "node: [0-9a-z]+" _tmp "${HG_ID}")
- STRING(SUBSTRING "${_tmp}" 6 12 RSPAMD_ID)
- ENDIF(HG_ID)
- ENDIF(HG_ARCH)
-ENDIF(HG)
-
################################ SUBDIRS SECTION ###########################