Check for tag to automatically determine release build

This commit is contained in:
Jonathan White 2018-01-29 23:00:52 -05:00 committed by Janek Bevendorff
parent 5b72407746
commit d8649f7a60

View File

@ -74,7 +74,13 @@ set(KEEPASSXC_VERSION_PATCH "0")
set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION_MAJOR}.${KEEPASSXC_VERSION_MINOR}.${KEEPASSXC_VERSION_PATCH}")
set(KEEPASSXC_RELEASE_BUILD OFF CACHE BOOLEAN "Remove stability warnings")
if(NOT KEEPASSXC_RELEASE_BUILD)
# Check if on a tag, if so build as a release
execute_process(COMMAND git tag --points-at HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG)
if(GIT_TAG)
set(KEEPASSXC_RELEASE_BUILD ON)
elseif(NOT KEEPASSXC_RELEASE_BUILD)
set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION}-snapshot")
endif()