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.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user