From 88f1636fef99f920059dffad7dbfee54dadfe6b0 Mon Sep 17 00:00:00 2001 From: Antti Savolainen Date: Tue, 21 Apr 2026 10:00:03 +0300 Subject: [PATCH] CMakeLists: add clang-format pre-commit hook --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9320976..17eed5c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,14 @@ include(ECMDeprecationSettings) include(FeatureSummary) include(CheckIncludeFile) +include(KDEClangFormat) +include(KDEGitCommitHooks) + +# add clang-format target for all our real source files +file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) +kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) +kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) + check_include_file("linux/input.h" HAVE_LINUX_INPUT_H) find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core DBus Widgets)