diff options
Diffstat (limited to 'CMake/getsvn.cmake')
| -rw-r--r-- | CMake/getsvn.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/CMake/getsvn.cmake b/CMake/getsvn.cmake index 92b5b415..d6af3312 100644 --- a/CMake/getsvn.cmake +++ b/CMake/getsvn.cmake @@ -65,7 +65,7 @@ elseif (EXISTS "${SOURCE_DIR}/.git") message (STATUS "Source tree based on revision ${GIT_REFSPEC} ${SCS_VERSION} appears to have local changes") file (APPEND ${__scs_header_file} "#define SCS_VERSION_IS_DIRTY 1\n") set (SCS_VERSION_STR "${SCS_VERSION}-dirty") - execute_process (COMMAND ${GIT_EXECUTABLE} --git-dir=${SOURCE_DIR}/.git --work-tree=${SOURCE_DIR} status + execute_process (COMMAND ${GIT_EXECUTABLE} -C ${SOURCE_DIR} status ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) else () @@ -74,7 +74,13 @@ elseif (EXISTS "${SOURCE_DIR}/.git") message (STATUS "refspec: ${GIT_REFSPEC} - SHA1: ${SCS_VERSION}") endif () else() - message (STATUS "No SCS found") + if (SOURCE_REVISION) + string (SUBSTRING "${SOURCE_REVISION}" 0 6 SCS_VERSION) + set (SCS_VERSION_STR "${SCS_VERSION}") + message (STATUS "Using archived source revision ${SCS_VERSION}") + else () + message (STATUS "No SCS found") + endif () endif () file (APPEND ${__scs_header_file} "#define SCS_VERSION ${SCS_VERSION}\n") file (APPEND ${__scs_header_file} "#define SCS_VERSION_STR \"${SCS_VERSION_STR}\"\n") |
