Use C++ compiler path to try to find clang-tidy

This commit is contained in:
Tobias Hieta 2016-04-05 13:42:06 +02:00
parent ed86254cfa
commit d516976665

View File

@ -1,5 +1,6 @@
find_program(CLANG_TIDY clang-tidy NAMES clang-tidy-3.9 clang-tidy-3.8 clang-tidy-3.7) get_filename_component(CXX_COMPILER_DIR ${CMAKE_CXX_COMPILER} DIRECTORY CACHE)
find_program(CLANG_REPLACE clang-apply-replacements NAMES clang-apply-replacements-3.9 clang-apply-replacements-3.8 clang-apply-replacements-3.7) find_program(CLANG_TIDY clang-tidy NAMES clang-tidy clang-tidy-3.9 clang-tidy-3.8 clang-tidy-3.7 HINTS ${CXX_COMPILER_DIR})
find_program(CLANG_REPLACE clang-apply-replacements NAMES clang-apply-replacements clang-apply-replacements-3.9 clang-apply-replacements-3.8 clang-apply-replacements-3.7 HINTS ${CXX_COMPILER_DIR})
if(CMAKE_EXPORT_COMPILE_COMMANDS AND NOT CLANG_TIDY STREQUAL CLANG_TIDY-NOTFOUND) if(CMAKE_EXPORT_COMPILE_COMMANDS AND NOT CLANG_TIDY STREQUAL CLANG_TIDY-NOTFOUND)
macro(clang_tidy target) macro(clang_tidy target)