Use only commit hash for comparison instead whole string (#1436)

* Use only commit hash for comparison instead whole string

* .
This commit is contained in:
CaCO3
2022-11-30 20:25:34 +01:00
committed by GitHub
parent 8be7beab9a
commit 6c51af7107
5 changed files with 29 additions and 13 deletions

View File

@@ -41,9 +41,9 @@ const char* GIT_BRANCH=\"${GIT_BRANCH}\";
const char* BUILD_TIME=\"${BUILD_TIME}\";")
if ("${GIT_TAG}" STREQUAL "") # Tag not set, show branch
set(VERSION_HTML "Development-Branch: ${GIT_BRANCH} (Commit: ${GIT_REV}${GIT_DIFF})")
set(VERSION_HTML "Development-Branch: ${GIT_BRANCH} (Commit: ${GIT_REV}${GIT_DIFF})\n${GIT_REV}")
else() # Tag is set, ignore branch
set(VERSION_HTML "Release: ${GIT_TAG} (Commit: ${GIT_REV}${GIT_DIFF})")
set(VERSION_HTML "Release: ${GIT_TAG} (Commit: ${GIT_REV}${GIT_DIFF})\n${GIT_REV}")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp)