Version adjustments

This commit is contained in:
Ani 2017-12-08 21:47:49 +00:00 committed by Ani
parent d7881c6714
commit 6b323d7e2e
4 changed files with 31 additions and 31 deletions

View file

@ -19,18 +19,20 @@ if(GIT_FOUND AND EXISTS "${SOURCE_DIR}/../.git/")
if(NOT ${exit_code} EQUAL 0)
message(WARNING "git rev-parse failed, unable to include version.")
endif()
# Hack fix for AppVeyor (Pull Requests don't generate a branch name)
if(NOT DEFINED ENV{APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH})
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
RESULT_VARIABLE exit_code
OUTPUT_VARIABLE GIT_BRANCH)
if(NOT ${exit_code} EQUAL 0)
message(WARNING "git rev-parse failed, unable to include git branch.")
endif()
else()
set(GIT_BRANCH $ENV{APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH})
endif()
# (Unused code, we're currently building with MSVC on AppVeyor)
# Hack fix for AppVeyor (Pull Requests don't generate a branch name)
#
# if(NOT DEFINED ENV{APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH})
# execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
# WORKING_DIRECTORY ${SOURCE_DIR}
# RESULT_VARIABLE exit_code
# OUTPUT_VARIABLE GIT_BRANCH)
# if(NOT ${exit_code} EQUAL 0)
# message(WARNING "git rev-parse failed, unable to include git branch.")
# endif()
# else()
# set(GIT_BRANCH $ENV{APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH})
# endif()
string(STRIP ${GIT_VERSION} GIT_VERSION)
string(STRIP ${GIT_VERSION_} GIT_VERSION_)
string(STRIP ${GIT_VERSION}-${GIT_VERSION_} GIT_VERSION)