mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
cmake: fix "release" version string on tagged releases
It would not say "release" if we're on a previous tag
This commit is contained in:
parent
065bb292df
commit
45d9a282d1
1 changed files with 9 additions and 17 deletions
|
@ -48,29 +48,21 @@ function (get_version_tag_from_git GIT)
|
||||||
message(STATUS "You are currently on commit ${COMMIT}")
|
message(STATUS "You are currently on commit ${COMMIT}")
|
||||||
|
|
||||||
# Get all the tags
|
# Get all the tags
|
||||||
execute_process(COMMAND "${GIT}" rev-list --tags --max-count=1 --abbrev-commit
|
execute_process(COMMAND "${GIT}" tag -l --points-at HEAD
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
RESULT_VARIABLE RET
|
RESULT_VARIABLE RET
|
||||||
OUTPUT_VARIABLE TAGGEDCOMMIT
|
OUTPUT_VARIABLE TAG
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
if(NOT TAGGEDCOMMIT)
|
# Check if we're building that tagged commit or a different one
|
||||||
message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.")
|
if(TAG)
|
||||||
|
message(STATUS "You are building a tagged release")
|
||||||
|
set(VERSIONTAG "release")
|
||||||
|
set(VERSION_IS_RELEASE "true")
|
||||||
|
else()
|
||||||
|
message(STATUS "You are ahead of or behind a tagged release")
|
||||||
set(VERSIONTAG "${COMMIT}")
|
set(VERSIONTAG "${COMMIT}")
|
||||||
set(VERSION_IS_RELEASE "false")
|
set(VERSION_IS_RELEASE "false")
|
||||||
else()
|
|
||||||
message(STATUS "The most recent tag was at ${TAGGEDCOMMIT}")
|
|
||||||
|
|
||||||
# Check if we're building that tagged commit or a different one
|
|
||||||
if(COMMIT STREQUAL TAGGEDCOMMIT)
|
|
||||||
message(STATUS "You are building a tagged release")
|
|
||||||
set(VERSIONTAG "release")
|
|
||||||
set(VERSION_IS_RELEASE "true")
|
|
||||||
else()
|
|
||||||
message(STATUS "You are ahead of or behind a tagged release")
|
|
||||||
set(VERSIONTAG "${COMMIT}")
|
|
||||||
set(VERSION_IS_RELEASE "false")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue