14 lines
464 B
CMake
14 lines
464 B
CMake
# Obtain the short git hash for burning it into the firmware
|
|
set(GIT_HASH "undefined")
|
|
find_package(Git QUIET)
|
|
if(GIT_FOUND)
|
|
execute_process(
|
|
COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%h
|
|
OUTPUT_VARIABLE GIT_HASH
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
ERROR_QUIET
|
|
)
|
|
message(STATUS "Burning in git hash: ${GIT_HASH}")
|
|
else ()
|
|
message(WARNING "Cannot obtain git hash for burning into firmware")
|
|
endif() |