mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
Git version fixed
This commit is contained in:
parent
55ca625371
commit
cd71125277
5 changed files with 26 additions and 15 deletions
|
|
@ -4,14 +4,24 @@ set(GIT_VERSION_UPDATE "1")
|
|||
|
||||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --count
|
||||
WORKING_DIRECTORY ${SOURCE_DIR}
|
||||
RESULT_VARIABLE exit_code
|
||||
OUTPUT_VARIABLE GIT_VERSION)
|
||||
if(NOT ${exit_code} EQUAL 0)
|
||||
message(WARNING "git describe failed, unable to include version.")
|
||||
message(WARNING "git rev-list failed, unable to include version.")
|
||||
endif()
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${SOURCE_DIR}
|
||||
RESULT_VARIABLE exit_code
|
||||
OUTPUT_VARIABLE GIT_VERSION_)
|
||||
if(NOT ${exit_code} EQUAL 0)
|
||||
message(WARNING "git rev-parse failed, unable to include version.")
|
||||
endif()
|
||||
string(STRIP ${GIT_VERSION} GIT_VERSION)
|
||||
string(STRIP ${GIT_VERSION_} GIT_VERSION_)
|
||||
string(STRIP ${GIT_VERSION}-${GIT_VERSION_} GIT_VERSION)
|
||||
message(STATUS "GIT_VERSION: " ${GIT_VERSION})
|
||||
else()
|
||||
message(WARNING "git not found, unable to include version.")
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue