diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 35d38843bf..f9c52518e7 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1302,6 +1302,10 @@ endif(BUILD_GEOMSERVER) if(ADD_COMMIT_SHA) find_package(Git) + if(NOT GIT_FOUND) + message(FATAL_ERROR "Failed to find Git for ADD_COMMIT_SHA option.") + endif() + if(GIT_FOUND) if (VERSION_OVERRIDE) set (git_branch ${RELEASE_VERSION})