Improve version information
* Add reimplementations of old DFHACK_VERSION-style macros * Expose full git commit ID * Expose all DFHack::Version functions to Luadevelop
parent
a67326ad00
commit
de49befdbb
@ -1,9 +1,15 @@
|
|||||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --long
|
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --long
|
||||||
WORKING_DIRECTORY "${dfhack_SOURCE_DIR}"
|
WORKING_DIRECTORY "${dfhack_SOURCE_DIR}"
|
||||||
OUTPUT_VARIABLE DFHACK_GIT_DESCRIPTION)
|
OUTPUT_VARIABLE DFHACK_GIT_DESCRIPTION)
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||||
|
WORKING_DIRECTORY "${dfhack_SOURCE_DIR}"
|
||||||
|
OUTPUT_VARIABLE DFHACK_GIT_COMMIT)
|
||||||
string(STRIP ${DFHACK_GIT_DESCRIPTION} DFHACK_GIT_DESCRIPTION)
|
string(STRIP ${DFHACK_GIT_DESCRIPTION} DFHACK_GIT_DESCRIPTION)
|
||||||
file(WRITE ${dfhack_SOURCE_DIR}/library/include/git-describe.tmp.h
|
file(WRITE ${dfhack_SOURCE_DIR}/library/include/git-describe.tmp.h
|
||||||
"#define DFHACK_GIT_DESCRIPTION \"${DFHACK_GIT_DESCRIPTION}\"")
|
"#define DFHACK_GIT_DESCRIPTION \"${DFHACK_GIT_DESCRIPTION}\"\n")
|
||||||
|
string(STRIP ${DFHACK_GIT_COMMIT} DFHACK_GIT_COMMIT)
|
||||||
|
file(APPEND ${dfhack_SOURCE_DIR}/library/include/git-describe.tmp.h
|
||||||
|
"#define DFHACK_GIT_COMMIT \"${DFHACK_GIT_COMMIT}\"")
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
${dfhack_SOURCE_DIR}/library/include/git-describe.tmp.h
|
${dfhack_SOURCE_DIR}/library/include/git-describe.tmp.h
|
||||||
${dfhack_SOURCE_DIR}/library/include/git-describe.h)
|
${dfhack_SOURCE_DIR}/library/include/git-describe.h)
|
||||||
|
Loading…
Reference in New Issue