mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-06 05:17:57 +00:00
28 lines
937 B
CMake
28 lines
937 B
CMake
set(ClangFormat_CXX_FILE_EXTENSIONS
|
|
${ClangFormat_CXX_FILE_EXTENSIONS}
|
|
*.cpp
|
|
*.h
|
|
*.cxx
|
|
*.hxx
|
|
*.hpp
|
|
*.cc
|
|
*.hh
|
|
*.ipp)
|
|
|
|
foreach(PATTERN ${ClangFormat_CXX_FILE_EXTENSIONS})
|
|
list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/src/${PATTERN})
|
|
list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/tests/${PATTERN})
|
|
list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/lua/${PATTERN})
|
|
endforeach()
|
|
|
|
file(GLOB_RECURSE ClangFormat_SRCS ${ClangFormat_CXX_PATTERN})
|
|
|
|
add_custom_target(clang-format
|
|
COMMAND ${ClangFormat_BIN} -style=file -i
|
|
${ClangFormat_SRCS})
|
|
add_custom_target(check-clang-format
|
|
COMMAND ${CMAKE_SOURCE_DIR}/bin/run-clang-format.py
|
|
--color always
|
|
--clang-format-executable ${ClangFormat_BIN}
|
|
${ClangFormat_SRCS})
|