Commit 5010fe52 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Add pre-commit hook for clang-format

parent b27c1a1e
...@@ -15,6 +15,10 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) ...@@ -15,6 +15,10 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDEClangFormat) include(KDEClangFormat)
include(ECMQMLModules) include(ECMQMLModules)
include(ECMQtDeclareLoggingCategory) include(ECMQtDeclareLoggingCategory)
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
include(KDEGitCommitHooks)
endif()
add_definitions(-DQT_NO_URL_CAST_FROM_STRING) add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER) add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_CAST_FROM_ASCII) add_definitions(-DQT_NO_CAST_FROM_ASCII)
...@@ -70,6 +74,9 @@ ecm_qt_install_logging_categories(EXPORT SYSTEMSETTINGS FILE systemsettings.cate ...@@ -70,6 +74,9 @@ ecm_qt_install_logging_categories(EXPORT SYSTEMSETTINGS FILE systemsettings.cate
# add clang-format target for all our real source files # add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
Supports Markdown
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