2016-06-15 03:32:35 +00:00
|
|
|
#
|
|
|
|
# Additional targets to perform clang-format/clang-tidy
|
|
|
|
#
|
|
|
|
|
2016-10-18 23:29:30 +00:00
|
|
|
file(GLOB_RECURSE header_files ${PROJECT_SOURCE_DIR}/include/*.hpp)
|
|
|
|
file(GLOB_RECURSE source_files ${PROJECT_SOURCE_DIR}/src/*.cpp)
|
2016-06-15 03:32:35 +00:00
|
|
|
|
|
|
|
# Add clang-format target if executable is found
|
|
|
|
# --------------------------------------------------
|
|
|
|
find_program(CLANG_FORMAT "clang-format")
|
|
|
|
if(CLANG_FORMAT)
|
2016-10-18 23:29:30 +00:00
|
|
|
add_custom_target(clang-format COMMAND ${CLANG_FORMAT}
|
|
|
|
-i -style=file ${header_files} ${source_files})
|
2016-06-15 03:32:35 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Add clang-tidy target if executable is found
|
|
|
|
# --------------------------------------------------
|
|
|
|
find_program(CLANG_TIDY "clang-tidy")
|
|
|
|
if(CLANG_TIDY)
|
|
|
|
add_custom_target(clang-tidy COMMAND ${CLANG_TIDY}
|
2016-10-18 23:29:30 +00:00
|
|
|
-p ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/src/main.cpp)
|
2016-06-15 03:32:35 +00:00
|
|
|
endif()
|