|
|
|
@ -3,7 +3,8 @@ execute_process (
|
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
|
RESULT_VARIABLE EXITCODE1
|
|
|
|
|
OUTPUT_VARIABLE TAGHASH
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
|
ERROR_QUIET)
|
|
|
|
|
|
|
|
|
|
execute_process (
|
|
|
|
|
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
|
|
|
@ -12,13 +13,17 @@ execute_process (
|
|
|
|
|
OUTPUT_VARIABLE COMMITHASH
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
|
|
|
|
|
string (COMPARE EQUAL "${EXITCODE1}:${EXITCODE2}" "0:0" SUCCESS)
|
|
|
|
|
if (SUCCESS)
|
|
|
|
|
string (COMPARE EQUAL "${EXITCODE1}:${EXITCODE2}" "0:0" FULL_SUCCESS)
|
|
|
|
|
string (COMPARE EQUAL "${EXITCODE2}" "0" COMMIT_SUCCESS)
|
|
|
|
|
if (FULL_SUCCESS)
|
|
|
|
|
set(OPENMW_VERSION_COMMITHASH "${COMMITHASH}")
|
|
|
|
|
set(OPENMW_VERSION_TAGHASH "${TAGHASH}")
|
|
|
|
|
message(STATUS "OpenMW version ${OPENMW_VERSION}")
|
|
|
|
|
else (SUCCESS)
|
|
|
|
|
elseif (COMMIT_SUCCESS)
|
|
|
|
|
set(OPENMW_VERSION_COMMITHASH "${COMMITHASH}")
|
|
|
|
|
message(STATUS "OpenMW version ${OPENMW_VERSION}")
|
|
|
|
|
else ()
|
|
|
|
|
message(WARNING "Failed to get valid version information from Git")
|
|
|
|
|
endif (SUCCESS)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
configure_file(${VERSION_IN_FILE} ${VERSION_FILE})
|
|
|
|
|