Skip to content

Commit

Permalink
Add git diff information to revision number
Browse files Browse the repository at this point in the history
  • Loading branch information
SimulPiscator committed Apr 4, 2020
1 parent 1ba423e commit 1868659
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
execute_process(
COMMAND sh -c "git diff --quiet --exit-code || echo +"
OUTPUT_VARIABLE GIT_DIFF
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)

if("${GIT_REVISION_NUMBER}" STREQUAL "")
set(GIT_REVISION_NUMBER "N/A")
Expand All @@ -30,7 +36,7 @@ set(VERSION
"
const char* GIT_BRANCH=\"${GIT_BRANCH}\";
const char* GIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\";
const char* GIT_REVISION_NUMBER=\"${GIT_REVISION_NUMBER}\";
const char* GIT_REVISION_NUMBER=\"${GIT_REVISION_NUMBER}${GIT_DIFF}\";
const char* BUILD_TIME_STAMP=\"${BUILD_TIME_STAMP}\";
"
)
Expand Down

0 comments on commit 1868659

Please sign in to comment.