summaryrefslogtreecommitdiff
path: root/common/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'common/CMakeLists.txt')
-rw-r--r--common/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index f79acfef..350bbdf7 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -19,7 +19,12 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../.git")
endif()
endif()
- set(GIT_INDEX "${GIT_DIR}/index")
+ if(EXISTS "${GIT_DIR}/index")
+ set(GIT_INDEX "${GIT_DIR}/index")
+ else()
+ message(WARNING "Git index not found in git repository.")
+ set(GIT_INDEX "")
+ endif()
else()
message(WARNING "Git repository not found; to enable automatic generation of build info, make sure Git is installed and the project is a Git repository.")
set(GIT_INDEX "")