diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-19 20:01:43 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-19 20:22:21 +0400 |
commit | 50fbebe0a443d10b3b5525c9a7e152acc32b4527 (patch) | |
tree | 2aabfd0e8efc73563c9adce60a654bfb1d6a4c00 /build_files/cmake/buildinfo.cmake | |
parent | 5743a6e36458874be1fe992a361ce493edbee5a4 (diff) |
Buildinfo fixes
- Use -M suffix if working tree does have uncommitted
modifications.
- Local commits are considered local changes as well
Diffstat (limited to 'build_files/cmake/buildinfo.cmake')
-rw-r--r-- | build_files/cmake/buildinfo.cmake | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/build_files/cmake/buildinfo.cmake b/build_files/cmake/buildinfo.cmake index 389386629db..2cc92df15e7 100644 --- a/build_files/cmake/buildinfo.cmake +++ b/build_files/cmake/buildinfo.cmake @@ -22,12 +22,6 @@ if(EXISTS ${SOURCE_DIR}/.git/) OUTPUT_VARIABLE MY_WC_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE) - # Get latest version tag - execute_process(COMMAND git describe --match "v[0-9]*" --abbrev=0 - WORKING_DIRECTORY ${SOURCE_DIR} - OUTPUT_VARIABLE _git_latest_version_tag - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND git log -1 --format=%ct WORKING_DIRECTORY ${SOURCE_DIR} OUTPUT_VARIABLE MY_WC_COMMIT_TIMESTAMP @@ -44,11 +38,20 @@ if(EXISTS ${SOURCE_DIR}/.git/) OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT _git_changed_files STREQUAL "") - set(MY_WC_CHANGE "${MY_WC_CHANGE}M") + set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)") + else() + # Unpushed commits are also considered local odifications + execute_process(COMMAND git log @{u}.. + WORKING_DIRECTORY ${SOURCE_DIR} + OUTPUT_VARIABLE _git_unpushed_log + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT _git_unpushed_log STREQUAL "") + set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)") + endif() + unset(_git_unpushed_log) endif() unset(_git_changed_files) - unset(_git_latest_version_tag) endif() endif() |