mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
Define Git variables for CMake.
This commit is contained in:
parent
349684b7ce
commit
24fde98837
1 changed files with 30 additions and 0 deletions
|
@ -31,6 +31,36 @@ add_definitions(-DORCT2_RESOURCE_DIR="${ORCT2_RESOURCE_DIR}")
|
|||
add_definitions(-DHAVE_CONFIG_H)
|
||||
add_definitions(-DCURL_STATICLIB)
|
||||
|
||||
# Define current git branch.
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE OPENRCT2_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
add_definitions(-DOPENRCT2_BRANCH="${OPENRCT2_BRANCH}")
|
||||
|
||||
# Define commit hash.
|
||||
execute_process(
|
||||
COMMAND git rev-parse HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE OPENRCT2_COMMIT_SHA1
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
add_definitions(-DOPENRCT2_COMMIT_SHA1="${OPENRCT2_COMMIT_SHA1}")
|
||||
|
||||
# Define short commit hash.
|
||||
execute_process(
|
||||
COMMAND git rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE OPENRCT2_COMMIT_SHA1_SHORT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
add_definitions(-DOPENRCT2_COMMIT_SHA1_SHORT="${OPENRCT2_COMMIT_SHA1_SHORT}")
|
||||
|
||||
INCLUDE(FindPkgConfig)
|
||||
|
||||
# Options
|
||||
|
|
Loading…
Reference in a new issue