Minor fixes
This commit is contained in:
parent
38cfdf99f4
commit
429fc53e51
|
@ -7,12 +7,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMake)
|
||||||
|
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND git log -1 --format=%h
|
COMMAND git describe --always
|
||||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
else(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
|
||||||
set(GIT_COMMIT_HASH "Not Found")
|
|
||||||
endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
||||||
|
|
||||||
SET(GIT_VERSION_FLAG "-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\"")
|
SET(GIT_VERSION_FLAG "-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\"")
|
||||||
|
|
Loading…
Reference in a new issue