2018-05-12 23:26:31 +00:00
|
|
|
# Find Clang tidy
|
|
|
|
#
|
|
|
|
|
|
|
|
if(NOT CLANG_TIDY_BIN_NAME)
|
2019-01-03 14:25:58 +00:00
|
|
|
set(CLANG_TIDY_BIN_NAME clang-tidy)
|
2018-05-12 23:26:31 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# if custom path check there first
|
|
|
|
if(CLANG_TIDY_ROOT_DIR)
|
2019-01-03 14:25:58 +00:00
|
|
|
find_program(CLANG_TIDY_BIN
|
|
|
|
NAMES ${CLANG_TIDY_BIN_NAME}
|
|
|
|
PATHS "${CLANG_TIDY_ROOT_DIR}"
|
|
|
|
NO_DEFAULT_PATH)
|
2018-05-12 23:26:31 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
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()
|