From 5df331acf2e1a8a7f39fd2df62803c9c76ff7865 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 23 Feb 2021 20:00:13 +0200 Subject: [PATCH] Add clang-format bits to CMakeLists.txt NO_CHANGELOG --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2500599f..e84af963 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) include(KDEInstallDirs) include(KDECMakeSettings) +include(KDEGitCommitHooks) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(GtkUpdateIconCache) @@ -137,3 +138,9 @@ add_subdirectory(icons) add_subdirectory(icons-dark) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES INCLUDE_QUIET_PACKAGES) + +kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) +# Remove these 3 lines when the ECM version is bumped to 5.80 +include(KDEClangFormat) +file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) +kde_clang_format()