Merge from Git repository

--HG--
branch : develop
This commit is contained in:
NO-BREAK SPACE OÜ 2019-05-09 23:30:52 +00:00
commit 1aeb8a3873
2 changed files with 32 additions and 0 deletions

View file

@ -1,5 +1,6 @@
jobs:
- job: ubuntu16
timeoutInMinutes: 120
pool:
vmImage: 'Ubuntu-16.04'
steps:

View file

@ -72,6 +72,37 @@ IF(EXISTS "${ROOT_DIR}/.hg/")
ENDIF()
ENDIF()
IF(EXISTS "${ROOT_DIR}/.git/")
FIND_PACKAGE(Git)
IF(GIT_FOUND)
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --count
WORKING_DIRECTORY ${ROOT_DIR}
RESULT_VARIABLE git_exit_code
OUTPUT_VARIABLE REVISION)
IF(NOT ${git_exit_code} EQUAL 0)
message(WARNING "git rev-list failed, unable to include version.")
ENDIF()
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD
WORKING_DIRECTORY ${ROOT_DIR}
RESULT_VARIABLE git_exit_code
OUTPUT_VARIABLE CHANGESET)
IF(NOT ${git_exit_code} EQUAL 0)
message(WARNING "git rev-parse failed, unable to include version.")
ENDIF()
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${ROOT_DIR}
RESULT_VARIABLE git_exit_code
OUTPUT_VARIABLE BRANCH)
IF(NOT ${git_exit_code} EQUAL 0)
message(WARNING "git rev-parse failed, unable to include git branch.")
ENDIF()
STRING(STRIP ${REVISION} REVISION)
STRING(STRIP ${CHANGESET} CHANGESET)
STRING(STRIP ${BRANCH} BRANCH)
ENDIF()
ENDIF()
# if processing exported sources, use "revision" file if exists
IF(SOURCE_DIR AND NOT DEFINED REVISION)
SET(REVISION_FILE ${SOURCE_DIR}/revision)