Commit 9699d8d0 authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Add pre-commit hook for clang-format

parent eb2dfdd0
......@@ -20,6 +20,9 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMAddTests)
include(GenerateExportHeader)
include(KDEClangFormat)
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
include(KDEGitCommitHooks)
endif()
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
......@@ -32,5 +35,9 @@ add_subdirectory(plasmoid)
# 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)
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
  • @alex With ECM 5.78

    CMake Error at CMakeLists.txt:38 (kde_configure_git_pre_commit_hook):
      Unknown CMake command "kde_configure_git_pre_commit_hook".

    A mistakenly duplicated line outside the if ?

  • Sorry, fixed

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment