aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexander Lohnau <alexander.lohnau@gmx.de>2021-01-11 20:39:06 +0100
committerDavid Faure <faure@kde.org>2021-01-16 08:50:13 +0000
commit45edd1b17051def13c157cba3b01fac53364149c (patch)
treeec6644d3b24cf272ae1a6e87e9720fe409de2985 /CMakeLists.txt
parentb7affc18e5dad21fe29451cd9ecff54e40e42d79 (diff)
downloadextra-cmake-modules-45edd1b17051def13c157cba3b01fac53364149c.tar.gz
extra-cmake-modules-45edd1b17051def13c157cba3b01fac53364149c.tar.bz2
Add cmake function to configure git pre-commit hooks
This will allow us to force QS checks before the developer commits a change. Currently only clang-format is supported, but as on #plasma and https://phabricator.kde.org/T11214 discussed we might want to add different formatters. By making the checks configurable we are flexible and can easily extend it.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e46b5c09..7e346d90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,8 +96,12 @@ install(FILES ${installModuleFiles} DESTINATION ${MODULES_INSTALL_DIR})
file(GLOB installTestModuleFiles ${CMAKE_SOURCE_DIR}/test-modules/*[^~])
install(FILES ${installTestModuleFiles} DESTINATION ${SHARE_INSTALL_DIR}/ECM/test-modules)
-file(GLOB installKdeModuleFiles ${CMAKE_SOURCE_DIR}/kde-modules/*[^~])
+file(GLOB installKdeModuleFiles LIST_DIRECTORIES FALSE ${CMAKE_SOURCE_DIR}/kde-modules/*[^~])
install(FILES ${installKdeModuleFiles} DESTINATION ${KDE_MODULES_INSTALL_DIR})
+# The scripts need to be executable
+file(GLOB installKDECommitHooks ${CMAKE_SOURCE_DIR}/kde-modules/kde-git-commit-hooks/*[^~])
+install(FILES ${installKDECommitHooks} DESTINATION ${KDE_MODULES_INSTALL_DIR}/kde-git-commit-hooks
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
file(GLOB installFindModuleFiles ${CMAKE_SOURCE_DIR}/find-modules/*.cmake ${CMAKE_SOURCE_DIR}/find-modules/*.py)
install(FILES ${installFindModuleFiles} DESTINATION ${FIND_MODULES_INSTALL_DIR})