mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 07:19:42 -05:00
Allow KeePassXC version overrides from file in addition to Git tags
This commit is contained in:
parent
69283e83d8
commit
3089894d20
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ release*/
|
||||
*.swp
|
||||
|
||||
.DS_Store
|
||||
.version
|
@ -80,19 +80,22 @@ set_property(CACHE KEEPASSXC_BUILD_TYPE PROPERTY STRINGS Snapshot Release PreRel
|
||||
execute_process(COMMAND git tag --points-at HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_TAG)
|
||||
if(GIT_TAG)
|
||||
string(REGEX REPLACE "\r?\n$" "" GIT_TAG "${GIT_TAG}")
|
||||
if(NOT GIT_TAG AND EXISTS ${CMAKE_SOURCE_DIR}/.version)
|
||||
file(READ ${CMAKE_SOURCE_DIR}/.version OVERRIDE_VERSION)
|
||||
endif()
|
||||
|
||||
if(GIT_TAG MATCHES "^[\\.0-9]+-(alpha|beta)[0-9]+$")
|
||||
string(REGEX REPLACE "(\r?\n)+" "" OVERRIDE_VERSION "${OVERRIDE_VERSION}")
|
||||
if(OVERRIDE_VERSION)
|
||||
if(OVERRIDE_VERSION MATCHES "^[\\.0-9]+-(alpha|beta)[0-9]+$")
|
||||
set(KEEPASSXC_BUILD_TYPE PreRelease)
|
||||
set(KEEPASSXC_VERSION ${GIT_TAG})
|
||||
elseif(GIT_TAG MATCHES "^[\\.0-9]+$")
|
||||
set(KEEPASSXC_VERSION ${OVERRIDE_VERSION})
|
||||
elseif(OVERRIDE_VERSION MATCHES "^[\\.0-9]+$")
|
||||
set(KEEPASSXC_BUILD_TYPE Release)
|
||||
set(KEEPASSXC_VERSION ${GIT_TAG})
|
||||
set(KEEPASSXC_VERSION ${OVERRIDE_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(KEEPASSXC_BUILD_TYPE STREQUAL "PreRelease" AND NOT GIT_TAG)
|
||||
if(KEEPASSXC_BUILD_TYPE STREQUAL "PreRelease" AND NOT OVERRIDE_VERSION)
|
||||
set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION}-preview")
|
||||
elseif(KEEPASSXC_BUILD_TYPE STREQUAL "Snapshot")
|
||||
set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION}-snapshot")
|
||||
|
Loading…
Reference in New Issue
Block a user