REM:
1. 增加git版本详细信息
This commit is contained in:
huangxin 2022-06-28 17:47:36 +08:00
parent d4003c0a88
commit 9bae63205c
1 changed files with 1 additions and 6 deletions

View File

@ -12,13 +12,8 @@ if ("${GIT_TAG}" STREQUAL "")
STRING(TIMESTAMP COMPILE_TIME %Y-%m-%d_%H:%M:%S) STRING(TIMESTAMP COMPILE_TIME %Y-%m-%d_%H:%M:%S)
SET(GIT_VERSION ${COMPILE_TIME}) SET(GIT_VERSION ${COMPILE_TIME})
else () else ()
EXECUTE_PROCESS(COMMAND git rev-parse --short HEAD
OUTPUT_VARIABLE GIT_HASH)
STRING(REGEX REPLACE "\n$" "" GIT_TAG ${GIT_TAG}) STRING(REGEX REPLACE "\n$" "" GIT_TAG ${GIT_TAG})
STRING(REGEX REPLACE "\n$" "" GIT_HASH ${GIT_HASH}) SET(GIT_VERSION ${GIT_TAG})
SET(GIT_VERSION ${GIT_TAG}_${GIT_HASH})
endif () endif ()