cmake: add command polly-check-format
This command runs clang-format on all files and reports formatting problems
llvm-svn: 175170
diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt
index a60c50e..71c2dc6 100644
--- a/polly/CMakeLists.txt
+++ b/polly/CMakeLists.txt
@@ -158,3 +158,8 @@
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/polly/Config/config.h.cmake
${POLLY_BINARY_DIR}/include/polly/Config/config.h )
+# Add target to check formatting of polly files
+file( GLOB_RECURSE files *.h *.cpp)
+add_custom_command( OUTPUT formatting COMMAND
+ ${CMAKE_CURRENT_SOURCE_DIR}/utils/check_format.sh ${files})
+add_custom_target(polly-check-format ALL DEPENDS formatting)