summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-05-04 23:22:02 +0200
committerMarc Chevrier <marc.chevrier@gmail.com>2020-05-07 12:06:08 +0200
commit2faa3f6c55d2288316419f3efb8a483904a295f2 (patch)
tree8f4227f0e5299b5f6647e2e94cd7d52e55e643f5
parent75e87e3db402c80390fa05c6b36ffab27089a46b (diff)
downloadcmake-2faa3f6c55d2288316419f3efb8a483904a295f2.tar.gz
Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
-rw-r--r--.clang-format10
-rw-r--r--CMakeLists.txt11
-rw-r--r--Help/dev/source.rst15
-rw-r--r--Source/CPack/WiX/cmWIXPatchParser.cxx2
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx6
-rw-r--r--Source/CTest/cmCTestBZR.cxx4
-rw-r--r--Source/CTest/cmCTestCurl.h2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx8
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h3
-rw-r--r--Source/CTest/cmCTestResourceSpec.cxx6
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx6
-rw-r--r--Source/CTest/cmProcess.cxx2
-rw-r--r--Source/CTest/cmProcess.h3
-rw-r--r--Source/cmAffinity.cxx2
-rw-r--r--Source/cmAlgorithms.h2
-rw-r--r--Source/cmArchiveWrite.cxx4
-rw-r--r--Source/cmCTest.cxx6
-rw-r--r--Source/cmConnection.cxx11
-rw-r--r--Source/cmConnection.h2
-rw-r--r--Source/cmCryptoHash.cxx6
-rw-r--r--Source/cmCurl.h2
-rw-r--r--Source/cmELF.cxx6
-rw-r--r--Source/cmExprParserHelper.h2
-rw-r--r--Source/cmFileAPI.h6
-rw-r--r--Source/cmFileAPICMakeFiles.cxx2
-rw-r--r--Source/cmFileAPICMakeFiles.h2
-rw-r--r--Source/cmFileAPICache.cxx2
-rw-r--r--Source/cmFileAPICache.h2
-rw-r--r--Source/cmFileAPICodemodel.cxx2
-rw-r--r--Source/cmFileAPICodemodel.h2
-rw-r--r--Source/cmFileCommand.cxx5
-rw-r--r--Source/cmFileMonitor.h2
-rw-r--r--Source/cmFindPackageCommand.h2
-rw-r--r--Source/cmGeneratedFileStream.cxx3
-rw-r--r--Source/cmGetPipes.cxx3
-rw-r--r--Source/cmGlobalGenerator.cxx4
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx4
-rw-r--r--Source/cmJsonObjects.h2
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx3
-rw-r--r--Source/cmMakefile.cxx5
-rw-r--r--Source/cmMakefileProfilingData.cxx6
-rw-r--r--Source/cmMathCommand.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx4
-rw-r--r--Source/cmNinjaTargetGenerator.h2
-rw-r--r--Source/cmPipeConnection.h2
-rw-r--r--Source/cmQtAutoGenInitializer.cxx6
-rw-r--r--Source/cmQtAutoGenerator.cxx4
-rw-r--r--Source/cmQtAutoGenerator.h2
-rw-r--r--Source/cmQtAutoMocUic.cxx4
-rw-r--r--Source/cmServer.cxx7
-rw-r--r--Source/cmServer.h4
-rw-r--r--Source/cmServerConnection.cxx2
-rw-r--r--Source/cmServerProtocol.cxx2
-rw-r--r--Source/cmServerProtocol.h2
-rw-r--r--Source/cmStandardLexer.h2
-rw-r--r--Source/cmSystemTools.cxx5
-rw-r--r--Source/cmUVHandlePtr.cxx2
-rw-r--r--Source/cmUVHandlePtr.h2
-rw-r--r--Source/cmUVProcessChain.cxx2
-rw-r--r--Source/cmUVProcessChain.h2
-rw-r--r--Source/cmUVSignalHackRAII.h2
-rw-r--r--Source/cmUVStreambuf.h2
-rw-r--r--Source/cmVSSetupHelper.h3
-rw-r--r--Source/cmVersion.h2
-rw-r--r--Source/cmWorkerPool.cxx2
-rw-r--r--Source/cmXMLParser.cxx4
-rw-r--r--Source/cmake.cxx2
-rw-r--r--Source/cmake.h2
-rw-r--r--Source/cmakemain.cxx6
-rw-r--r--Source/cmcmd.cxx3
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx2
-rw-r--r--Tests/CMakeLib/testUVRAII.cxx2
-rw-r--r--Tests/CMakeLib/testUVStreambuf.cxx3
-rw-r--r--Tests/CPackWiXGenerator/myotherapp.cpp2
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.hbin58 -> 59 bytes
-rw-r--r--Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp2
-rw-r--r--Utilities/IWYU/mapping.imp59
-rw-r--r--Utilities/cm3p/Setup.Configuration.h8
-rw-r--r--Utilities/cm3p/archive.h (renamed from Utilities/cm_libarchive.h)10
-rw-r--r--Utilities/cm3p/archive_entry.h14
-rw-r--r--Utilities/cm3p/bzlib.h (renamed from Utilities/cm_bzlib.h)8
-rw-r--r--Utilities/cm3p/curl/curl.h (renamed from Utilities/cm_curl.h)8
-rw-r--r--Utilities/cm3p/expat.h (renamed from Utilities/cm_expat.h)8
-rw-r--r--Utilities/cm3p/json/reader.h (renamed from Utilities/cm_jsoncpp_writer.h)8
-rw-r--r--Utilities/cm3p/json/value.h (renamed from Utilities/cm_jsoncpp_value.h)8
-rw-r--r--Utilities/cm3p/json/writer.h (renamed from Utilities/cm_jsoncpp_reader.h)8
-rw-r--r--Utilities/cm3p/kwiml/abi.h (renamed from Utilities/cm_kwiml.h)10
-rw-r--r--Utilities/cm3p/kwiml/int.h14
-rw-r--r--Utilities/cm3p/lzma.h (renamed from Utilities/cm_lzma.h)8
-rw-r--r--Utilities/cm3p/rhash.h (renamed from Utilities/cm_rhash.h)8
-rw-r--r--Utilities/cm3p/uv.h (renamed from Utilities/cm_uv.h)8
-rw-r--r--Utilities/cm3p/zlib.h (renamed from Utilities/cm_zlib.h)8
-rw-r--r--Utilities/cm3p/zstd.h (renamed from Utilities/cm_zstd.h)8
-rw-r--r--Utilities/cmexpat/lib/siphash.h2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_gzip.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_lzop.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_xz.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_zstd.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_util.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_version_details.c8
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_gzip.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_xz.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_zstd.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c2
-rw-r--r--Utilities/cmlibrhash/librhash/byte_order.h2
-rw-r--r--Utilities/cmlibrhash/librhash/ustd.h2
-rw-r--r--Utilities/cmnghttp2/cmakeconfig.h.in3
-rw-r--r--Utilities/cmzlib/CMakeLists.txt5
-rw-r--r--Utilities/std/cm/bits/string_view.cxx2
-rw-r--r--Utilities/std/cm/shared_mutex2
128 files changed, 300 insertions, 284 deletions
diff --git a/.clang-format b/.clang-format
index 4bfce44621..8c015ef350 100644
--- a/.clang-format
+++ b/.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
...
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32a483db13..166b6648e7 100644
--- a/CMakeLists.txt
+++ b/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.
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 65a6adf7e8..0ccb8f42d9 100644
--- a/Help/dev/source.rst
+++ b/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.
diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx
index 5588d2daa4..8b26c4eec4 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.cxx
+++ b/Source/CPack/WiX/cmWIXPatchParser.cxx
@@ -6,7 +6,7 @@
#include <cm/memory>
-#include "cm_expat.h"
+#include <cm3p/expat.h>
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index aaa5318c90..967cc6060f 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/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"
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 142eb6fbfa..11e1aeccef 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/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"
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index c87fb83b31..c533cd7f90 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/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"
diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h
index 9c5ba667e5..b0d7f0757e 100644
--- a/Source/CTest/cmCTestCurl.h
+++ b/Source/CTest/cmCTestCurl.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include "cm_curl.h"
+#include <cm3p/curl/curl.h>
class cmCTest;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index b7251d90d8..a08cb34801 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/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"
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 6e999f917c..e21b912c7c 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/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"
diff --git a/Source/CTest/cmCTestResourceSpec.cxx b/Source/CTest/cmCTestResourceSpec.cxx
index 8f91efb454..21c97de34b 100644
--- a/Source/CTest/cmCTestResourceSpec.cxx
+++ b/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_]+$" };
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 811a7e87f2..2989025e49 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/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"
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 2742fd70c0..a549117ca2 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/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
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index 526c9200a2..1e6578cf93 100644
--- a/Source/CTest/cmProcess.h
+++ b/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"
diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx
index 8f9fe2ad89..35443e795b 100644
--- a/Source/cmAffinity.cxx
+++ b/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
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 8b0aa5ee3a..c8e8dcb850 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -15,8 +15,6 @@
#include <cmext/algorithm>
-#include "cm_kwiml.h"
-
#include "cmRange.h"
template <typename FwdIt>
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 0f9b42c7b2..78bb6e07aa 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/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"
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 2a0ddba144..9b023d9cef 100644
--- a/Source/cmCTest.cxx
+++ b/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
diff --git a/Source/cmConnection.cxx b/Source/cmConnection.cxx
index 884e314321..e4d0cf11bb 100644
--- a/Source/cmConnection.cxx
+++ b/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)
diff --git a/Source/cmConnection.h b/Source/cmConnection.h
index 7bb2494048..5335a7f3c9 100644
--- a/Source/cmConnection.h
+++ b/Source/cmConnection.h
@@ -9,7 +9,7 @@
#include <memory>
#include <string>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmUVHandlePtr.h"
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index dc7d939c94..b1e63ba65d 100644
--- a/Source/cmCryptoHash.cxx
+++ b/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 */
diff --git a/Source/cmCurl.h b/Source/cmCurl.h
index cb73ce6317..7bd036e5df 100644
--- a/Source/cmCurl.h
+++ b/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,
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 202b205042..a8d81f7c24 100644
--- a/Source/cmELF.cxx
+++ b/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>
diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h
index eaf5dc78a6..717acdcc0a 100644
--- a/Source/cmExprParserHelper.h
+++ b/Source/cmExprParserHelper.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include "cm_kwiml.h"
+#include <cm3p/kwiml/int.h>
class cmExprParserHelper
{
diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h
index e183e0d974..ae076129aa 100644
--- a/Source/cmFileAPI.h
+++ b/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;
diff --git a/Source/cmFileAPICMakeFiles.cxx b/Source/cmFileAPICMakeFiles.cxx
index 44ba96c253..1e4f3b62bd 100644
--- a/Source/cmFileAPICMakeFiles.cxx
+++ b/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"
diff --git a/Source/cmFileAPICMakeFiles.h b/Source/cmFileAPICMakeFiles.h
index a851c32f46..1ae1e4f1ab 100644
--- a/Source/cmFileAPICMakeFiles.h
+++ b/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;
diff --git a/Source/cmFileAPICache.cxx b/Source/cmFileAPICache.cxx
index 5d2ddf910e..25e5916386 100644
--- a/Source/cmFileAPICache.cxx
+++ b/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"
diff --git a/Source/cmFileAPICache.h b/Source/cmFileAPICache.h
index 09d9e1ce98..2f30c76d5d 100644
--- a/Source/cmFileAPICache.h
+++ b/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;
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index f34d7d50db..b983b21271 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/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"
diff --git a/Source/cmFileAPICodemodel.h b/Source/cmFileAPICodemodel.h
index ffbd928639..a6c6bddae5 100644
--- a/Source/cmFileAPICodemodel.h
+++ b/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;
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 161bbe8a82..f3d49c36a6 100644
--- a/Source/cmFileCommand.cxx
+++ b/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"
diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h
index b510a2cd24..fc75b0ceed 100644
--- a/Source/cmFileMonitor.h
+++ b/Source/cmFileMonitor.h
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
class cmRootWatcher;
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index ae9ade73e9..7058a54eab 100644
--- a/Source/cmFindPackageCommand.h
+++ b/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"
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index f76e205f15..9cee0e6e96 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/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)
diff --git a/Source/cmGetPipes.cxx b/Source/cmGetPipes.cxx
index 4eda1c54a7..a5b64692ed 100644
--- a/Source/cmGetPipes.cxx
+++ b/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>
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index de6a649461..6370ed2b23 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/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"
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index a76ab3c56a..dcd5a66c15 100644
--- a/Source/cmGlobalGenerator.h
+++ b/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
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 8ef19cc051..843b0f44d7 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/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"
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 5166de69d0..5dac072c2f 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/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"
diff --git a/Source/cmJsonObjects.h b/Source/cmJsonObjects.h
index 64291cc066..2fd4b26f32 100644
--- a/Source/cmJsonObjects.h
+++ b/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;
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 149230406b..9beae610ce 100644
--- a/Source/cmLocalGenerator.h
+++ b/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"
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 02e2c6d161..9076e26d12 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -4,7 +4,7 @@
#include <cmext/algorithm>
-#include "cm_expat.h"
+#include <cm3p/expat.h>
#include "cmAlgorithms.h"
#include "cmGeneratorTarget.h"
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index e18fac3b0d..0b027248bf 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/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"
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6c46353b7c..58883b5edb 100644
--- a/Source/cmMakefile.cxx
+++ b/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"
diff --git a/Source/cmMakefileProfilingData.cxx b/Source/cmMakefileProfilingData.cxx
index adf4eeea61..e0150dc1bf 100644
--- a/Source/cmMakefileProfilingData.cxx
+++ b/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"
diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx
index f11b906d46..56221bf5b1 100644
--- a/Source/cmMathCommand.cxx
+++ b/Source/cmMathCommand.cxx
@@ -4,7 +4,7 @@
#include <cstdio>
-#include "cm_kwiml.h"
+#include <cm3p/kwiml/int.h>
#include "cmExecutionStatus.h"
#include "cmExprParserHelper.h"
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 06064844cc..efd2fd5f8f 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/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"
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 8678dc3f66..1ac5683a70 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/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"
diff --git a/Source/cmPipeConnection.h b/Source/cmPipeConnection.h
index 81f8a49f67..1215716030 100644
--- a/Source/cmPipeConnection.h
+++ b/Source/cmPipeConnection.h
@@ -6,7 +6,7 @@
#include <string>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmConnection.h"
#include "cmUVHandlePtr.h"
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 235ee381fb..003a300321 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/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"
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index da963052fb..ee2bc09375 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/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"
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index bbe6dd0159..83fb3ed883 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/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"
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 36dd627abf..9adcabb804 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/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"
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index 434fb68371..7f9740626f 100644
--- a/Source/cmServer.cxx
+++ b/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"
diff --git a/Source/cmServer.h b/Source/cmServer.h
index ec40738753..9543329087 100644
--- a/Source/cmServer.h
+++ b/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"
diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx
index 279197214a..b4f41a09ee 100644
--- a/Source/cmServerConnection.cxx
+++ b/Source/cmServerConnection.cxx
@@ -4,7 +4,7 @@
#include "cmServerConnection.h"
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmServer.h"
#include "cmServerDictionary.h"
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index f6154eb934..6b32de3305 100644
--- a/Source/cmServerProtocol.cxx
+++ b/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"
diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h
index 8446c3e76a..c71b7bf606 100644
--- a/Source/cmServerProtocol.h
+++ b/Source/cmServerProtocol.h
@@ -8,7 +8,7 @@
#include <string>
#include <utility>
-#include "cm_jsoncpp_value.h"
+#include <cm3p/json/value.h>
#include "cmake.h"
diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h
index 55d23c1f18..cc67ac20e6 100644
--- a/Source/cmStandardLexer.h
+++ b/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;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 23b099acf3..be799b0402 100644
--- a/Source/cmSystemTools.cxx
+++ b/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"
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index 23dabb770b..df2f64ec5e 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -7,7 +7,7 @@
#include <cstdlib>
#include <mutex>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
namespace cm {
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h
index 3083b60c89..d9de7f3daf 100644
--- a/Source/cmUVHandlePtr.h
+++ b/Source/cmUVHandlePtr.h
@@ -8,7 +8,7 @@
#include <memory>
#include <type_traits>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#if defined(__SUNPRO_CC)
diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx
index 543c3308a1..6040fd816f 100644
--- a/Source/cmUVProcessChain.cxx
+++ b/Source/cmUVProcessChain.cxx
@@ -9,7 +9,7 @@
#include <cm/memory>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmGetPipes.h"
#include "cmUVHandlePtr.h"
diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h
index cd7397ef61..b5ccb19f13 100644
--- a/Source/cmUVProcessChain.h
+++ b/Source/cmUVProcessChain.h
@@ -11,7 +11,7 @@
#include <string>
#include <vector>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
class cmUVProcessChain;
diff --git a/Source/cmUVSignalHackRAII.h b/Source/cmUVSignalHackRAII.h
index 63599db826..60e4ca84ec 100644
--- a/Source/cmUVSignalHackRAII.h
+++ b/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
diff --git a/Source/cmUVStreambuf.h b/Source/cmUVStreambuf.h
index 1c8a7717cd..50faede835 100644
--- a/Source/cmUVStreambuf.h
+++ b/Source/cmUVStreambuf.h
@@ -8,7 +8,7 @@
#include <streambuf>
#include <vector>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmUVHandlePtr.h"
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index 0980cef53a..a2fd3d5548 100644
--- a/Source/cmVSSetupHelper.h
+++ b/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
{
diff --git a/Source/cmVersion.h b/Source/cmVersion.h
index bfd994d099..932ef0467c 100644
--- a/Source/cmVersion.h
+++ b/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.
diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx
index aa0d6b3d5b..9fec936310 100644
--- a/Source/cmWorkerPool.cxx
+++ b/Source/cmWorkerPool.cxx
@@ -13,7 +13,7 @@
#include <cm/memory>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmRange.h"
#include "cmStringAlgorithms.h"
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
index ad5c4ba284..24da8c60e5 100644
--- a/Source/cmXMLParser.cxx
+++ b/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()
{
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 057d54d4ff..cd9ba2cdd4 100644
--- a/Source/cmake.cxx
+++ b/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"
diff --git a/Source/cmake.h b/Source/cmake.h
index cfcd264885..cd152cb17a 100644
--- a/Source/cmake.h
+++ b/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;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 28281164d0..b12990b509 100644
--- a/Source/cmakemain.cxx
+++ b/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
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index a8e07e4ce8..de76d734ee 100644
--- a/Source/cmcmd.cxx
+++ b/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"
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index 71a17647e3..61a77cf7b4 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/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"
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index cb05ace157..0607f449fa 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -3,7 +3,7 @@
#include <thread>
#include <utility>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmUVHandlePtr.h"
diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx
index cd9c9d4faf..b86ed76ea1 100644
--- a/Tests/CMakeLib/testUVStreambuf.cxx
+++ b/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"
diff --git a/Tests/CPackWiXGenerator/myotherapp.cpp b/Tests/CPackWiXGenerator/myotherapp.cpp
index 0eefc1c8c7..5047a34e39 100644
--- a/Tests/CPackWiXGenerator/myotherapp.cpp
+++ b/Tests/CPackWiXGenerator/myotherapp.cpp
@@ -1,3 +1,3 @@
int main()
{
-} \ No newline at end of file
+}
diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h b/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
index bf56ec694c..2d39178954 100644
--- a/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
+++ b/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
Binary files differ
diff --git a/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp
index 154e268c70..0c37370c04 100644
--- a/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp
+++ b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp
@@ -1 +1 @@
-#include "MyForm.h" \ No newline at end of file
+#include "MyForm.h"
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index 87e8badf3b..66cb28263a 100644
--- a/Utilities/IWYU/mapping.imp
+++ b/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 ] },
diff --git a/Utilities/cm3p/Setup.Configuration.h b/Utilities/cm3p/Setup.Configuration.h
new file mode 100644
index 0000000000..a5cf0580aa
--- /dev/null
+++ b/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
diff --git a/Utilities/cm_libarchive.h b/Utilities/cm3p/archive.h
index ea8e9db628..956b3ab708 100644
--- a/Utilities/cm_libarchive.h
+++ b/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
diff --git a/Utilities/cm3p/archive_entry.h b/Utilities/cm3p/archive_entry.h
new file mode 100644
index 0000000000..230e87a0f1
--- /dev/null
+++ b/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
diff --git a/Utilities/cm_bzlib.h b/Utilities/cm3p/bzlib.h
index 8669e9e6ea..2a0f4dd625 100644
--- a/Utilities/cm_bzlib.h
+++ b/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
diff --git a/Utilities/cm_curl.h b/Utilities/cm3p/curl/curl.h
index 673f8ad957..6e2b8229dc 100644
--- a/Utilities/cm_curl.h
+++ b/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
diff --git a/Utilities/cm_expat.h b/Utilities/cm3p/expat.h
index fc5b39aba9..32e6fd0fe9 100644
--- a/Utilities/cm_expat.h
+++ b/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
diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm3p/json/reader.h
index d9e5d82170..0df09eea16 100644
--- a/Utilities/cm_jsoncpp_writer.h
+++ b/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
diff --git a/Utilities/cm_jsoncpp_value.h b/Utilities/cm3p/json/value.h
index 742d99a014..f59bed6d69 100644
--- a/Utilities/cm_jsoncpp_value.h
+++ b/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
diff --git a/Utilities/cm_jsoncpp_reader.h b/Utilities/cm3p/json/writer.h
index 23af65c619..7fcc3e242c 100644
--- a/Utilities/cm_jsoncpp_reader.h
+++ b/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
diff --git a/Utilities/cm_kwiml.h b/Utilities/cm3p/kwiml/abi.h
index 566f67e43d..6d0dedf565 100644
--- a/Utilities/cm_kwiml.h
+++ b/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
diff --git a/Utilities/cm3p/kwiml/int.h b/Utilities/cm3p/kwiml/int.h
new file mode 100644
index 0000000000..4c7c23df13
--- /dev/null
+++ b/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
diff --git a/Utilities/cm_lzma.h b/Utilities/cm3p/lzma.h
index 0526036c6f..abfacf361f 100644
--- a/Utilities/cm_lzma.h
+++ b/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
diff --git a/Utilities/cm_rhash.h b/Utilities/cm3p/rhash.h
index 03d9871f77..9d5e411048 100644
--- a/Utilities/cm_rhash.h
+++ b/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
diff --git a/Utilities/cm_uv.h b/Utilities/cm3p/uv.h
index 448f30d8df..307a09fdb7 100644
--- a/Utilities/cm_uv.h
+++ b/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
diff --git a/Utilities/cm_zlib.h b/Utilities/cm3p/zlib.h
index 2314183b1e..fe7baeebed 100644
--- a/Utilities/cm_zlib.h
+++ b/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
diff --git a/Utilities/cm_zstd.h b/Utilities/cm3p/zstd.h
index 4bda996aa3..07cc3e4359 100644
--- a/Utilities/cm_zstd.h
+++ b/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
diff --git a/Utilities/cmexpat/lib/siphash.h b/Utilities/cmexpat/lib/siphash.h
index 95f78f8321..a335ec06eb 100644
--- a/Utilities/cmexpat/lib/siphash.h
+++ b/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
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c
index 2b1a5e2aa7..5333d47000 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c
+++ b/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"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_gzip.c b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_gzip.c
index 95cfd54416..ac0b694759 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_gzip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_gzip.c
@@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_lzop.c b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_lzop.c
index 4356b82fdf..05f740ba3e 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_lzop.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_lzop.c
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
#include <lzo/lzo1x.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h> /* for crc32 and adler32 */
+#include <cm3p/zlib.h> /* for crc32 and adler32 */
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_xz.c b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_xz.c
index a18818638d..3223b38e56 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_xz.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_xz.c
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#endif
#if HAVE_LZMA_H
-#include <cm_lzma.h>
+#include <cm3p/lzma.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_zstd.c b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_zstd.c
index 451370693d..e1ec60e4e1 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_zstd.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_zstd.c
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#endif
#if HAVE_ZSTD_H
-#include <cm_zstd.h>
+#include <cm3p/zstd.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c
index c9f352722a..456b2f8cdc 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c
@@ -33,13 +33,13 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <cm_bzlib.h>
+#include <cm3p/bzlib.h>
#endif
#ifdef HAVE_LZMA_H
-#include <cm_lzma.h>
+#include <cm3p/lzma.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c
index c789d131fa..58644baf2d 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c
@@ -38,7 +38,7 @@
#include <string.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
index cf1419a017..912116675f 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_iso9660.c 20
#endif
#include <time.h>
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c
index 1261191805..61f233085a 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c
@@ -32,7 +32,7 @@
#include <time.h>
#include <limits.h>
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h> /* crc32 */
+#include <cm3p/zlib.h> /* crc32 */
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c
index ec40ccee29..d3a1c1b2cc 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c
@@ -31,7 +31,7 @@
#endif
#include <time.h>
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h> /* crc32 */
+#include <cm3p/zlib.h> /* crc32 */
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c
index 2bc5c7b92a..9489e51060 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c
@@ -39,13 +39,13 @@ __FBSDID("$FreeBSD$");
#include <expat.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <cm_bzlib.h>
+#include <cm3p/bzlib.h>
#endif
#if HAVE_LZMA_H
-#include <cm_lzma.h>
+#include <cm3p/lzma.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
index 36831f734d..4d71f985a2 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_zip.c 201102
#include <stdlib.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#ifdef HAVE_BZLIB_H
#include <bzlib.h>
diff --git a/Utilities/cmlibarchive/libarchive/archive_util.c b/Utilities/cmlibarchive/libarchive/archive_util.c
index e4cb051afd..10dca73c65 100644
--- a/Utilities/cmlibarchive/libarchive/archive_util.c
+++ b/Utilities/cmlibarchive/libarchive/archive_util.c
@@ -46,13 +46,13 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:1
#include <wincrypt.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#ifdef HAVE_LZMA_H
-#include <cm_lzma.h>
+#include <cm3p/lzma.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <cm_bzlib.h>
+#include <cm3p/bzlib.h>
#endif
#ifdef HAVE_LZ4_H
#include <lz4.h>
diff --git a/Utilities/cmlibarchive/libarchive/archive_version_details.c b/Utilities/cmlibarchive/libarchive/archive_version_details.c
index b9af6d781a..5f5a5b743c 100644
--- a/Utilities/cmlibarchive/libarchive/archive_version_details.c
+++ b/Utilities/cmlibarchive/libarchive/archive_version_details.c
@@ -34,19 +34,19 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:1
#include <string.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#ifdef HAVE_LZMA_H
-#include <cm_lzma.h>
+#include <cm3p/lzma.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <cm_bzlib.h>
+#include <cm3p/bzlib.h>
#endif
#ifdef HAVE_LZ4_H
#include <lz4.h>
#endif
#ifdef HAVE_ZSTD_H
-#include <cm_zstd.h>
+#include <cm3p/zstd.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c
index 535ef17c3b..0637e96143 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_bzip2.c 20
#include <string.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <cm_bzlib.h>
+#include <cm3p/bzlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_gzip.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_gzip.c
index 8d6838bc41..3e26605ec1 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_gzip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_gzip.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_gzip.c 201
#endif
#include <time.h>
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_xz.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_xz.c
index 2ad4bcb2fb..d567ac9957 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_xz.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_xz.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_xz.c 20110
#endif
#include <time.h>
#ifdef HAVE_LZMA_H
-#include <cm_lzma.h>
+#include <cm3p/lzma.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_zstd.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_zstd.c
index d0d78a0eef..f67b0256df 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_zstd.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_zstd.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#endif
#ifdef HAVE_ZSTD_H
-#include <cm_zstd.h>
+#include <cm3p/zstd.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
index 1f7e673e27..c4be9b0b25 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
@@ -131,7 +131,7 @@ __FBSDID("$FreeBSD$");
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
/* TODO: Support Mac OS 'quarantine' feature. This is really just a
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c
index ce96f2ff1e..69af814f78 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c
@@ -31,13 +31,13 @@ __FBSDID("$FreeBSD$");
#endif
#include <stdlib.h>
#ifdef HAVE_BZLIB_H
-#include <cm_bzlib.h>
+#include <cm3p/bzlib.h>
#endif
#if HAVE_LZMA_H
-#include <cm_lzma.h>
+#include <cm3p/lzma.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
index 564d4d7e9e..5db414f401 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
@@ -47,7 +47,7 @@
#include <unistd.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c
index 358f61fc2c..3b0ffb38a1 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c
@@ -37,13 +37,13 @@ __FBSDID("$FreeBSD$");
#include <libxml/xmlwriter.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <cm_bzlib.h>
+#include <cm3p/bzlib.h>
#endif
#if HAVE_LZMA_H
-#include <cm_lzma.h>
+#include <cm3p/lzma.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c
index 1ede5ee97f..b0cd215b87 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_zip.c 201168 20
#include <string.h>
#endif
#ifdef HAVE_ZLIB_H
-#include <cm_zlib.h>
+#include <cm3p/zlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibrhash/librhash/byte_order.h b/Utilities/cmlibrhash/librhash/byte_order.h
index a58174bbfc..cfb9e25e35 100644
--- a/Utilities/cmlibrhash/librhash/byte_order.h
+++ b/Utilities/cmlibrhash/librhash/byte_order.h
@@ -39,7 +39,7 @@ extern "C" {
# endif
#endif
-#include <cm_kwiml.h>
+#include <cm3p/kwiml/abi.h>
#if KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_LITTLE
# define CPU_LITTLE_ENDIAN
# define IS_BIG_ENDIAN 0
diff --git a/Utilities/cmlibrhash/librhash/ustd.h b/Utilities/cmlibrhash/librhash/ustd.h
index 917fb6b96c..756ce0b8fe 100644
--- a/Utilities/cmlibrhash/librhash/ustd.h
+++ b/Utilities/cmlibrhash/librhash/ustd.h
@@ -9,7 +9,7 @@
# pragma warning(push,1)
#endif
-#include <cm_kwiml.h>
+#include <cm3p/kwiml/int.h>
#ifndef KWIML_INT_HAVE_INT64_T
# define int64_t KWIML_INT_int64_t
diff --git a/Utilities/cmnghttp2/cmakeconfig.h.in b/Utilities/cmnghttp2/cmakeconfig.h.in
index d6693ee578..60698fb99b 100644
--- a/Utilities/cmnghttp2/cmakeconfig.h.in
+++ b/Utilities/cmnghttp2/cmakeconfig.h.in
@@ -2,7 +2,8 @@
# pragma warning(push,1)
#endif
-#include <cm_kwiml.h>
+#include <cm3p/kwiml/abi.h>
+#include <cm3p/kwiml/int.h>
/* Define to `int' if <sys/types.h> does not define. */
#cmakedefine ssize_t @ssize_t@
diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt
index 888c3ff77c..0584c55605 100644
--- a/Utilities/cmzlib/CMakeLists.txt
+++ b/Utilities/cmzlib/CMakeLists.txt
@@ -38,11 +38,6 @@ CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/.NoDartCoverage
CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/zlibDllConfig.h.in
${CMZLIB_BINARY_DIR}/zlibDllConfig.h)
-FOREACH(name zlib zconf cm_zlib_mangle)
- CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/${name}.h
- ${CMZLIB_BINARY_DIR}/${name}.h COPYONLY)
-ENDFOREACH(name)
-
ADD_LIBRARY(cmzlib ${ZLIB_SRCS})
diff --git a/Utilities/std/cm/bits/string_view.cxx b/Utilities/std/cm/bits/string_view.cxx
index e345fd3ac1..5381fe618e 100644
--- a/Utilities/std/cm/bits/string_view.cxx
+++ b/Utilities/std/cm/bits/string_view.cxx
@@ -9,7 +9,7 @@
# include <ostream>
# include <stdexcept>
-# include "cm_kwiml.h"
+# include <cm3p/kwiml/int.h>
namespace cm {
diff --git a/Utilities/std/cm/shared_mutex b/Utilities/std/cm/shared_mutex
index 2ac9447dc7..ec63a7bc04 100644
--- a/Utilities/std/cm/shared_mutex
+++ b/Utilities/std/cm/shared_mutex
@@ -17,7 +17,7 @@
# include <shared_mutex> // IWYU pragma: export
#endif
#if !defined(CMake_HAVE_CXX_SHARED_MUTEX)
-# include "cm_uv.h"
+# include <cm3p/uv.h>
#endif
namespace cm {