Commit b1f8919a authored by Rashad Kanavath's avatar Rashad Kanavath

CMake: report last commit message and short hash

parent 5ef5144e
......@@ -23,6 +23,11 @@ endif()
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
find_package(Git)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H --oneline
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE OTB_GIT_LAST_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE OTB_WC_REVISION
......
......@@ -373,6 +373,12 @@ macro(get_white_spaces var res)
endmacro()
message("\n======================= Begin of OTB cmake summary =======================\n")
if(OTB_GIT_LAST_COMMIT)
get_white_spaces("git log -1 --oneline" insert_sp)
message("git log -1 --oneline = [${OTB_GIT_LAST_COMMIT}]")
endif()
set(option_list ${OTB_MODULE_ACTIVATION_OPTION_LIST})
list(SORT option_list)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment