2018-05-12 23:26:31 +00:00
|
|
|
# Find Clang tidy
|
|
|
|
#
|
|
|
|
|
2021-01-24 00:22:47 +00:00
|
|
|
set(ClangTidy_BIN_NAME
|
2019-02-23 22:13:33 +00:00
|
|
|
clang-tidy
|
|
|
|
clang-tidy-5.0
|
|
|
|
clang-tidy-6.0
|
|
|
|
clang-tidy-7
|
|
|
|
clang-tidy-8)
|
2018-05-12 23:26:31 +00:00
|
|
|
|
2021-01-24 00:22:47 +00:00
|
|
|
find_program(ClangTidy_BIN NAMES ${ClangTidy_BIN_NAME})
|
2018-05-12 23:26:31 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2021-01-24 00:22:47 +00:00
|
|
|
find_package_handle_standard_args(ClangTidy DEFAULT_MSG ClangTidy_BIN)
|
2018-05-12 23:26:31 +00:00
|
|
|
|
2021-01-24 00:22:47 +00:00
|
|
|
mark_as_advanced(ClangTidy_BIN)
|
2018-05-12 23:26:31 +00:00
|
|
|
|
2021-01-24 00:22:47 +00:00
|
|
|
if(ClangTidy_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()
|