summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-12-09 12:57:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-12-09 12:58:08 (GMT)
commitaf58b6d2ad9a000146e8db2b1c3c74b1a93456ef (patch)
tree5c82b7b288ebe5c90b695f62d540e8bc3e842846
parentd83b1dbac6ff983604e2ec34322ae97d03a3689b (diff)
parentb2b1faa40323efa1d686f98585be77475e774657 (diff)
downloadCMake-af58b6d2ad9a000146e8db2b1c3c74b1a93456ef.zip
CMake-af58b6d2ad9a000146e8db2b1c3c74b1a93456ef.tar.gz
CMake-af58b6d2ad9a000146e8db2b1c3c74b1a93456ef.tar.bz2
Merge topic 'cmake-clang-tidy-export-fixes-option'
b2b1faa403 CMake: add option to export clang-tidy fixes to a directory Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8005
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a61113a..0485b04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -277,6 +277,15 @@ if(CMake_RUN_CLANG_TIDY)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMake_CLANG_TIDY_MODULE}")
endif()
+ set(CMake_CLANG_TIDY_EXPORT_FIXES_DIR "" CACHE PATH "Directory to put clang-tidy fix files in.")
+ mark_as_advanced(CMake_CLANG_TIDY_EXPORT_FIXES_DIR)
+ if(CMake_CLANG_TIDY_EXPORT_FIXES_DIR)
+ if(NOT IS_ABSOLUTE "${CMake_CLANG_TIDY_EXPORT_FIXES_DIR}")
+ message(FATAL_ERROR "CMake_CLANG_TIDY_EXPORT_FIXES_DIR must be an absolute path!")
+ endif()
+ set(CMAKE_CXX_CLANG_TIDY_EXPORT_FIXES_DIR "${CMake_CLANG_TIDY_EXPORT_FIXES_DIR}")
+ endif()
+
# Create a preprocessor definition that depends on .clang-tidy content so
# the compile command will change when .clang-tidy changes. This ensures
# that a subsequent build re-runs clang-tidy on all sources even if they