diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 38 |
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 ########################### |