mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
d2b6fb2d06
This is useful for developers who may have multiple builds of the game from various different branches and may easily forget which build of the game is what. This shows up in the bottom-right corner of the title screen and also with the `-version` command-line option, and in the status message printed when building the game.
25 lines
742 B
CMake
25 lines
742 B
CMake
# Expects INPUT_FILE and OUTPUT_FILE to be defined
|
|
|
|
# Get interim commit and date of commit
|
|
EXECUTE_PROCESS(
|
|
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%h
|
|
OUTPUT_VARIABLE INTERIM_COMMIT
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
|
|
EXECUTE_PROCESS(
|
|
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cs
|
|
OUTPUT_VARIABLE COMMIT_DATE
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
|
|
EXECUTE_PROCESS(
|
|
COMMAND "${GIT_EXECUTABLE}" branch --show-current
|
|
OUTPUT_VARIABLE BRANCH_NAME
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
|
|
MESSAGE(STATUS "This is interim commit ${INTERIM_COMMIT} (committed ${COMMIT_DATE}) on branch ${BRANCH_NAME}")
|
|
|
|
# Take the template file and replace the macros with what we have
|
|
CONFIGURE_FILE(${INPUT_FILE} ${OUTPUT_FILE})
|