2018-05-12 19:26:31 -04:00
|
|
|
# Find Clang tidy
|
|
|
|
#
|
|
|
|
|
2021-01-23 18:22:47 -06:00
|
|
|
set(ClangTidy_BIN_NAME
|
2019-02-23 17:13:33 -05:00
|
|
|
clang-tidy
|
|
|
|
clang-tidy-5.0
|
|
|
|
clang-tidy-6.0
|
|
|
|
clang-tidy-7
|
2021-01-23 19:28:22 -06:00
|
|
|
clang-tidy-8
|
|
|
|
clang-tidy-9
|
|
|
|
clang-tidy-10
|
|
|
|
clang-tidy-11)
|
2018-05-12 19:26:31 -04:00
|
|
|
|
2021-01-23 18:22:47 -06:00
|
|
|
find_program(ClangTidy_BIN NAMES ${ClangTidy_BIN_NAME})
|
2018-05-12 19:26:31 -04:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2021-01-23 18:22:47 -06:00
|
|
|
find_package_handle_standard_args(ClangTidy DEFAULT_MSG ClangTidy_BIN)
|
2018-05-12 19:26:31 -04:00
|
|
|
|
2021-01-23 18:22:47 -06:00
|
|
|
mark_as_advanced(ClangTidy_BIN)
|
2018-05-12 19:26:31 -04:00
|
|
|
|
2021-01-23 18:22:47 -06:00
|
|
|
if(ClangTidy_FOUND)
|
2019-01-03 09:25:58 -05:00
|
|
|
# A CMake script to find all source files and setup clang-tidy targets for
|
|
|
|
# them
|
|
|
|
include(clang-tidy)
|
2018-05-12 19:26:31 -04:00
|
|
|
else()
|
2019-01-03 09:25:58 -05:00
|
|
|
message("clang-tidy not found. Not setting up tidy targets")
|
2018-05-12 19:26:31 -04:00
|
|
|
endif()
|