summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2015-05-04 18:46:49 -0400
committerest31 <MTest31@outlook.com>2015-05-05 17:13:05 +0200
commit1be2d32fd502eeb68bd63fb07b0325b25ee357bd (patch)
treec1c1481f91d0d933a65459354cf979d461557223 /CMakeLists.txt
parentdfd790930c8c1464ead730999c3ac9677d130360 (diff)
downloadminetest-1be2d32fd502eeb68bd63fb07b0325b25ee357bd.tar.gz
minetest-1be2d32fd502eeb68bd63fb07b0325b25ee357bd.tar.bz2
minetest-1be2d32fd502eeb68bd63fb07b0325b25ee357bd.zip
Make Git version detection use VERSION_STRING instead of tags
This fixes the problem where 0.4.12-dev versions were erroneously shown as 0.4.11-dev because the tag was added on a separate branch. It also fixes a similar issue when builders didn't fetch new tags when updating. This also removes the number-of-commits-since-tag field, since it's incompatible with this. Said field doesn't seem to be useful anyway if you have the commit hash.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 639c07077..d1353e16c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,11 +16,13 @@ set(VERSION_MINOR 4)
set(VERSION_PATCH 12)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
+# Change to false for releases
+set(DEVELOPMENT_BUILD TRUE)
+
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
if(VERSION_EXTRA)
set(VERSION_STRING ${VERSION_STRING}-${VERSION_EXTRA})
-else()
- # Comment the following line during release
+elseif(DEVELOPMENT_BUILD)
set(VERSION_STRING "${VERSION_STRING}-dev")
endif()