aboutsummaryrefslogtreecommitdiff
path: root/kde-modules/KDEGitCommitHooks.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'kde-modules/KDEGitCommitHooks.cmake')
-rw-r--r--kde-modules/KDEGitCommitHooks.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/kde-modules/KDEGitCommitHooks.cmake b/kde-modules/KDEGitCommitHooks.cmake
index f9c48ae4..44e0e0fa 100644
--- a/kde-modules/KDEGitCommitHooks.cmake
+++ b/kde-modules/KDEGitCommitHooks.cmake
@@ -51,6 +51,11 @@ function(KDE_CONFIGURE_GIT_PRE_COMMIT_HOOK)
set(_multiValueArgs CHECKS)
cmake_parse_arguments(ARG "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN} )
+ if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
+ message(STATUS "Project is not top level project - pre-commit hook not installed")
+ return()
+ endif()
+
if(NOT ARG_CHECKS)
message(FATAL_ERROR "No checks were specified")
endif()