|
|
@ -1,13 +1,16 @@ |
|
|
# Generate cpp with Git revision from template |
|
|
# Generate cpp with Git revision from template |
|
|
# Also if this is a CI build, add the build name (ie: Nightly, Bleeding Edge) to the scm_rev file as well |
|
|
|
|
|
|
|
|
# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well |
|
|
set(REPO_NAME "") |
|
|
set(REPO_NAME "") |
|
|
|
|
|
set(BUILD_VERSION "0") |
|
|
if ($ENV{CI}) |
|
|
if ($ENV{CI}) |
|
|
if ($ENV{TRAVIS}) |
|
|
if ($ENV{TRAVIS}) |
|
|
set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG}) |
|
|
set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG}) |
|
|
|
|
|
set(BUILD_TAG $ENV{TRAVIS_TAG}) |
|
|
elseif($ENV{APPVEYOR}) |
|
|
elseif($ENV{APPVEYOR}) |
|
|
set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) |
|
|
set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) |
|
|
|
|
|
set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME}) |
|
|
endif() |
|
|
endif() |
|
|
# regex capture the string nightly or bleeding-edge into CMAKE_MATCH_1 |
|
|
|
|
|
|
|
|
# regex capture the string nightly or canary into CMAKE_MATCH_1 |
|
|
string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY}) |
|
|
string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY}) |
|
|
if (${CMAKE_MATCH_COUNT} GREATER 0) |
|
|
if (${CMAKE_MATCH_COUNT} GREATER 0) |
|
|
# capitalize the first letter of each word in the repo name. |
|
|
# capitalize the first letter of each word in the repo name. |
|
|
@ -16,10 +19,21 @@ if ($ENV{CI}) |
|
|
string(SUBSTRING ${WORD} 0 1 FIRST_LETTER) |
|
|
string(SUBSTRING ${WORD} 0 1 FIRST_LETTER) |
|
|
string(SUBSTRING ${WORD} 1 -1 REMAINDER) |
|
|
string(SUBSTRING ${WORD} 1 -1 REMAINDER) |
|
|
string(TOUPPER ${FIRST_LETTER} FIRST_LETTER) |
|
|
string(TOUPPER ${FIRST_LETTER} FIRST_LETTER) |
|
|
# this leaves a trailing space on the last word, but we actually want that |
|
|
|
|
|
# because of how it's styled in the title bar. |
|
|
|
|
|
set(REPO_NAME "${REPO_NAME}${FIRST_LETTER}${REMAINDER}") |
|
|
set(REPO_NAME "${REPO_NAME}${FIRST_LETTER}${REMAINDER}") |
|
|
endforeach() |
|
|
endforeach() |
|
|
|
|
|
if (BUILD_TAG) |
|
|
|
|
|
string(REGEX MATCH "${CMAKE_MATCH_1}-([0-9]+)" OUTVAR ${BUILD_TAG}) |
|
|
|
|
|
if (${CMAKE_MATCH_COUNT} GREATER 0) |
|
|
|
|
|
set(BUILD_VERSION ${CMAKE_MATCH_1}) |
|
|
|
|
|
endif() |
|
|
|
|
|
if (BUILD_VERSION) |
|
|
|
|
|
# This leaves a trailing space on the last word, but we actually want that |
|
|
|
|
|
# because of how it's styled in the title bar. |
|
|
|
|
|
set(BUILD_FULLNAME "${REPO_NAME} #${BUILD_VERSION} ") |
|
|
|
|
|
else() |
|
|
|
|
|
set(BUILD_FULLNAME "") |
|
|
|
|
|
endif() |
|
|
|
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
endif() |
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) |
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) |
|
|
|