|
@ -11,7 +11,19 @@ execute_process( |
|
|
COMMAND scripts/version.sh |
|
|
COMMAND scripts/version.sh |
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
|
|
OUTPUT_VARIABLE PACKAGE_VERSION |
|
|
OUTPUT_VARIABLE PACKAGE_VERSION |
|
|
|
|
|
RESULT_VARIABLE GIT_ERROR_CODE |
|
|
) |
|
|
) |
|
|
|
|
|
if (NOT GIT_ERROR_CODE EQUAL 0) |
|
|
|
|
|
# - if we can run version.sh and it exits with an error that is signaling |
|
|
|
|
|
# a build failure. |
|
|
|
|
|
# - if we are on windows with no MSYS or Cygwin, we cannot run version.sh |
|
|
|
|
|
# which is the fallback case handled below |
|
|
|
|
|
# TODO: Distinguish between these two cases |
|
|
|
|
|
|
|
|
|
|
|
# Fallback to just using the non dynamic short version string |
|
|
|
|
|
file(STRINGS VERSION PACKAGE_VERSION) |
|
|
|
|
|
endif (NOT GIT_ERROR_CODE EQUAL 0) |
|
|
|
|
|
|
|
|
string(STRIP "${PACKAGE_VERSION}" PACKAGE_VERSION) |
|
|
string(STRIP "${PACKAGE_VERSION}" PACKAGE_VERSION) |
|
|
MESSAGE(STATUS "Build for version: ${PACKAGE_VERSION}") |
|
|
MESSAGE(STATUS "Build for version: ${PACKAGE_VERSION}") |
|
|
|
|
|
|
|
|