Преглед изворни кода

Merge topic 'third-parties-layout'

2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
75e87e3db4 bootstrap: update list of problematic files

Acked-by: Kitware Robot <[email protected]>
Merge-request: !4705
Brad King пре 5 година
родитељ
комит
171bf5fa92
100 измењених фајлова са 259 додато и 239 уклоњено
  1. 6 4
      .clang-format
  2. 7 4
      CMakeLists.txt
  3. 15 0
      Help/dev/source.rst
  4. 1 1
      Source/CPack/WiX/cmWIXPatchParser.cxx
  5. 1 1
      Source/CPack/cmCPackArchiveGenerator.cxx
  6. 3 3
      Source/CPack/cmCPackExternalGenerator.cxx
  7. 2 2
      Source/CTest/cmCTestBZR.cxx
  8. 1 1
      Source/CTest/cmCTestCurl.h
  9. 4 4
      Source/CTest/cmCTestMultiProcessHandler.cxx
  10. 1 2
      Source/CTest/cmCTestMultiProcessHandler.h
  11. 3 3
      Source/CTest/cmCTestResourceSpec.cxx
  12. 3 3
      Source/CTest/cmCTestSubmitHandler.cxx
  13. 1 1
      Source/CTest/cmProcess.cxx
  14. 1 2
      Source/CTest/cmProcess.h
  15. 1 1
      Source/cmAffinity.cxx
  16. 0 2
      Source/cmAlgorithms.h
  17. 3 1
      Source/cmArchiveWrite.cxx
  18. 3 3
      Source/cmCTest.cxx
  19. 10 1
      Source/cmConnection.cxx
  20. 1 1
      Source/cmConnection.h
  21. 3 3
      Source/cmCryptoHash.cxx
  22. 1 1
      Source/cmCurl.h
  23. 3 3
      Source/cmELF.cxx
  24. 1 1
      Source/cmExprParserHelper.h
  25. 3 3
      Source/cmFileAPI.h
  26. 1 1
      Source/cmFileAPICMakeFiles.cxx
  27. 1 1
      Source/cmFileAPICMakeFiles.h
  28. 1 1
      Source/cmFileAPICache.cxx
  29. 1 1
      Source/cmFileAPICache.h
  30. 1 1
      Source/cmFileAPICodemodel.cxx
  31. 1 1
      Source/cmFileAPICodemodel.h
  32. 3 2
      Source/cmFileCommand.cxx
  33. 1 1
      Source/cmFileMonitor.h
  34. 1 1
      Source/cmFindPackageCommand.h
  35. 2 1
      Source/cmGeneratedFileStream.cxx
  36. 1 2
      Source/cmGetPipes.cxx
  37. 2 2
      Source/cmGlobalGenerator.cxx
  38. 1 1
      Source/cmGlobalGenerator.h
  39. 4 4
      Source/cmGlobalNinjaGenerator.cxx
  40. 2 2
      Source/cmGlobalVisualStudio10Generator.cxx
  41. 1 1
      Source/cmJsonObjects.h
  42. 1 1
      Source/cmLocalGenerator.h
  43. 1 1
      Source/cmLocalVisualStudio10Generator.cxx
  44. 1 2
      Source/cmLocalVisualStudio7Generator.cxx
  45. 3 2
      Source/cmMakefile.cxx
  46. 3 3
      Source/cmMakefileProfilingData.cxx
  47. 1 1
      Source/cmMathCommand.cxx
  48. 2 2
      Source/cmNinjaTargetGenerator.cxx
  49. 1 1
      Source/cmNinjaTargetGenerator.h
  50. 1 1
      Source/cmPipeConnection.h
  51. 3 3
      Source/cmQtAutoGenInitializer.cxx
  52. 2 2
      Source/cmQtAutoGenerator.cxx
  53. 1 1
      Source/cmQtAutoGenerator.h
  54. 2 2
      Source/cmQtAutoMocUic.cxx
  55. 4 3
      Source/cmServer.cxx
  56. 2 2
      Source/cmServer.h
  57. 1 1
      Source/cmServerConnection.cxx
  58. 1 1
      Source/cmServerProtocol.cxx
  59. 1 1
      Source/cmServerProtocol.h
  60. 1 1
      Source/cmStandardLexer.h
  61. 3 2
      Source/cmSystemTools.cxx
  62. 1 1
      Source/cmUVHandlePtr.cxx
  63. 1 1
      Source/cmUVHandlePtr.h
  64. 1 1
      Source/cmUVProcessChain.cxx
  65. 1 1
      Source/cmUVProcessChain.h
  66. 1 1
      Source/cmUVSignalHackRAII.h
  67. 1 1
      Source/cmUVStreambuf.h
  68. 1 2
      Source/cmVSSetupHelper.h
  69. 1 1
      Source/cmVersion.h
  70. 1 1
      Source/cmWorkerPool.cxx
  71. 2 2
      Source/cmXMLParser.cxx
  72. 1 1
      Source/cmake.cxx
  73. 1 1
      Source/cmake.h
  74. 4 2
      Source/cmakemain.cxx
  75. 1 2
      Source/cmcmd.cxx
  76. 1 1
      Tests/CMakeLib/testUVProcessChain.cxx
  77. 1 1
      Tests/CMakeLib/testUVRAII.cxx
  78. 1 2
      Tests/CMakeLib/testUVStreambuf.cxx
  79. 1 1
      Tests/CPackWiXGenerator/myotherapp.cpp
  80. BIN
      Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
  81. 1 1
      Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp
  82. 9 50
      Utilities/IWYU/mapping.imp
  83. 8 0
      Utilities/cm3p/Setup.Configuration.h
  84. 4 6
      Utilities/cm3p/archive.h
  85. 14 0
      Utilities/cm3p/archive_entry.h
  86. 4 4
      Utilities/cm3p/bzlib.h
  87. 4 4
      Utilities/cm3p/curl/curl.h
  88. 4 4
      Utilities/cm3p/expat.h
  89. 4 4
      Utilities/cm3p/json/reader.h
  90. 4 4
      Utilities/cm3p/json/value.h
  91. 4 4
      Utilities/cm3p/json/writer.h
  92. 4 6
      Utilities/cm3p/kwiml/abi.h
  93. 14 0
      Utilities/cm3p/kwiml/int.h
  94. 4 4
      Utilities/cm3p/lzma.h
  95. 4 4
      Utilities/cm3p/rhash.h
  96. 4 4
      Utilities/cm3p/uv.h
  97. 4 4
      Utilities/cm3p/zlib.h
  98. 4 4
      Utilities/cm3p/zstd.h
  99. 1 1
      Utilities/cmexpat/lib/siphash.h
  100. 1 1
      Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c

+ 6 - 4
.clang-format

@@ -32,16 +32,18 @@ IncludeCategories:
     Priority:        5
   - Regex:           '^(<|")Qt?[A-Z]'
     Priority:        6
-  - Regex:           '^(<|")cmsys/'
+  - Regex:           '^<cmtp/'
     Priority:        7
-  - Regex:           '^(<|")cm_'
+  - Regex:           '^(<|")cmsys/'
     Priority:        8
-  - Regex:           '^(<|")cm[A-Z][^.]+\.h'
+  - Regex:           '^(<|")cm_'
     Priority:        9
+  - Regex:           '^(<|")cm[A-Z][^.]+\.h'
+    Priority:        10
   - Regex:           '^<[^.]+\.h'
     Priority:        4
   - Regex:           '^<'
     Priority:        1
   - Regex:           '.*'
-    Priority:        10
+    Priority:        11
 ...

+ 7 - 4
CMakeLists.txt

@@ -376,10 +376,13 @@ macro (CMAKE_BUILD_UTILITIES)
     include_directories(SYSTEM "${CMake_SOURCE_DIR}/Utilities/std")
   endif()
 
-  include_directories(
-    ${CMake_BINARY_DIR}/Utilities
-    ${CMake_SOURCE_DIR}/Utilities
-    )
+  include_directories("${CMake_BINARY_DIR}/Utilities")
+  if ((CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+    # using -isystem option generate error "template with C linkage"
+    include_directories("${CMake_SOURCE_DIR}/Utilities")
+  else()
+    include_directories(SYSTEM "${CMake_SOURCE_DIR}/Utilities")
+  endif()
 
   #---------------------------------------------------------------------
   # Build CMake std library for CMake and CTest.

+ 15 - 0
Help/dev/source.rst

@@ -163,6 +163,18 @@ It is allowed to pass raw pointers between objects to enable objects sharing.
 A raw pointer **must** not be deleted. Only the object(s) owning the smart
 pointer are allowed to delete dynamically allocated memory.
 
+Third Parties
+=============
+
+To build CMake, some third parties are needed. Under ``Utilities``
+directory, are versions of these third parties which can be used as an
+alternate to the ones provided by the system.
+
+To enable the selection of the third parties between the system and CMake ones,
+in CMake sources, third parties headers must be prefixed by ``cm3p/``
+(for example: ``<cm3p/json/reader.h>``). These wrappers are located under
+``Utilities/cm3p`` directory.
+
 Source Tree Layout
 ==================
 
@@ -208,6 +220,9 @@ The CMake source tree is organized as follows.
   * ``Utilities/std/cmext``:
     Extensions to the C++ STL.
 
+  * ``Utilities/cm3p``:
+    Public headers for third parties needed to build CMake.
+
   * ``Utilities/Sphinx/``:
     Sphinx configuration to build CMake user documentation.
 

+ 1 - 1
Source/CPack/WiX/cmWIXPatchParser.cxx

@@ -6,7 +6,7 @@
 
 #include <cm/memory>
 
-#include "cm_expat.h"
+#include <cm3p/expat.h>
 
 #include "cmCPackGenerator.h"
 

+ 1 - 1
Source/CPack/cmCPackArchiveGenerator.cxx

@@ -8,7 +8,7 @@
 #include <utility>
 #include <vector>
 
-#include "cm_libarchive.h"
+#include <cm3p/archive.h>
 
 #include "cmCPackComponentGroup.h"
 #include "cmCPackGenerator.h"

+ 3 - 3
Source/CPack/cmCPackExternalGenerator.cxx

@@ -8,10 +8,10 @@
 
 #include <cm/memory>
 
-#include "cmsys/FStream.hxx"
+#include <cm3p/json/value.h>
+#include <cm3p/json/writer.h>
 
-#include "cm_jsoncpp_value.h"
-#include "cm_jsoncpp_writer.h"
+#include "cmsys/FStream.hxx"
 
 #include "cmCPackComponentGroup.h"
 #include "cmCPackLog.h"

+ 2 - 2
Source/CTest/cmCTestBZR.cxx

@@ -10,9 +10,9 @@
 
 #include <cmext/algorithm>
 
-#include "cmsys/RegularExpression.hxx"
+#include <cm3p/expat.h>
 
-#include "cm_expat.h"
+#include "cmsys/RegularExpression.hxx"
 
 #include "cmCTest.h"
 #include "cmCTestVC.h"

+ 1 - 1
Source/CTest/cmCTestCurl.h

@@ -8,7 +8,7 @@
 #include <string>
 #include <vector>
 
-#include "cm_curl.h"
+#include <cm3p/curl/curl.h>
 
 class cmCTest;
 

+ 4 - 4
Source/CTest/cmCTestMultiProcessHandler.cxx

@@ -21,13 +21,13 @@
 #include <cm/memory>
 #include <cmext/algorithm>
 
+#include <cm3p/json/value.h>
+#include <cm3p/json/writer.h>
+#include <cm3p/uv.h>
+
 #include "cmsys/FStream.hxx"
 #include "cmsys/SystemInformation.hxx"
 
-#include "cm_jsoncpp_value.h"
-#include "cm_jsoncpp_writer.h"
-#include "cm_uv.h"
-
 #include "cmAffinity.h"
 #include "cmCTest.h"
 #include "cmCTestBinPacker.h"

+ 1 - 2
Source/CTest/cmCTestMultiProcessHandler.h

@@ -11,10 +11,9 @@
 #include <string>
 #include <vector>
 
+#include <cm3p/uv.h>
 #include <stddef.h>
 
-#include "cm_uv.h"
-
 #include "cmCTest.h"
 #include "cmCTestResourceAllocator.h"
 #include "cmCTestTestHandler.h"

+ 3 - 3
Source/CTest/cmCTestResourceSpec.cxx

@@ -7,12 +7,12 @@
 #include <utility>
 #include <vector>
 
+#include <cm3p/json/reader.h>
+#include <cm3p/json/value.h>
+
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
 
-#include "cm_jsoncpp_reader.h"
-#include "cm_jsoncpp_value.h"
-
 static const cmsys::RegularExpression IdentifierRegex{ "^[a-z_][a-z0-9_]*$" };
 static const cmsys::RegularExpression IdRegex{ "^[a-z0-9_]+$" };
 

+ 3 - 3
Source/CTest/cmCTestSubmitHandler.cxx

@@ -9,9 +9,9 @@
 
 #include <cmext/algorithm>
 
-#include "cm_curl.h"
-#include "cm_jsoncpp_reader.h"
-#include "cm_jsoncpp_value.h"
+#include <cm3p/curl/curl.h>
+#include <cm3p/json/reader.h>
+#include <cm3p/json/value.h>
 
 #include "cmAlgorithms.h"
 #include "cmCTest.h"

+ 1 - 1
Source/CTest/cmProcess.cxx

@@ -17,7 +17,7 @@
 #include "cmGetPipes.h"
 #include "cmStringAlgorithms.h"
 #if defined(_WIN32)
-#  include "cm_kwiml.h"
+#  include <cm3p/kwiml/int.h>
 #endif
 
 #define CM_PROCESS_BUF_SIZE 65536

+ 1 - 2
Source/CTest/cmProcess.h

@@ -11,11 +11,10 @@
 #include <utility>
 #include <vector>
 
+#include <cm3p/uv.h>
 #include <stddef.h>
 #include <stdint.h>
 
-#include "cm_uv.h"
-
 #include "cmDuration.h"
 #include "cmProcessOutput.h"
 #include "cmUVHandlePtr.h"

+ 1 - 1
Source/cmAffinity.cxx

@@ -2,7 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmAffinity.h"
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #ifndef CMAKE_USE_SYSTEM_LIBUV
 #  ifdef _WIN32

+ 0 - 2
Source/cmAlgorithms.h

@@ -15,8 +15,6 @@
 
 #include <cmext/algorithm>
 
-#include "cm_kwiml.h"
-
 #include "cmRange.h"
 
 template <typename FwdIt>

+ 3 - 1
Source/cmArchiveWrite.cxx

@@ -7,12 +7,14 @@
 #include <iostream>
 #include <sstream>
 
+#include <cm3p/archive.h>
+#include <cm3p/archive_entry.h>
+
 #include "cmsys/Directory.hxx"
 #include "cmsys/Encoding.hxx"
 #include "cmsys/FStream.hxx"
 
 #include "cm_get_date.h"
-#include "cm_libarchive.h"
 
 #include "cmLocale.h"
 #include "cmStringAlgorithms.h"

+ 3 - 3
Source/cmCTest.cxx

@@ -21,6 +21,9 @@
 #include <cmext/algorithm>
 #include <cmext/string_view>
 
+#include <cm3p/curl/curl.h>
+#include <cm3p/zlib.h>
+
 #include "cmsys/Base64.h"
 #include "cmsys/Directory.hxx"
 #include "cmsys/FStream.hxx"
@@ -28,9 +31,6 @@
 #include "cmsys/Process.h"
 #include "cmsys/RegularExpression.hxx"
 #include "cmsys/SystemInformation.hxx"
-
-#include "cm_curl.h"
-#include "cm_zlib.h"
 #if defined(_WIN32)
 #  include <windows.h> // IWYU pragma: keep
 #else

+ 10 - 1
Source/cmConnection.cxx

@@ -5,7 +5,7 @@
 #include <cassert>
 #include <cstring>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmServer.h"
 
@@ -20,8 +20,13 @@ void cmEventBasedConnection::on_alloc_buffer(uv_handle_t* handle,
                                              uv_buf_t* buf)
 {
   (void)(handle);
+#ifndef __clang_analyzer__
   char* rawBuffer = new char[suggested_size];
   *buf = uv_buf_init(rawBuffer, static_cast<unsigned int>(suggested_size));
+#else
+  (void)(suggested_size);
+  (void)(buf);
+#endif /* __clang_analyzer__ */
 }
 
 void cmEventBasedConnection::on_read(uv_stream_t* stream, ssize_t nread,
@@ -76,6 +81,7 @@ void cmEventBasedConnection::WriteData(const std::string& _data)
   assert(uv_thread_equal(&curr_thread_id, &this->Server->ServeThreadId));
 #endif
 
+#ifndef __clang_analyzer__
   auto data = _data;
   assert(this->WriteStream.get());
   if (BufferStrategy) {
@@ -90,6 +96,9 @@ void cmEventBasedConnection::WriteData(const std::string& _data)
   memcpy(req->buf.base, data.c_str(), ds);
   uv_write(reinterpret_cast<uv_write_t*>(req), this->WriteStream, &req->buf, 1,
            on_write);
+#else
+  (void)(_data);
+#endif /* __clang_analyzer__ */
 }
 
 void cmEventBasedConnection::ReadData(const std::string& data)

+ 1 - 1
Source/cmConnection.h

@@ -9,7 +9,7 @@
 #include <memory>
 #include <string>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmUVHandlePtr.h"
 

+ 3 - 3
Source/cmCryptoHash.cxx

@@ -4,10 +4,10 @@
 
 #include <cm/memory>
 
-#include "cmsys/FStream.hxx"
+#include <cm3p/kwiml/int.h>
+#include <cm3p/rhash.h>
 
-#include "cm_kwiml.h"
-#include "cm_rhash.h"
+#include "cmsys/FStream.hxx"
 
 static unsigned int const cmCryptoHashAlgoToId[] = {
   /* clang-format needs this comment to break after the opening brace */

+ 1 - 1
Source/cmCurl.h

@@ -7,7 +7,7 @@
 
 #include <string>
 
-#include "cm_curl.h"
+#include <cm3p/curl/curl.h>
 
 std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = nullptr);
 std::string cmCurlSetNETRCOption(::CURL* curl, const std::string& netrc_level,

+ 3 - 3
Source/cmELF.cxx

@@ -3,6 +3,7 @@
 #include "cmELF.h"
 
 #include <cstddef>
+#include <cstdint>
 #include <map>
 #include <memory>
 #include <sstream>
@@ -12,14 +13,13 @@
 #include <cm/memory>
 #include <cmext/algorithm>
 
-#include "cmsys/FStream.hxx"
+#include <cm3p/kwiml/abi.h>
 
-#include "cm_kwiml.h"
+#include "cmsys/FStream.hxx"
 
 // Include the ELF format information system header.
 #if defined(__OpenBSD__)
 #  include <elf_abi.h>
-#  include <stdint.h>
 #elif defined(__HAIKU__)
 #  include <elf32.h>
 #  include <elf64.h>

+ 1 - 1
Source/cmExprParserHelper.h

@@ -8,7 +8,7 @@
 #include <string>
 #include <vector>
 
-#include "cm_kwiml.h"
+#include <cm3p/kwiml/int.h>
 
 class cmExprParserHelper
 {

+ 3 - 3
Source/cmFileAPI.h

@@ -11,9 +11,9 @@
 #include <unordered_set>
 #include <vector>
 
-#include "cm_jsoncpp_reader.h"
-#include "cm_jsoncpp_value.h"
-#include "cm_jsoncpp_writer.h"
+#include <cm3p/json/reader.h>
+#include <cm3p/json/value.h>
+#include <cm3p/json/writer.h>
 
 class cmake;
 

+ 1 - 1
Source/cmFileAPICMakeFiles.cxx

@@ -6,7 +6,7 @@
 #include <string>
 #include <vector>
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 #include "cmFileAPI.h"
 #include "cmGlobalGenerator.h"

+ 1 - 1
Source/cmFileAPICMakeFiles.h

@@ -5,7 +5,7 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 class cmFileAPI;
 

+ 1 - 1
Source/cmFileAPICache.cxx

@@ -7,7 +7,7 @@
 #include <utility>
 #include <vector>
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 #include "cmFileAPI.h"
 #include "cmState.h"

+ 1 - 1
Source/cmFileAPICache.h

@@ -5,7 +5,7 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 class cmFileAPI;
 

+ 1 - 1
Source/cmFileAPICodemodel.cxx

@@ -17,7 +17,7 @@
 
 #include <cmext/algorithm>
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 #include "cmCryptoHash.h"
 #include "cmFileAPI.h"

+ 1 - 1
Source/cmFileAPICodemodel.h

@@ -5,7 +5,7 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 class cmFileAPI;
 

+ 3 - 2
Source/cmFileCommand.cxx

@@ -19,11 +19,12 @@
 #include <cmext/algorithm>
 #include <cmext/string_view>
 
+#include <cm3p/kwiml/int.h>
+
 #include "cmsys/FStream.hxx"
 #include "cmsys/Glob.hxx"
 #include "cmsys/RegularExpression.hxx"
 
-#include "cm_kwiml.h"
 #include "cm_sys_stat.h"
 
 #include "cmAlgorithms.h"
@@ -54,7 +55,7 @@
 #include "cmake.h"
 
 #if !defined(CMAKE_BOOTSTRAP)
-#  include "cm_curl.h"
+#  include <cm3p/curl/curl.h>
 
 #  include "cmCurl.h"
 #  include "cmFileLockResult.h"

+ 1 - 1
Source/cmFileMonitor.h

@@ -9,7 +9,7 @@
 #include <string>
 #include <vector>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 class cmRootWatcher;
 

+ 1 - 1
Source/cmFindPackageCommand.h

@@ -12,7 +12,7 @@
 #include <string>
 #include <vector>
 
-#include "cm_kwiml.h"
+#include <cm3p/kwiml/int.h>
 
 #include "cmFindCommon.h"
 #include "cmPolicies.h"

+ 2 - 1
Source/cmGeneratedFileStream.cxx

@@ -8,8 +8,9 @@
 #include "cmSystemTools.h"
 
 #if !defined(CMAKE_BOOTSTRAP)
+#  include <cm3p/zlib.h>
+
 #  include "cm_codecvt.hxx"
-#  include "cm_zlib.h"
 #endif
 
 cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)

+ 1 - 2
Source/cmGetPipes.cxx

@@ -2,10 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGetPipes.h"
 
+#include <cm3p/uv.h>
 #include <fcntl.h>
 
-#include "cm_uv.h"
-
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #  include <io.h>
 

+ 2 - 2
Source/cmGlobalGenerator.cxx

@@ -52,8 +52,8 @@
 #include "cmake.h"
 
 #if !defined(CMAKE_BOOTSTRAP)
-#  include "cm_jsoncpp_value.h"
-#  include "cm_jsoncpp_writer.h"
+#  include <cm3p/json/value.h>
+#  include <cm3p/json/writer.h>
 
 #  include "cmCryptoHash.h"
 #  include "cmQtAutoGenGlobalInitializer.h"

+ 1 - 1
Source/cmGlobalGenerator.h

@@ -28,7 +28,7 @@
 #include "cmTargetDepend.h"
 
 #if !defined(CMAKE_BOOTSTRAP)
-#  include "cm_jsoncpp_value.h"
+#  include <cm3p/json/value.h>
 
 #  include "cmFileLockPool.h"
 #endif

+ 4 - 4
Source/cmGlobalNinjaGenerator.cxx

@@ -12,11 +12,11 @@
 #include <cmext/algorithm>
 #include <cmext/memory>
 
-#include "cmsys/FStream.hxx"
+#include <cm3p/json/reader.h>
+#include <cm3p/json/value.h>
+#include <cm3p/json/writer.h>
 
-#include "cm_jsoncpp_reader.h"
-#include "cm_jsoncpp_value.h"
-#include "cm_jsoncpp_writer.h"
+#include "cmsys/FStream.hxx"
 
 #include "cmDocumentationEntry.h"
 #include "cmFortranParser.h"

+ 2 - 2
Source/cmGlobalVisualStudio10Generator.cxx

@@ -6,12 +6,12 @@
 
 #include <cm/memory>
 
+#include <cm3p/json/reader.h>
+
 #include "cmsys/FStream.hxx"
 #include "cmsys/Glob.hxx"
 #include "cmsys/RegularExpression.hxx"
 
-#include "cm_jsoncpp_reader.h"
-
 #include "cmAlgorithms.h"
 #include "cmDocumentationEntry.h"
 #include "cmGeneratorTarget.h"

+ 1 - 1
Source/cmJsonObjects.h

@@ -8,7 +8,7 @@
 #include <string>
 #include <vector>
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 class cmake;
 class cmGlobalGenerator;

+ 1 - 1
Source/cmLocalGenerator.h

@@ -13,7 +13,7 @@
 #include <unordered_map>
 #include <vector>
 
-#include "cm_kwiml.h"
+#include <cm3p/kwiml/int.h>
 
 #include "cmCustomCommandTypes.h"
 #include "cmListFileCache.h"

+ 1 - 1
Source/cmLocalVisualStudio10Generator.cxx

@@ -4,7 +4,7 @@
 
 #include <cmext/algorithm>
 
-#include "cm_expat.h"
+#include <cm3p/expat.h>
 
 #include "cmAlgorithms.h"
 #include "cmGeneratorTarget.h"

+ 1 - 2
Source/cmLocalVisualStudio7Generator.cxx

@@ -7,10 +7,9 @@
 
 #include <windows.h>
 
+#include <cm3p/expat.h>
 #include <ctype.h> // for isspace
 
-#include "cm_expat.h"
-
 #include "cmComputeLinkInformation.h"
 #include "cmCustomCommand.h"
 #include "cmCustomCommandGenerator.h"

+ 3 - 2
Source/cmMakefile.cxx

@@ -20,11 +20,12 @@
 #include <cmext/algorithm>
 #include <cmext/string_view>
 
+#include <cm3p/json/value.h>
+#include <cm3p/json/writer.h>
+
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
 
-#include "cm_jsoncpp_value.h"
-#include "cm_jsoncpp_writer.h"
 #include "cm_sys_stat.h"
 
 #include "cmCommandArgumentParserHelper.h"

+ 3 - 3
Source/cmMakefileProfilingData.cxx

@@ -6,12 +6,12 @@
 #include <stdexcept>
 #include <vector>
 
+#include <cm3p/json/value.h>
+#include <cm3p/json/writer.h>
+
 #include "cmsys/FStream.hxx"
 #include "cmsys/SystemInformation.hxx"
 
-#include "cm_jsoncpp_value.h"
-#include "cm_jsoncpp_writer.h"
-
 #include "cmListFileCache.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"

+ 1 - 1
Source/cmMathCommand.cxx

@@ -4,7 +4,7 @@
 
 #include <cstdio>
 
-#include "cm_kwiml.h"
+#include <cm3p/kwiml/int.h>
 
 #include "cmExecutionStatus.h"
 #include "cmExprParserHelper.h"

+ 2 - 2
Source/cmNinjaTargetGenerator.cxx

@@ -14,8 +14,8 @@
 #include <cm/memory>
 #include <cmext/algorithm>
 
-#include "cm_jsoncpp_value.h"
-#include "cm_jsoncpp_writer.h"
+#include <cm3p/json/value.h>
+#include <cm3p/json/writer.h>
 
 #include "cmComputeLinkInformation.h"
 #include "cmCustomCommandGenerator.h"

+ 1 - 1
Source/cmNinjaTargetGenerator.h

@@ -12,7 +12,7 @@
 #include <utility>
 #include <vector>
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 #include "cmCommonTargetGenerator.h"
 #include "cmGlobalNinjaGenerator.h"

+ 1 - 1
Source/cmPipeConnection.h

@@ -6,7 +6,7 @@
 
 #include <string>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmConnection.h"
 #include "cmUVHandlePtr.h"

+ 3 - 3
Source/cmQtAutoGenInitializer.cxx

@@ -18,10 +18,10 @@
 #include <cm/memory>
 #include <cmext/algorithm>
 
-#include "cmsys/SystemInformation.hxx"
+#include <cm3p/json/value.h>
+#include <cm3p/json/writer.h>
 
-#include "cm_jsoncpp_value.h"
-#include "cm_jsoncpp_writer.h"
+#include "cmsys/SystemInformation.hxx"
 
 #include "cmCustomCommand.h"
 #include "cmCustomCommandLines.h"

+ 2 - 2
Source/cmQtAutoGenerator.cxx

@@ -2,9 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmQtAutoGenerator.h"
 
-#include "cmsys/FStream.hxx"
+#include <cm3p/json/reader.h>
 
-#include "cm_jsoncpp_reader.h"
+#include "cmsys/FStream.hxx"
 
 #include "cmQtAutoGen.h"
 #include "cmStringAlgorithms.h"

+ 1 - 1
Source/cmQtAutoGenerator.h

@@ -13,7 +13,7 @@
 
 #include <cm/string_view>
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 #include "cmFileTime.h"
 #include "cmQtAutoGen.h"

+ 2 - 2
Source/cmQtAutoMocUic.cxx

@@ -18,11 +18,11 @@
 #include <cm/string_view>
 #include <cmext/algorithm>
 
+#include <cm3p/json/value.h>
+
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
 
-#include "cm_jsoncpp_value.h"
-
 #include "cmCryptoHash.h"
 #include "cmFileTime.h"
 #include "cmGccDepfileReader.h"

+ 4 - 3
Source/cmServer.cxx

@@ -4,6 +4,7 @@
 
 #include <algorithm>
 #include <cassert>
+#include <csignal>
 #include <cstdint>
 #include <iostream>
 #include <mutex>
@@ -12,10 +13,10 @@
 #include <cm/memory>
 #include <cm/shared_mutex>
 
-#include "cmsys/FStream.hxx"
+#include <cm3p/json/reader.h>
+#include <cm3p/json/writer.h>
 
-#include "cm_jsoncpp_reader.h"
-#include "cm_jsoncpp_writer.h"
+#include "cmsys/FStream.hxx"
 
 #include "cmConnection.h"
 #include "cmFileMonitor.h"

+ 2 - 2
Source/cmServer.h

@@ -10,8 +10,8 @@
 
 #include <cm/shared_mutex>
 
-#include "cm_jsoncpp_value.h"
-#include "cm_uv.h"
+#include <cm3p/json/value.h>
+#include <cm3p/uv.h>
 
 #include "cmUVHandlePtr.h"
 

+ 1 - 1
Source/cmServerConnection.cxx

@@ -4,7 +4,7 @@
 
 #include "cmServerConnection.h"
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmServer.h"
 #include "cmServerDictionary.h"

+ 1 - 1
Source/cmServerProtocol.cxx

@@ -12,7 +12,7 @@
 #include <cm/memory>
 #include <cmext/algorithm>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmExternalMakefileProjectGenerator.h"
 #include "cmFileMonitor.h"

+ 1 - 1
Source/cmServerProtocol.h

@@ -8,7 +8,7 @@
 #include <string>
 #include <utility>
 
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
 
 #include "cmake.h"
 

+ 1 - 1
Source/cmStandardLexer.h

@@ -63,7 +63,7 @@
 #define YY_NO_UNPUT 1
 #define ECHO
 
-#include "cm_kwiml.h"
+#include <cm3p/kwiml/int.h>
 typedef KWIML_INT_int8_t flex_int8_t;
 typedef KWIML_INT_uint8_t flex_uint8_t;
 typedef KWIML_INT_int16_t flex_int16_t;

+ 3 - 2
Source/cmSystemTools.cxx

@@ -14,7 +14,7 @@
 
 #include <cmext/algorithm>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmDuration.h"
 #include "cmProcessOutput.h"
@@ -22,7 +22,8 @@
 #include "cmStringAlgorithms.h"
 
 #if !defined(CMAKE_BOOTSTRAP)
-#  include "cm_libarchive.h"
+#  include <cm3p/archive.h>
+#  include <cm3p/archive_entry.h>
 
 #  include "cmArchiveWrite.h"
 #  include "cmLocale.h"

+ 1 - 1
Source/cmUVHandlePtr.cxx

@@ -7,7 +7,7 @@
 #include <cstdlib>
 #include <mutex>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 namespace cm {
 

+ 1 - 1
Source/cmUVHandlePtr.h

@@ -8,7 +8,7 @@
 #include <memory>
 #include <type_traits>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #if defined(__SUNPRO_CC)
 

+ 1 - 1
Source/cmUVProcessChain.cxx

@@ -9,7 +9,7 @@
 
 #include <cm/memory>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmGetPipes.h"
 #include "cmUVHandlePtr.h"

+ 1 - 1
Source/cmUVProcessChain.h

@@ -11,7 +11,7 @@
 #include <string>
 #include <vector>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 class cmUVProcessChain;
 

+ 1 - 1
Source/cmUVSignalHackRAII.h

@@ -3,7 +3,7 @@
 #pragma once
 #include "cmConfigure.h" // IWYU pragma: keep
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #if defined(CMAKE_USE_SYSTEM_LIBUV) && !defined(_WIN32) &&                    \
   UV_VERSION_MAJOR == 1 && UV_VERSION_MINOR < 19

+ 1 - 1
Source/cmUVStreambuf.h

@@ -8,7 +8,7 @@
 #include <streambuf>
 #include <vector>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmUVHandlePtr.h"
 

+ 1 - 2
Source/cmVSSetupHelper.h

@@ -8,13 +8,12 @@
 #endif
 
 // Published by Visual Studio Setup team
+#include <cm3p/Setup.Configuration.h>
 #include <string>
 #include <vector>
 
 #include <windows.h>
 
-#include "cmvssetup/Setup.Configuration.h"
-
 template <class T>
 class SmartCOMPtr
 {

+ 1 - 1
Source/cmVersion.h

@@ -3,7 +3,7 @@
 #ifndef cmVersion_h
 #define cmVersion_h
 
-#include "cm_kwiml.h"
+#include <cm3p/kwiml/int.h>
 
 /** \class cmVersion
  * \brief Helper class for providing CMake and CTest version information.

+ 1 - 1
Source/cmWorkerPool.cxx

@@ -13,7 +13,7 @@
 
 #include <cm/memory>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmRange.h"
 #include "cmStringAlgorithms.h"

+ 2 - 2
Source/cmXMLParser.cxx

@@ -7,9 +7,9 @@
 #include <iostream>
 #include <sstream>
 
-#include "cmsys/FStream.hxx"
+#include <cm3p/expat.h>
 
-#include "cm_expat.h"
+#include "cmsys/FStream.hxx"
 
 cmXMLParser::cmXMLParser()
 {

+ 1 - 1
Source/cmake.cxx

@@ -57,7 +57,7 @@
 #if !defined(CMAKE_BOOTSTRAP)
 #  include <unordered_map>
 
-#  include "cm_jsoncpp_writer.h"
+#  include <cm3p/json/writer.h>
 
 #  include "cmFileAPI.h"
 #  include "cmGraphVizWriter.h"

+ 1 - 1
Source/cmake.h

@@ -27,7 +27,7 @@
 #include "cmStateTypes.h"
 
 #if !defined(CMAKE_BOOTSTRAP)
-#  include "cm_jsoncpp_value.h"
+#  include <cm3p/json/value.h>
 #endif
 
 class cmExternalMakefileProjectGeneratorFactory;

+ 4 - 2
Source/cmakemain.cxx

@@ -1,6 +1,8 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
 
+#include "cmConfigure.h" // IWYU pragma: keep
+
 #include <cassert>
 #include <cctype>
 #include <climits>
@@ -11,6 +13,8 @@
 
 #include <cmext/algorithm>
 
+#include <cm3p/uv.h>
+
 #include "cmDocumentationEntry.h" // IWYU pragma: keep
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
@@ -27,8 +31,6 @@
 #endif
 
 #include "cmsys/Encoding.hxx"
-
-#include "cm_uv.h"
 #if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
 #  include "cmsys/ConsoleBuf.hxx"
 #endif

+ 1 - 2
Source/cmcmd.cxx

@@ -4,10 +4,9 @@
 
 #include <cmext/algorithm>
 
+#include <cm3p/uv.h>
 #include <fcntl.h>
 
-#include "cm_uv.h"
-
 #include "cmDuration.h"
 #include "cmGlobalGenerator.h"
 #include "cmLocalGenerator.h"

+ 1 - 1
Tests/CMakeLib/testUVProcessChain.cxx

@@ -8,7 +8,7 @@
 
 #include <cm/memory>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmGetPipes.h"
 #include "cmUVHandlePtr.h"

+ 1 - 1
Tests/CMakeLib/testUVRAII.cxx

@@ -3,7 +3,7 @@
 #include <thread>
 #include <utility>
 
-#include "cm_uv.h"
+#include <cm3p/uv.h>
 
 #include "cmUVHandlePtr.h"
 

+ 1 - 2
Tests/CMakeLib/testUVStreambuf.cxx

@@ -3,10 +3,9 @@
 #include <string>
 #include <vector>
 
+#include <cm3p/uv.h>
 #include <stdint.h>
 
-#include "cm_uv.h"
-
 #include "cmGetPipes.h"
 #include "cmUVHandlePtr.h"
 #include "cmUVStreambuf.h"

+ 1 - 1
Tests/CPackWiXGenerator/myotherapp.cpp

@@ -1,3 +1,3 @@
 int main()
 {
-}
+}

BIN
Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h


+ 1 - 1
Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp

@@ -1 +1 @@
-#include "MyForm.h"
+#include "MyForm.h"

+ 9 - 50
Utilities/IWYU/mapping.imp

@@ -97,54 +97,15 @@
   { symbol: [ "std::enable_if<true, std::chrono::duration<long, std::ratio<60, 1> > >::type", private, "\"cmConfigure.h\"", public ] },
   { symbol: [ "std::enable_if<true, std::chrono::duration<long, std::ratio<1, 1000> > >::type", private, "\"cmConfigure.h\"", public ] },
 
-  # KWIML
-  { include: [ "<stdint.h>", public, "\"cm_kwiml.h\"", public ] },
-  { include: [ "<inttypes.h>", public, "\"cm_kwiml.h\"", public ] },
-
-  # Self-sufficient wrapper for <sys/stat.h>
-  { symbol: [ "mode_t", private, "\"cm_sys_stat.h\"", public ] },
-
-  # Wrappers for 3rd-party libraries used from the system.
-  { include: [ "<archive.h>", private, "\"cm_libarchive.h\"", public ] },
-  { include: [ "<archive_entry.h>", private, "\"cm_libarchive.h\"", public ] },
-  { include: [ "@<curl/.+\\.h>", private, "\"cm_curl.h\"", public ] },
-  { include: [ "<expat.h>", private, "\"cm_expat.h\"", public ] },
-  { include: [ "<expat_external.h>", private, "\"cm_expat.h\"", public ] },
-  { include: [ "<json/reader.h>", private, "\"cm_jsoncpp_reader.h\"", public ] },
-  { include: [ "<json/value.h>", private, "\"cm_jsoncpp_value.h\"", public ] },
-  { include: [ "<json/writer.h>", private, "\"cm_jsoncpp_writer.h\"", public ] },
-  { include: [ "<rhash.h>", private, "\"cm_rhash.h\"", public ] },
-  { include: [ "<uv.h>", private, "\"cm_uv.h\"", public ] },
-  { include: [ "@<uv[/-].+\\.h>", private, "\"cm_uv.h\"", public ] },
-  { include: [ "<kwiml/abi.h>", private, "\"cm_kwiml.h\"", public ] },
-  { include: [ "<kwiml/int.h>", private, "\"cm_kwiml.h\"", public ] },
-  { include: [ "<zconf.h>", private, "\"cm_zlib.h\"", public ] },
-  { include: [ "<zlib.h>", private, "\"cm_zlib.h\"", public ] },
-
-  # Wrappers for bundled 3rd-party libraries.
-  { include: [ "\"cmlibarchive/libarchive/archive.h\"", private, "\"cm_libarchive.h\"", public ] },
-  { include: [ "\"cmlibarchive/libarchive/archive_entry.h\"", private, "\"cm_libarchive.h\"", public ] },
-  { include: [ "@\"cmcurl/include/curl/.+\\.h\"", private, "\"cm_curl.h\"", public ] },
-  { include: [ "\"cmexpat/lib/expat.h\"", private, "\"cm_expat.h\"", public ] },
-  { include: [ "\"cmexpat/lib/expat_external.h\"", private, "\"cm_expat.h\"", public ] },
-  { include: [ "\"cmjsoncpp/include/json/reader.h\"", private, "\"cm_jsoncpp_reader.h\"", public ] },
-  { include: [ "\"cmjsoncpp/include/json/value.h\"", private, "\"cm_jsoncpp_value.h\"", public ] },
-  { include: [ "\"cmjsoncpp/include/json/writer.h\"", private, "\"cm_jsoncpp_writer.h\"", public ] },
-  { include: [ "\"cmlibrhash/librhash/rhash.h\"", private, "\"cm_rhash.h\"", public ] },
-  { include: [ "\"cmlibuv/include/uv.h\"", private, "\"cm_uv.h\"", public ] },
-  { include: [ "@\"cmlibuv/include/uv/.+\\.h\"", private, "\"cm_uv.h\"", public ] },
-  { include: [ "\"KWIML/include/kwiml/abi.h\"", private, "\"cm_kwiml.h\"", public ] },
-  { include: [ "\"KWIML/include/kwiml/int.h\"", private, "\"cm_kwiml.h\"", public ] },
-  { include: [ "\"cmzlib/cm_zlib_mangle.h\"", private, "\"cm_zlib.h\"", public ] },
-  { include: [ "\"cmzlib/zconf.h\"", private, "\"cm_zlib.h\"", public ] },
-  { include: [ "\"cmzlib/zlib.h\"", private, "\"cm_zlib.h\"", public ] },
-
-  # System symbols used by libuv
-  { symbol: [ "SIGHUP", private, "\"cm_uv.h\"", public ] },
-  { symbol: [ "SIGINT", private, "\"cm_uv.h\"", public ] },
-  { symbol: [ "ssize_t", private, "\"cm_uv.h\"", public ] },
-
-  { symbol: [ "Json::ArrayIndex", private, "\"cm_jsoncpp_value.h\"", public ] },
+  # Wrappers for 3rd-party libraries
+  { include: [ "@<.*curl/curlver.h>", private, "<cm3p/curl/curl.h>", public ] },
+  { include: [ "@<.*json/forwards.h>", private, "<cm3p/json/value.h>", public ] },
+  { include: [ "@<.*uv/.+\\.h>", private, "<cm3p/uv.h>", public ] },
+  { include: [ "@<.*expat_external.h>", private, "<cm3p/expat.h>", public ] },
+  { include: [ "@<.*zconf.h>", private, "<cm3p/zlib.h>", public ] },
+  { include: [ "@<.*cm_zlib_mangle.h>", private, "<cm3p/zlib.h>", public ] },
+  # # System symbols used by libuv
+  { symbol: [ "ssize_t", private, "<cm3p/uv.h>", public ] },
 
   { symbol: [ "std::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
   { symbol: [ "std::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
@@ -156,8 +117,6 @@
   { include: [ "<fstream>", public, "\"cmsys/FStream.hxx\"", public ] },
 
   # major and minor are used as macro arguments. Those are false matches.
-  { symbol: [ "major", private, "\"cm_kwiml.h\"", public ] },
-  { symbol: [ "minor", private, "\"cm_kwiml.h\"", public ] },
   { symbol: [ "major", private, "\"cmVersion.h\"", public ] },
   { symbol: [ "minor", private, "\"cmVersion.h\"", public ] },
 

+ 8 - 0
Utilities/cm3p/Setup.Configuration.h

@@ -0,0 +1,8 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cm3p_Setup_Configuration_h
+#define cm3p_Setup_Configuration_h
+
+#include <cmvssetup/Setup.Configuration.h> // IWYU pragma: export
+
+#endif

+ 4 - 6
Utilities/cm_libarchive.h → Utilities/cm3p/archive.h

@@ -1,16 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_libarchive_h
-#define cm_libarchive_h
+#ifndef cm3p_archive_h
+#define cm3p_archive_h
 
 /* Use the libarchive configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_LIBARCHIVE
-#  include <archive.h>
-#  include <archive_entry.h>
+#  include <archive.h> // IWYU pragma: export
 #else
-#  include <cmlibarchive/libarchive/archive.h>
-#  include <cmlibarchive/libarchive/archive_entry.h>
+#  include <cmlibarchive/libarchive/archive.h> // IWYU pragma: export
 #endif
 
 #endif

+ 14 - 0
Utilities/cm3p/archive_entry.h

@@ -0,0 +1,14 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cm3p_archive_entry_h
+#define cm3p_archive_entry_h
+
+/* Use the libarchive configured for CMake.  */
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_LIBARCHIVE
+#  include <archive_entry.h> // IWYU pragma: export
+#else
+#  include <cmlibarchive/libarchive/archive_entry.h> // IWYU pragma: export
+#endif
+
+#endif

+ 4 - 4
Utilities/cm_bzlib.h → Utilities/cm3p/bzlib.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_bzlib_h
-#define cm_bzlib_h
+#ifndef cm3p_bzlib_h
+#define cm3p_bzlib_h
 
 /* Use the bzip2 library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_BZIP2
-#  include <bzlib.h>
+#  include <bzlib.h> // IWYU pragma: export
 #else
-#  include <cmbzip2/bzlib.h>
+#  include <cmbzip2/bzlib.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_curl.h → Utilities/cm3p/curl/curl.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_curl_h
-#define cm_curl_h
+#ifndef cm3p_curl_curl_h
+#define cm3p_curl_curl_h
 
 /* Use the curl library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_CURL
-#  include <curl/curl.h>
+#  include <curl/curl.h> // IWYU pragma: export
 #else
-#  include <cmcurl/include/curl/curl.h>
+#  include <cmcurl/include/curl/curl.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_expat.h → Utilities/cm3p/expat.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_expat_h
-#define cm_expat_h
+#ifndef cm3p_expat_h
+#define cm3p_expat_h
 
 /* Use the expat library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_EXPAT
-#  include <expat.h>
+#  include <expat.h> // IWYU pragma: export
 #else
-#  include <cmexpat/lib/expat.h>
+#  include <cmexpat/lib/expat.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_jsoncpp_writer.h → Utilities/cm3p/json/reader.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_jsoncpp_writer_h
-#define cm_jsoncpp_writer_h
+#ifndef cm3p_json_reader_h
+#define cm3p_json_reader_h
 
 /* Use the jsoncpp library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_JSONCPP
-#  include <json/writer.h>
+#  include <json/reader.h> // IWYU pragma: export
 #else
-#  include <cmjsoncpp/include/json/writer.h>
+#  include <cmjsoncpp/include/json/reader.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_jsoncpp_value.h → Utilities/cm3p/json/value.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_jsoncpp_value_h
-#define cm_jsoncpp_value_h
+#ifndef cm3p_json_value_h
+#define cm3p_json_value_h
 
 /* Use the jsoncpp library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_JSONCPP
-#  include <json/value.h>
+#  include <json/value.h> // IWYU pragma: export
 #else
-#  include <cmjsoncpp/include/json/value.h>
+#  include <cmjsoncpp/include/json/value.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_jsoncpp_reader.h → Utilities/cm3p/json/writer.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_jsoncpp_reader_h
-#define cm_jsoncpp_reader_h
+#ifndef cm3p_json_writer_h
+#define cm3p_json_writer_h
 
 /* Use the jsoncpp library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_JSONCPP
-#  include <json/reader.h>
+#  include <json/writer.h> // IWYU pragma: export
 #else
-#  include <cmjsoncpp/include/json/reader.h>
+#  include <cmjsoncpp/include/json/writer.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 6
Utilities/cm_kwiml.h → Utilities/cm3p/kwiml/abi.h

@@ -1,16 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_kwiml_h
-#define cm_kwiml_h
+#ifndef cm3p_kwiml_abi_h
+#define cm3p_kwiml_abi_h
 
 /* Use the KWIML library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_KWIML
-#  include <kwiml/abi.h>
-#  include <kwiml/int.h>
+#  include <kwiml/abi.h> // IWYU pragma: export
 #else
-#  include "KWIML/include/kwiml/abi.h"
-#  include "KWIML/include/kwiml/int.h"
+#  include <KWIML/include/kwiml/abi.h> // IWYU pragma: export
 #endif
 
 #endif

+ 14 - 0
Utilities/cm3p/kwiml/int.h

@@ -0,0 +1,14 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cm3p_kwiml_int_h
+#define cm3p_kwiml_int_h
+
+/* Use the KWIML library configured for CMake.  */
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_KWIML
+#  include <kwiml/int.h> // IWYU pragma: export
+#else
+#  include <KWIML/include/kwiml/int.h> // IWYU pragma: export
+#endif
+
+#endif

+ 4 - 4
Utilities/cm_lzma.h → Utilities/cm3p/lzma.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_lzma_h
-#define cm_lzma_h
+#ifndef cm3p_lzma_h
+#define cm3p_lzma_h
 
 /* Use the liblzma configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_LIBLZMA
-#  include <lzma.h>
+#  include <lzma.h> // IWYU pragma: export
 #else
-#  include <cmliblzma/liblzma/api/lzma.h>
+#  include <cmliblzma/liblzma/api/lzma.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_rhash.h → Utilities/cm3p/rhash.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_rhash_h
-#define cm_rhash_h
+#ifndef cm3p_rhash_h
+#define cm3p_rhash_h
 
 /* Use the LibRHash library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_LIBRHASH
-#  include <rhash.h>
+#  include <rhash.h> // IWYU pragma: export
 #else
-#  include <cmlibrhash/librhash/rhash.h>
+#  include <cmlibrhash/librhash/rhash.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_uv.h → Utilities/cm3p/uv.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_uv_h
-#define cm_uv_h
+#ifndef cm3p_uv_h
+#define cm3p_uv_h
 
 /* Use the libuv library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_LIBUV
-#  include <uv.h>
+#  include <uv.h> // IWYU pragma: export
 #else
-#  include <cmlibuv/include/uv.h>
+#  include <cmlibuv/include/uv.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_zlib.h → Utilities/cm3p/zlib.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_zlib_h
-#define cm_zlib_h
+#ifndef cm3p_zlib_h
+#define cm3p_zlib_h
 
 /* Use the zlib library configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_ZLIB
-#  include <zlib.h>
+#  include <zlib.h> // IWYU pragma: export
 #else
-#  include <cmzlib/zlib.h>
+#  include <cmzlib/zlib.h> // IWYU pragma: export
 #endif
 
 #endif

+ 4 - 4
Utilities/cm_zstd.h → Utilities/cm3p/zstd.h

@@ -1,14 +1,14 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cm_zstd_h
-#define cm_zstd_h
+#ifndef cm3p_zstd_h
+#define cm3p_zstd_h
 
 /* Use the libzstd configured for CMake.  */
 #include "cmThirdParty.h"
 #ifdef CMAKE_USE_SYSTEM_ZSTD
-#  include <zstd.h>
+#  include <zstd.h> // IWYU pragma: export
 #else
-#  include <cmzstd/lib/zstd.h>
+#  include <cmzstd/lib/zstd.h> // IWYU pragma: export
 #endif
 
 #endif

+ 1 - 1
Utilities/cmexpat/lib/siphash.h

@@ -97,7 +97,7 @@
 
 #include <stddef.h> /* size_t */
 
-#include <cm_kwiml.h>
+#include <cm3p/kwiml/int.h>
 
 #ifndef KWIML_INT_HAVE_UINT64_T
 # define uint64_t KWIML_INT_uint64_t

+ 1 - 1
Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c

@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
 #include <unistd.h>
 #endif
 #ifdef HAVE_BZLIB_H
-#include <cm_bzlib.h>
+#include <cm3p/bzlib.h>
 #endif
 
 #include "archive.h"

Неке датотеке нису приказане због велике количине промена