aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-12-03 17:09:00 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-12-03 17:09:00 +0300
commit426963bff9e01d7d2f48d0e9eb232ccc11b33808 (patch)
treec9ef707091db34da264c63c8cafd334b0aabeeaa /CMakeLists.txt
parentcbc577df0ee6ec8855913442cfe0efe3a184e725 (diff)
downloadrspamd-426963bff9e01d7d2f48d0e9eb232ccc11b33808.tar.gz
rspamd-426963bff9e01d7d2f48d0e9eb232ccc11b33808.zip
Write release id if rspamd is built from hg.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0b94609e..cfaa95ed3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ SET(RSPAMD_VERSION_MAJOR 0)
SET(RSPAMD_VERSION_MINOR 3)
SET(RSPAMD_VERSION_PATCH 3)
+
SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}.${RSPAMD_VERSION_PATCH}")
SET(RSPAMD_MASTER_SITE_URL "http://bitbucket.org/vstakhov/rspamd")
SET(RSPAMD_USER "nobody")
@@ -484,6 +485,28 @@ IF(NOT DESTDIR)
SET(DESTDIR $ENV{DESTDIR})
ENDIF(NOT DESTDIR)
+# Try to detect tip version from hg
+SET(ID "unknown")
+FIND_PROGRAM(HG "hg")
+
+IF(HG)
+ EXECUTE_PROCESS(COMMAND ${HG} "id" OUTPUT_VARIABLE HG_ID)
+ IF(HG_ID)
+ STRING(REGEX MATCH ^[0-9a-z]+ ID "${HG_ID}")
+ 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 ID)
+ ENDIF(HG_ID)
+ ENDIF(HG_ARCH)
+ENDIF(HG)
+
+
################################ SOURCES SECTION ###########################
SET(RSPAMDSRC src/modules.c