mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-12 04:41:17 +00:00
Append current branch name to comp version string.
This commit is contained in:
parent
e223084982
commit
f28b050c07
3 changed files with 17 additions and 4 deletions
|
@ -101,7 +101,9 @@ add_subdirectory(assets)
|
||||||
## config.h generation
|
## config.h generation
|
||||||
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
|
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
|
||||||
include(GitUtilities)
|
include(GitUtilities)
|
||||||
git_describe(SRB2_COMP_REVISION "${CMAKE_CURRENT_SOURCE_DIR}")
|
git_describe(SRB2_GIT_DESCRIBE "${CMAKE_SOURCE_DIR}")
|
||||||
|
git_current_branch(SRB2_GIT_BRANCH "${CMAKE_SOURCE_DIR}")
|
||||||
|
set(SRB2_COMP_REVISION "${SRB2_GIT_DESCRIBE}-<${SRB2_GIT_BRANCH}>")
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
|
||||||
|
|
||||||
##### PACKAGE CONFIGURATION #####
|
##### PACKAGE CONFIGURATION #####
|
||||||
|
|
|
@ -14,9 +14,18 @@ function(git_describe variable path)
|
||||||
ERROR_QUIET
|
ERROR_QUIET
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
#if(NOT result EQUAL 0)
|
|
||||||
# set(${variable} "GITERROR-${result}-NOTFOUND" CACHE STRING "revision" FORCE)
|
set(${variable} "${output}" PARENT_SCOPE)
|
||||||
#endif()
|
endfunction()
|
||||||
|
|
||||||
|
function(git_current_branch variable path)
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} "symbolic-ref" "--short" "HEAD"
|
||||||
|
WORKING_DIRECTORY "${path}"
|
||||||
|
RESULT_VARIABLE result
|
||||||
|
OUTPUT_VARIABLE output
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
|
||||||
set(${variable} "${output}" PARENT_SCOPE)
|
set(${variable} "${output}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
|
@ -12,6 +12,8 @@
|
||||||
#define ASSET_HASH_PATCH_DTA "${SRB2_ASSET_patch.dta_HASH}"
|
#define ASSET_HASH_PATCH_DTA "${SRB2_ASSET_patch.dta_HASH}"
|
||||||
|
|
||||||
#define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}"
|
#define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}"
|
||||||
|
#define SRB2_GIT_DESCRIBE "${SRB2_GIT_DESCRIBE}"
|
||||||
|
#define SRB2_GIT_BRANCH "${SRB2_GIT_BRANCH}"
|
||||||
|
|
||||||
#define CMAKE_ASSETS_DIR "${CMAKE_SOURCE_DIR}/assets"
|
#define CMAKE_ASSETS_DIR "${CMAKE_SOURCE_DIR}/assets"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue