summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-01 13:16:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-05-01 13:16:39 (GMT)
commit79f4a772dc268cdd5d2bc4ec51b5f57cf26b1751 (patch)
treef8fb69b77a864666ba95e10ad9590f71d1b73b7f
parenta2a13e8b48b5b55f2c6fd4e457936f91fe23f699 (diff)
parentb13bc8659f87567b1b091806d42f5023b2a6b48b (diff)
downloadCMake-79f4a772dc268cdd5d2bc4ec51b5f57cf26b1751.zip
CMake-79f4a772dc268cdd5d2bc4ec51b5f57cf26b1751.tar.gz
CMake-79f4a772dc268cdd5d2bc4ec51b5f57cf26b1751.tar.bz2
Merge topic 'qt-clang-tidy'
b13bc865 Disable clang-tidy checks on files generated by Qt Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !777
-rw-r--r--Source/QtDialog/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 2e11a8a..8619fe9 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -160,6 +160,19 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE})
target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES})
+# Files generated by MOC, RCC, and UIC may produce clang-tidy warnings.
+# We generate a dummy .clang-tidy file in the binary directory that disables
+# all clang-tidy checks except one that will never match. This one check is
+# necessary; clang-tidy reports an error when no checks are enabled.
+# Since the Qt code generators will generate source files in the binary tree,
+# clang-tidy will load the configuration from this dummy file when the sources
+# are built.
+file(WRITE "${QtDialog_BINARY_DIR}/.clang-tidy" "
+---
+Checks: '-*,llvm-twine-local'
+...
+")
+
if(APPLE)
file(STRINGS "${CMake_SOURCE_DIR}/Copyright.txt" copyright_line
LIMIT_COUNT 1 REGEX "^Copyright 2000-20[0-9][0-9] Kitware")