Add dirty warning to version Cmake

This commit is contained in:
Mario Hüttel 2019-10-18 19:39:23 +02:00
parent 8bef6bcb17
commit f1102162b7

View File

@ -29,4 +29,8 @@ execute_process(COMMAND bash ./generate-git-commit-string.sh
OUTPUT_VARIABLE GIT_COMMIT)
message("${BoldGreen}Commit: ${GIT_COMMIT}")
message("Version: ${GIT_VER}${ColorReset}")
IF(GIT_VER MATCHES "-dirty")
message("${BoldRed}Build is dirty! Commit your changes before releasing this version!${ColorReset}")
ENDIF(GIT_VER MATCHES "-dirty")
target_compile_definitions(version PRIVATE PROJECT_GIT_VERSION=${GIT_VER} PROJECT_GIT_COMMIT=${GIT_COMMIT})