diff --git a/.clang-format b/.clang-format
index 8c015ef3505fa852def0704794b4241534dfc635..cba23d6047a847b9236237ba2cb3d60f73e65f15 100644
--- a/.clang-format
+++ b/.clang-format
@@ -20,6 +20,8 @@ SortUsingDeclarations: false
 SpaceAfterTemplateKeyword: true
 IncludeBlocks: Regroup
 IncludeCategories:
+  - Regex:           '^[<"]cmSTL\.hxx'
+    Priority:        -2
   - Regex:           '^[<"]cmConfigure\.h'
     Priority:        -1
   - Regex:           '^<queue>'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f62c666bd16e239adba5cc3b2c1763ae417ee831..2d860d4a8b6a273ecfa8c3fb2b358dc2efc996e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,6 +108,11 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
   endif()
 endif()
 
+# Inform STL library header wrappers whether to use system versions.
+configure_file(${CMake_SOURCE_DIR}/Utilities/std/cmSTL.hxx.in
+  ${CMake_BINARY_DIR}/Utilities/cmSTL.hxx
+  @ONLY)
+
 # set the internal encoding of CMake to UTF-8
 set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
 
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 4de1c5d6f0b2c4b99e0ae78a3e5fd1cb4271f0a1..97e7856dd8fb344bda819e1c13ca0f2cd2cbb6fd 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -19,7 +19,6 @@
 #cmakedefine HAVE_UNSETENV
 #cmakedefine CMAKE_USE_ELF_PARSER
 #cmakedefine CMAKE_USE_MACH_PARSER
-#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
 #define CMake_DEFAULT_RECURSION_LIMIT @CMake_DEFAULT_RECURSION_LIMIT@
 #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
 #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
diff --git a/Utilities/std/cm/memory b/Utilities/std/cm/memory
index dd0f8226d1b49f5018fc50dac34295a581be355e..5611f6bb35167b9c4046037a3d40de5776a01b6d 100644
--- a/Utilities/std/cm/memory
+++ b/Utilities/std/cm/memory
@@ -6,7 +6,10 @@
 #ifndef cm_memory
 #define cm_memory
 
+#include "cmSTL.hxx" // IWYU pragma: keep
+
 #include <memory> // IWYU pragma: export
+
 #if !defined(CMake_HAVE_CXX_MAKE_UNIQUE)
 #  include <cstddef>
 #  include <type_traits>
diff --git a/Utilities/std/cmSTL.hxx.in b/Utilities/std/cmSTL.hxx.in
new file mode 100644
index 0000000000000000000000000000000000000000..28fe226aaa7aab94e924f393858541e4f3f53a9b
--- /dev/null
+++ b/Utilities/std/cmSTL.hxx.in
@@ -0,0 +1,9 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cmSTL_hxx
+#define cmSTL_hxx
+
+/* Whether CMake is using its own STL implementation.  */
+#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
+
+#endif
diff --git a/bootstrap b/bootstrap
index 68218d5b723490278a3d18923b8bbf09a3d65a4f..6b3716415616bf3cf9e4b53b8aa39702dc31cb8d 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1272,6 +1272,9 @@ for feature in ${cmake_cxx_features}; do
   fi
 done
 
+cmake_generate_file "${cmake_bootstrap_dir}/cmSTL.hxx" ""
+
+
 #-----------------------------------------------------------------------------
 # Test Make