From a21a93a815c3916c1862d2b09f1589a7505dde07 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 11 Feb 2016 11:58:28 +0100 Subject: Added a format target --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bbd9f3..99d7a41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,16 @@ include(KDEInstallDirs) find_package(Qt5 COMPONENTS REQUIRED Core Widgets Network) find_package(KF5 COMPONENTS REQUIRED Async) find_package(FlatBuffers REQUIRED) + +#Clang-format support +add_custom_command( + OUTPUT format.dummy + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND clang-format -i ${CMAKE_SOURCE_DIR}/**.{cpp,h} +) +add_custom_target(format DEPENDS format.dummy) + +#Generate flatbuffer bindings if (${AVOID_BINDING_REBUILD}) add_custom_target(generate_bindings) else() @@ -42,6 +52,7 @@ function(generate_flatbuffers _target) endforeach(fbs) endfunction(generate_flatbuffers) +#Clang-analyze support add_custom_target(analyze) function(add_clang_static_analysis target) get_target_property(SRCs ${target} SOURCES) -- cgit v1.2.3