2018-05-12 23:26:31 +00:00
|
|
|
# Find Clang tidy
|
|
|
|
#
|
|
|
|
|
2019-02-23 19:40:34 +00:00
|
|
|
set(CLANG_TIDY_BIN_NAME clang-tidy clang-tidy-5.0 clang-tidy-6.0 clang-tidy-7)
|
2018-05-12 23:26:31 +00:00
|
|
|
|
|
|
|
find_program(CLANG_TIDY_BIN NAMES ${CLANG_TIDY_BIN_NAME})
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2019-01-03 14:25:58 +00:00
|
|
|
find_package_handle_standard_args(CLANG_TIDY DEFAULT_MSG CLANG_TIDY_BIN)
|
2018-05-12 23:26:31 +00:00
|
|
|
|
2019-01-03 14:25:58 +00:00
|
|
|
mark_as_advanced(CLANG_TIDY_BIN)
|
2018-05-12 23:26:31 +00:00
|
|
|
|
|
|
|
if(CLANG_TIDY_FOUND)
|
2019-01-03 14:25:58 +00:00
|
|
|
# A CMake script to find all source files and setup clang-tidy targets for
|
|
|
|
# them
|
|
|
|
include(clang-tidy)
|
2018-05-12 23:26:31 +00:00
|
|
|
else()
|
2019-01-03 14:25:58 +00:00
|
|
|
message("clang-tidy not found. Not setting up tidy targets")
|
2018-05-12 23:26:31 +00:00
|
|
|
endif()
|