mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-11 07:41:36 +00:00
23 lines
477 B
CMake
23 lines
477 B
CMake
|
# Git utilities
|
||
|
|
||
|
if(__GitUtilities)
|
||
|
return()
|
||
|
endif()
|
||
|
|
||
|
set(__GitUtilities ON)
|
||
|
|
||
|
function(git_describe variable path)
|
||
|
execute_process(COMMAND "${GIT_EXECUTABLE}" "describe"
|
||
|
WORKING_DIRECTORY "${path}"
|
||
|
RESULT_VARIABLE result
|
||
|
OUTPUT_VARIABLE output
|
||
|
ERROR_QUIET
|
||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||
|
)
|
||
|
#if(NOT result EQUAL 0)
|
||
|
# set(${variable} "GITERROR-${result}-NOTFOUND" CACHE STRING "revision" FORCE)
|
||
|
#endif()
|
||
|
|
||
|
set(${variable} "${output}" PARENT_SCOPE)
|
||
|
endfunction()
|