Don't append the git revision if tagged to match the current version
This commit is contained in:
parent
1c1590d6c0
commit
dbc451190a
|
|
@ -51,14 +51,23 @@ if(NOT PRODUCT_VERSION)
|
||||||
|
|
||||||
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND git show -s --pretty=format:%h
|
COMMAND git describe --tags --exact-match
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
OUTPUT_VARIABLE GIT_REV
|
OUTPUT_VARIABLE GIT_TAG
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
ERROR_QUIET)
|
ERROR_QUIET)
|
||||||
|
|
||||||
if(GIT_REV)
|
if(NOT GIT_TAG STREQUAL "${PRODUCT_VERSION}")
|
||||||
set(PRODUCT_VERSION "${PRODUCT_VERSION}_g${GIT_REV}")
|
execute_process(
|
||||||
|
COMMAND git show -s --pretty=format:%h
|
||||||
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
|
OUTPUT_VARIABLE GIT_REV
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
ERROR_QUIET)
|
||||||
|
|
||||||
|
if(GIT_REV)
|
||||||
|
set(PRODUCT_VERSION "${PRODUCT_VERSION}_g${GIT_REV}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user