diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/jaegertracing/thrift/build/cmake/FindClangTools.cmake | |
parent | Initial commit. (diff) | |
download | ceph-upstream/16.2.11+ds.tar.xz ceph-upstream/16.2.11+ds.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/jaegertracing/thrift/build/cmake/FindClangTools.cmake')
-rw-r--r-- | src/jaegertracing/thrift/build/cmake/FindClangTools.cmake | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/jaegertracing/thrift/build/cmake/FindClangTools.cmake b/src/jaegertracing/thrift/build/cmake/FindClangTools.cmake new file mode 100644 index 000000000..b72bea765 --- /dev/null +++ b/src/jaegertracing/thrift/build/cmake/FindClangTools.cmake @@ -0,0 +1,28 @@ +# - Try to find Clang tools +# +# The following are set after configuration is done: +# clang-tidy_FOUND +# ClangTools::clang-tidy +# clang-apply-replacements_FOUND +# ClangTools::clang-apply-replacements +# run-clang-tidy_FOUND +# ClangTools::run-clang-tidy + +include_guard() +include(FindPackageHandleStandardArgs) + +foreach(program_name IN ITEMS clang-tidy clang-apply-replacements) + find_program(${program_name}_BINARY NAMES ${program_name}-devel ${program_name}-8 ${program_name} PATH_SUFFIXES "LLVM/bin") + find_package_handle_standard_args(${program_name} DEFAULT_MSG ${program_name}_BINARY) + if(${program_name}_FOUND AND NOT TARGET ClangTools::${program_name}) + add_executable(ClangTools::${program_name} IMPORTED) + set_property(TARGET ClangTools::${program_name} PROPERTY IMPORTED_LOCATION "${${program_name}_BINARY}") + endif() +endforeach() + +find_program(run-clang-tidy_BINARY NAMES run-clang-tidy run-clang-tidy.py PATH_SUFFIXES "LLVM/bin" "llvm-devel/share/clang") +find_package_handle_standard_args(run-clang-tidy DEFAULT_MSG run-clang-tidy_BINARY) +if(run-clang-tidy_FOUND AND NOT TARGET ClangTools::run-clang-tidy) + add_executable(ClangTools::run-clang-tidy IMPORTED) + set_property(TARGET ClangTools::run-clang-tidy PROPERTY IMPORTED_LOCATION "${run-clang-tidy_BINARY}") +endif() |