Merge topic 'test-cmake-gui'

551937b4fb ci: Suppress hanging CMakeGUI test on macos-x86_64 jobs
2e5442eef5 Tests/CMakeGUI: Avoid QtTest internal timeout before ctest's timeout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11421
diff --git a/CMP0207-NEW-all-result.txt b/CMP0207-NEW-all-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/CMP0207-NEW-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/CMP0207-NEW-all-stderr.txt b/CMP0207-NEW-all-stderr.txt
new file mode 100644
index 0000000..4df8527
--- /dev/null
+++ b/CMP0207-NEW-all-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+  file Could not resolve runtime dependencies:
+
+    [^
+]*test\.dll$
diff --git a/Help/command/file.rst b/Help/command/file.rst
index ec21fae..5272590 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -1122,6 +1122,8 @@
 
   The following arguments specify filters for including or excluding libraries
   to be resolved. See below for a full description of how they work.
+  Directory separators in file paths may be matched using forward
+  slashes unless policy :policy:`CMP0207` is not set to ``NEW``.
 
     ``PRE_INCLUDE_REGEXES <regexes>...``
       List of pre-include regexes through which to filter the names of
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index a1a1cc5..90b5e82 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -98,6 +98,7 @@
 .. toctree::
    :maxdepth: 1
 
+   CMP0207: file(GET_RUNTIME_DEPENDENCIES) normalizes paths before matching. </policy/CMP0207>
    CMP0206: The CPack Archive Generator defaults to UID 0 and GID 0. </policy/CMP0206>
    CMP0205: file(CREATE_LINK) with COPY_ON_ERROR copies directory content. </policy/CMP0205>
 
diff --git a/Help/policy/CMP0207.rst b/Help/policy/CMP0207.rst
new file mode 100644
index 0000000..b544bd2
--- /dev/null
+++ b/Help/policy/CMP0207.rst
@@ -0,0 +1,26 @@
+CMP0207
+-------
+
+.. versionadded:: 4.3
+
+:command:`file(GET_RUNTIME_DEPENDENCIES)` normalizes paths before matching.
+
+The :command:`file(GET_RUNTIME_DEPENDENCIES)` and
+:command:`install(RUNTIME_DEPENDENCY_SET)` commands support filtering
+resolved dependencies using regular expressions matching their paths.
+In CMake 4.2 and below, callers were responsible for matching both forward
+and backward slashes as path separators on Windows, e.g., via ``[\/]``.
+CMake 4.3 and above prefer to normalize paths to use forward slashes before
+matching.  This policy provides compaitiblity for projects that may have
+been relying on matching backslashes only.
+
+The ``OLD`` behavior for this policy matches filters against paths that
+may contain any combination of forward and backward slashes on Windows.
+The ``NEW`` behavior for this policy to convert all paths to forward
+slashes before matching filters.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/release/dev/file-GET_RUNTIME_DEPENDENCIES-matching.rst b/Help/release/dev/file-GET_RUNTIME_DEPENDENCIES-matching.rst
new file mode 100644
index 0000000..9d89558
--- /dev/null
+++ b/Help/release/dev/file-GET_RUNTIME_DEPENDENCIES-matching.rst
@@ -0,0 +1,6 @@
+file-GET_RUNTIME_DEPENDENCIES-matching
+--------------------------------------
+
+* The :command:`file(GET_RUNTIME_DEPENDENCIES)`
+  and :command:`install(RUNTIME_DEPENDENCY_SET)` commands now normalize
+  paths before matching filters.  See policy :policy:`CMP0207`.
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 1c132ea..ecadfe9 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 4)
 set(CMake_VERSION_MINOR 2)
-set(CMake_VERSION_PATCH 20251114)
+set(CMake_VERSION_PATCH 20251115)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
diff --git a/Source/cmBinUtilsLinker.cxx b/Source/cmBinUtilsLinker.cxx
index 4cce608..ae43557 100644
--- a/Source/cmBinUtilsLinker.cxx
+++ b/Source/cmBinUtilsLinker.cxx
@@ -3,7 +3,14 @@
 
 #include "cmBinUtilsLinker.h"
 
+#include <utility>
+
+#include "cmCMakePath.h"
+#include "cmMakefile.h"
+#include "cmMessageType.h"
+#include "cmPolicies.h"
 #include "cmRuntimeDependencyArchive.h"
+#include "cmStringAlgorithms.h"
 
 cmBinUtilsLinker::cmBinUtilsLinker(cmRuntimeDependencyArchive* archive)
   : Archive(archive)
@@ -14,3 +21,27 @@
 {
   this->Archive->SetError(e);
 }
+
+void cmBinUtilsLinker::NormalizePath(std::string& path) const
+{
+  std::string normalizedPath =
+    cmCMakePath(path, cmCMakePath::auto_format).GenericString();
+
+  if (path == normalizedPath) {
+    return;
+  }
+
+  cmPolicies::PolicyStatus policy =
+    this->Archive->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0207);
+  if (policy == cmPolicies::WARN) {
+    this->Archive->GetMakefile()->IssueMessage(
+      MessageType::AUTHOR_WARNING,
+      cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0207), '\n',
+               "Path\n  \"", path,
+               "\"\n"
+               "would be converted to\n  \"",
+               normalizedPath, "\"\n"));
+  } else if (policy == cmPolicies::NEW) {
+    path = std::move(normalizedPath);
+  }
+}
diff --git a/Source/cmBinUtilsLinker.h b/Source/cmBinUtilsLinker.h
index 5b41309..f093860 100644
--- a/Source/cmBinUtilsLinker.h
+++ b/Source/cmBinUtilsLinker.h
@@ -24,4 +24,6 @@
   cmRuntimeDependencyArchive* Archive;
 
   void SetError(std::string const& e);
+
+  void NormalizePath(std::string& path) const;
 };
diff --git a/Source/cmBinUtilsLinuxELFLinker.cxx b/Source/cmBinUtilsLinuxELFLinker.cxx
index cf338a9..e3ea16c 100644
--- a/Source/cmBinUtilsLinuxELFLinker.cxx
+++ b/Source/cmBinUtilsLinuxELFLinker.cxx
@@ -204,6 +204,7 @@
     path = cmStrCat(searchPath, '/', name);
     if (cmSystemTools::PathExists(path) &&
         FileHasArchitecture(path.c_str(), this->Machine)) {
+      this->NormalizePath(path);
       resolved = true;
       return true;
     }
diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx
index 9867318..97dce1a 100644
--- a/Source/cmBinUtilsMacOSMachOLinker.cxx
+++ b/Source/cmBinUtilsMacOSMachOLinker.cxx
@@ -170,6 +170,7 @@
   } else {
     resolved = true;
     path = name;
+    this->NormalizePath(path);
   }
 
   if (resolved && !cmSystemTools::FileIsFullPath(path)) {
@@ -198,6 +199,7 @@
     return true;
   }
 
+  this->NormalizePath(path);
   resolved = true;
   return true;
 }
@@ -220,6 +222,7 @@
     return true;
   }
 
+  this->NormalizePath(path);
   resolved = true;
   return true;
 }
@@ -252,7 +255,7 @@
       /*
        * paraphrasing @ben.boeckel:
        *  if /b/libB.dylib is supposed to be used,
-       *  /a/libbB.dylib will be found first if it exists. CMake tries to
+       *  /a/libB.dylib will be found first if it exists. CMake tries to
        *  sort rpath directories to avoid this, but sometimes there is no
        *  right answer.
        *
@@ -268,7 +271,9 @@
        *  so as long as this method's resolution guarantees priority
        *  in that manner further checking should not be necessary?
        */
-      path = searchFile;
+      path = std::move(searchFile);
+
+      this->NormalizePath(path);
       resolved = true;
       return true;
     }
diff --git a/Source/cmBinUtilsWindowsPELinker.cxx b/Source/cmBinUtilsWindowsPELinker.cxx
index 70ddaf2..2864e30 100644
--- a/Source/cmBinUtilsWindowsPELinker.cxx
+++ b/Source/cmBinUtilsWindowsPELinker.cxx
@@ -155,6 +155,7 @@
   for (auto const& searchPath : dirs) {
     path = cmStrCat(searchPath, '/', name);
     if (cmSystemTools::PathExists(path)) {
+      this->NormalizePath(path);
       resolved = true;
       return true;
     }
diff --git a/Source/cmFastbuildNormalTargetGenerator.cxx b/Source/cmFastbuildNormalTargetGenerator.cxx
index 0ee97d7..efeabae 100644
--- a/Source/cmFastbuildNormalTargetGenerator.cxx
+++ b/Source/cmFastbuildNormalTargetGenerator.cxx
@@ -1499,11 +1499,13 @@
   objects.reserve(nodesPermutations.size());
   for (auto& val : nodesPermutations) {
     auto& node = val.second;
-    objects.emplace_back(std::move(node));
-    if (!objects.back().PCHInputFile.empty()) {
+    if (!node.PCHInputFile.empty()) {
       // Node that produces PCH should be the first one, since other nodes
       // might reuse this PCH.
-      std::swap(*objects.begin(), objects.back());
+      // Note: we might have several such nodes for different languages.
+      objects.insert(objects.begin(), std::move(node));
+    } else {
+      objects.emplace_back(std::move(node));
     }
   }
   if (useUnity) {
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 15267d0..47654b9 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -247,7 +247,8 @@
       cmInstallGenerator::SelectMessageLevel(helper.Makefile),
       runtimeDependenciesArgsRef.GetExcludeFromAll() &&
         (apple ? frameworkArgs.GetExcludeFromAll() : true),
-      helper.Makefile->GetBacktrace());
+      helper.Makefile->GetBacktrace(),
+      helper.Makefile->GetPolicyStatus(cmPolicies::CMP0207));
   helper.Makefile->AddInstallGenerator(
     std::move(getRuntimeDependenciesGenerator));
 
diff --git a/Source/cmInstallGetRuntimeDependenciesGenerator.cxx b/Source/cmInstallGetRuntimeDependenciesGenerator.cxx
index 0ba9f14..4292f8f 100644
--- a/Source/cmInstallGetRuntimeDependenciesGenerator.cxx
+++ b/Source/cmInstallGetRuntimeDependenciesGenerator.cxx
@@ -19,6 +19,7 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmOutputConverter.h"
+#include "cmPolicies.h"
 #include "cmScriptGenerator.h"
 #include "cmStringAlgorithms.h"
 
@@ -83,7 +84,8 @@
     std::vector<std::string> postExcludeFiles, std::string libraryComponent,
     std::string frameworkComponent, bool noInstallRPath, char const* depsVar,
     char const* rpathPrefix, std::vector<std::string> const& configurations,
-    MessageLevel message, bool exclude_from_all, cmListFileBacktrace backtrace)
+    MessageLevel message, bool exclude_from_all, cmListFileBacktrace backtrace,
+    cmPolicies::PolicyStatus policyStatusCMP0207)
   : cmInstallGenerator("", configurations, "", message, exclude_from_all,
                        false, std::move(backtrace))
   , RuntimeDependencySet(runtimeDependencySet)
@@ -96,6 +98,7 @@
   , PostExcludeFiles(std::move(postExcludeFiles))
   , LibraryComponent(std::move(libraryComponent))
   , FrameworkComponent(std::move(frameworkComponent))
+  , PolicyStatusCMP0207(policyStatusCMP0207)
   , NoInstallRPath(noInstallRPath)
   , DepsVar(depsVar)
   , RPathPrefix(rpathPrefix)
@@ -141,6 +144,14 @@
     this->LocalGenerator->GetMakefile()->GetSafeDefinition(
       "CMAKE_INSTALL_NAME_TOOL");
 
+  Indent inputIndent = indent;
+  if (this->PolicyStatusCMP0207 != cmPolicies::WARN) {
+    indent = indent.Next();
+    os << inputIndent << "block(SCOPE_FOR POLICIES)\n"
+       << indent << "cmake_policy(SET CMP0207 "
+       << (this->PolicyStatusCMP0207 == cmPolicies::NEW ? "NEW" : "OLD")
+       << ")\n";
+  }
   os << indent << "file(GET_RUNTIME_DEPENDENCIES\n"
      << indent << "  RESOLVED_DEPENDENCIES_VAR " << this->DepsVar << '\n';
   WriteFilesArgument(os, "EXECUTABLES"_s,
@@ -204,4 +215,8 @@
     os << indent << "  RPATH_PREFIX " << this->RPathPrefix << '\n';
   }
   os << indent << "  )\n";
+
+  if (this->PolicyStatusCMP0207 != cmPolicies::WARN) {
+    os << inputIndent << "endblock()\n";
+  }
 }
diff --git a/Source/cmInstallGetRuntimeDependenciesGenerator.h b/Source/cmInstallGetRuntimeDependenciesGenerator.h
index 11b6d87..9670dcf 100644
--- a/Source/cmInstallGetRuntimeDependenciesGenerator.h
+++ b/Source/cmInstallGetRuntimeDependenciesGenerator.h
@@ -7,6 +7,7 @@
 #include <vector>
 
 #include "cmInstallGenerator.h"
+#include "cmPolicies.h"
 
 class cmListFileBacktrace;
 class cmLocalGenerator;
@@ -26,8 +27,8 @@
     std::vector<std::string> postExcludeFiles, std::string libraryComponent,
     std::string frameworkComponent, bool noInstallRPath, char const* depsVar,
     char const* rpathPrefix, std::vector<std::string> const& configurations,
-    MessageLevel message, bool exclude_from_all,
-    cmListFileBacktrace backtrace);
+    MessageLevel message, bool exclude_from_all, cmListFileBacktrace backtrace,
+    cmPolicies::PolicyStatus policyStatusCMP0207);
 
   bool Compute(cmLocalGenerator* lg) override;
 
@@ -48,6 +49,7 @@
   std::vector<std::string> PostExcludeFiles;
   std::string LibraryComponent;
   std::string FrameworkComponent;
+  cmPolicies::PolicyStatus PolicyStatusCMP0207;
   bool NoInstallRPath;
   char const* DepsVar;
   char const* RPathPrefix;
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index bd4f1ab..b52a3c8 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -618,7 +618,10 @@
          3, 0, WARN)                                                          \
   SELECT(POLICY, CMP0206,                                                     \
          "The CPack Archive Generator defaults to UID 0 and GID 0.", 4, 3, 0, \
-         WARN)
+         WARN)                                                                \
+  SELECT(POLICY, CMP0207,                                                     \
+         "file(GET_RUNTIME_DEPENDENCIES) normalizes paths before matching.",  \
+         4, 3, 0, WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
 #define CM_FOR_EACH_POLICY_ID(POLICY)                                         \
diff --git a/Source/cmRuntimeDependencyArchive.cxx b/Source/cmRuntimeDependencyArchive.cxx
index 1ee80b4..998d306 100644
--- a/Source/cmRuntimeDependencyArchive.cxx
+++ b/Source/cmRuntimeDependencyArchive.cxx
@@ -367,7 +367,7 @@
       break;
     }
   }
-  it->second.insert(path);
+  it->second.emplace(path);
   this->RPaths[path] = std::move(rpaths);
 }
 
diff --git a/Source/cmVSSolution.cxx b/Source/cmVSSolution.cxx
index f85231d..eb750db 100644
--- a/Source/cmVSSolution.cxx
+++ b/Source/cmVSSolution.cxx
@@ -312,6 +312,9 @@
   cmXMLElement xmlProject(xmlParent, "Project");
   xmlProject.Attribute("Path", project.Path);
   xmlProject.Attribute("Id", cmSystemTools::LowerCase(project.Id));
+  if (project.Name == solution.StartupProject) {
+    xmlProject.Attribute("DefaultStartup", "true");
+  }
   for (Solution::Project const* d : project.BuildDependencies) {
     cmXMLElement(xmlProject, "BuildDependency").Attribute("Project", d->Path);
   }
diff --git a/Tests/ExportImport/Import/install-RUNTIME_DEPENDENCIES/CMakeLists.txt b/Tests/ExportImport/Import/install-RUNTIME_DEPENDENCIES/CMakeLists.txt
index d1c4ff2..4f6a953 100644
--- a/Tests/ExportImport/Import/install-RUNTIME_DEPENDENCIES/CMakeLists.txt
+++ b/Tests/ExportImport/Import/install-RUNTIME_DEPENDENCIES/CMakeLists.txt
@@ -1,4 +1,5 @@
 set(CMAKE_SKIP_RPATH OFF)
+cmake_policy(SET CMP0207 NEW)
 
 # Import targets from the install tree.
 include(${Import_BINARY_DIR}/../Root/install-RUNTIME_DEPENDENCY_SET/targets.cmake)
diff --git a/Tests/RunCMake/VSSolution/AddPackageToDefault-check-slnx.cmake b/Tests/RunCMake/VSSolution/AddPackageToDefault-check-slnx.cmake
index b60f278..320cab5 100644
--- a/Tests/RunCMake/VSSolution/AddPackageToDefault-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/AddPackageToDefault-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
   </Project>
   <Project Path="PACKAGE.vcxproj" Id="[0-9a-f-]+">
diff --git a/Tests/RunCMake/VSSolution/CMP0143-NEW-check-slnx.cmake b/Tests/RunCMake/VSSolution/CMP0143-NEW-check-slnx.cmake
index 67d10cb..009e372 100644
--- a/Tests/RunCMake/VSSolution/CMP0143-NEW-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/CMP0143-NEW-check-slnx.cmake
@@ -16,7 +16,7 @@
     <Build Solution="RelWithDebInfo\|\*" Project="false"/>
   </Project>
   <Folder Name="/CMakePredefinedTargets/">
-    <Project Path="ALL_BUILD.vcxproj" Id="[0-9a-f-]+">
+    <Project Path="ALL_BUILD.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
       <BuildDependency Project="ZERO_CHECK.vcxproj"/>
       <Build Solution="Debug\|\*" Project="false"/>
       <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/CMP0143-OLD-check-slnx.cmake b/Tests/RunCMake/VSSolution/CMP0143-OLD-check-slnx.cmake
index cfcb5d4..7de36ee 100644
--- a/Tests/RunCMake/VSSolution/CMP0143-OLD-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/CMP0143-OLD-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/CMP0143-WARN-check-slnx.cmake b/Tests/RunCMake/VSSolution/CMP0143-WARN-check-slnx.cmake
index 0c51664..863da1d 100644
--- a/Tests/RunCMake/VSSolution/CMP0143-WARN-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/CMP0143-WARN-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/DeployEnabled-check-slnx.cmake b/Tests/RunCMake/VSSolution/DeployEnabled-check-slnx.cmake
index 94b297d..82b9c76 100644
--- a/Tests/RunCMake/VSSolution/DeployEnabled-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/DeployEnabled-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <BuildDependency Project="foo\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/MorePost-check-slnx.cmake b/Tests/RunCMake/VSSolution/MorePost-check-slnx.cmake
index ef8173b..8cb982f 100644
--- a/Tests/RunCMake/VSSolution/MorePost-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/MorePost-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/MorePre-check-slnx.cmake b/Tests/RunCMake/VSSolution/MorePre-check-slnx.cmake
index d025b6c..65c82a5 100644
--- a/Tests/RunCMake/VSSolution/MorePre-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/MorePre-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/OnePost-check-slnx.cmake b/Tests/RunCMake/VSSolution/OnePost-check-slnx.cmake
index 4556be6..a76d41c 100644
--- a/Tests/RunCMake/VSSolution/OnePost-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/OnePost-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/OnePre-check-slnx.cmake b/Tests/RunCMake/VSSolution/OnePre-check-slnx.cmake
index e01b91a..e6a1f7b 100644
--- a/Tests/RunCMake/VSSolution/OnePre-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/OnePre-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/Override1-check-slnx.cmake b/Tests/RunCMake/VSSolution/Override1-check-slnx.cmake
index 6b53eea..a58bb01 100644
--- a/Tests/RunCMake/VSSolution/Override1-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/Override1-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/Override2-check-slnx.cmake b/Tests/RunCMake/VSSolution/Override2-check-slnx.cmake
index 8a80a0e..b3b73f8 100644
--- a/Tests/RunCMake/VSSolution/Override2-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/Override2-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/Override3-check-slnx.cmake b/Tests/RunCMake/VSSolution/Override3-check-slnx.cmake
index 93d6dc5..a756874 100644
--- a/Tests/RunCMake/VSSolution/Override3-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/Override3-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/PrePost-check-slnx.cmake b/Tests/RunCMake/VSSolution/PrePost-check-slnx.cmake
index 824add6..f3f10c6 100644
--- a/Tests/RunCMake/VSSolution/PrePost-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/PrePost-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/SolutionItems-check-slnx.cmake b/Tests/RunCMake/VSSolution/SolutionItems-check-slnx.cmake
index ee6f654..4021cbf 100644
--- a/Tests/RunCMake/VSSolution/SolutionItems-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/SolutionItems-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
@@ -38,7 +38,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="\.\./ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/StartupProject-check-slnx.cmake b/Tests/RunCMake/VSSolution/StartupProject-check-slnx.cmake
index efd6fcd..b8f9639 100644
--- a/Tests/RunCMake/VSSolution/StartupProject-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/StartupProject-check-slnx.cmake
@@ -15,7 +15,7 @@
     <Build Solution="MinSizeRel\|\*" Project="false"/>
     <Build Solution="RelWithDebInfo\|\*" Project="false"/>
   </Project>
-  <Project Path="TestStartup\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="TestStartup\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/StartupProjectMissing-check-slnx.cmake b/Tests/RunCMake/VSSolution/StartupProjectMissing-check-slnx.cmake
index f2de6f3..ce0f382 100644
--- a/Tests/RunCMake/VSSolution/StartupProjectMissing-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/StartupProjectMissing-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check-slnx.cmake b/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check-slnx.cmake
index dcebe09..c3aef00 100644
--- a/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check-slnx.cmake
+++ b/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="TestStartup\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="TestStartup\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK.vcxproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
     <Build Solution="Release\|\*" Project="false"/>
diff --git a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkTargetPlatform-check-slnx.cmake b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkTargetPlatform-check-slnx.cmake
index f1f7492..aa1c0f6 100644
--- a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkTargetPlatform-check-slnx.cmake
+++ b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkTargetPlatform-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <BuildDependency Project="foo\.csproj"/>
     <Build Solution="Debug\|\*" Project="false"/>
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW.cmake
new file mode 100644
index 0000000..53bb192
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW.cmake
@@ -0,0 +1,13 @@
+cmake_policy(SET CMP0207 NEW)
+
+include("${CMAKE_CURRENT_LIST_DIR}/CMP0207-common.cmake")
+
+install(CODE [[
+  if(results_old)
+    message(SEND_ERROR "Old dependencies are not empty: `${results_old}`")
+  endif()
+
+  if(NOT results_new)
+    message(SEND_ERROR "New dependencies are empty: `${results_new}`")
+  endif()
+  ]])
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-OLD.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-OLD.cmake
new file mode 100644
index 0000000..c7e497d
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-OLD.cmake
@@ -0,0 +1,13 @@
+cmake_policy(SET CMP0207 OLD)
+
+include("${CMAKE_CURRENT_LIST_DIR}/CMP0207-common.cmake")
+
+install(CODE [[
+  if(NOT results_old)
+    message(SEND_ERROR "Old dependencies are empty: `${results_old}`")
+  endif()
+
+  if(results_new)
+    message(SEND_ERROR "New dependencies are not empty: `${results_new}`")
+  endif()
+  ]])
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-WARN-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-WARN-all-stderr.txt
new file mode 100644
index 0000000..1d8f189
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-WARN-all-stderr.txt
@@ -0,0 +1,44 @@
+^CMake Warning \(dev\) at cmake_install\.cmake:[0-9]+ \(file\):
+  Policy CMP0207 is not set: file\(GET_RUNTIME_DEPENDENCIES\) normalizes paths
+  before matching\.  Run "cmake --help-policy CMP0207" for policy details\.
+  Use the cmake_policy command to set the policy and suppress this warning\.
+
+  Path
+
+    "[^"]*test\.dll"
+
+  would be converted to
+
+    "[^"]*test\.dll"
+
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+CMake Warning \(dev\) at cmake_install\.cmake:[0-9]+ \(file\):
+  Policy CMP0207 is not set: file\(GET_RUNTIME_DEPENDENCIES\) normalizes paths
+  before matching\.  Run "cmake --help-policy CMP0207" for policy details\.
+  Use the cmake_policy command to set the policy and suppress this warning\.
+
+  Path
+
+    "[^"]*test\.dll"
+
+  would be converted to
+
+    "[^"]*test\.dll"
+
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+CMake Warning \(dev\) at cmake_install\.cmake:[0-9]+ \(file\):
+  Policy CMP0207 is not set: file\(GET_RUNTIME_DEPENDENCIES\) normalizes paths
+  before matching\.  Run "cmake --help-policy CMP0207" for policy details\.
+  Use the cmake_policy command to set the policy and suppress this warning\.
+
+  Path
+
+    "[^"]*test\.dll"
+
+  would be converted to
+
+    "[^"]*test\.dll"
+
+This warning is for project developers\.  Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-WARN.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-WARN.cmake
new file mode 100644
index 0000000..a5a5cc0
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-WARN.cmake
@@ -0,0 +1,12 @@
+# CMP0207 is unset
+include("${CMAKE_CURRENT_LIST_DIR}/CMP0207-common.cmake")
+
+install(CODE [[
+  if(NOT results_old)
+    message(SEND_ERROR "Old dependencies are empty: `${results_old}`")
+  endif()
+
+  if(results_new)
+    message(SEND_ERROR "New dependencies are not empty: `${results_new}`")
+  endif()
+  ]])
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-common.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-common.cmake
new file mode 100644
index 0000000..4d916a5
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-common.cmake
@@ -0,0 +1,93 @@
+enable_language(C)
+
+file(WRITE "${CMAKE_BINARY_DIR}/test.c" "__declspec(dllexport) void test(void) {}\n")
+file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[__declspec(dllimport) extern void test(void);
+
+int main(void)
+{
+  test();
+  return 0;
+}
+]])
+
+add_subdirectory(CMP0207-subdir)
+
+add_executable(exe "${CMAKE_BINARY_DIR}/main.c")
+target_link_libraries(exe PRIVATE test)
+
+install(TARGETS test DESTINATION bin/lib1)
+
+install(
+  TARGETS exe
+  DESTINATION results_old
+  RUNTIME_DEPENDENCIES
+    DIRECTORIES "${CMAKE_BINARY_DIR}/root-all\\bin\\lib1"
+    PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$"
+    PRE_EXCLUDE_REGEXES ".*"
+    POST_INCLUDE_REGEXES "\\\\lib1/(lib)?test\\.dll$"
+    POST_EXCLUDE_REGEXES ".*"
+)
+
+install(
+  TARGETS exe
+  DESTINATION results_new
+  RUNTIME_DEPENDENCIES
+    DIRECTORIES "${CMAKE_BINARY_DIR}/root-all\\bin\\lib1"
+    PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$"
+    PRE_EXCLUDE_REGEXES ".*"
+    POST_INCLUDE_REGEXES "/lib1/(lib)?test\\.dll$"
+    POST_EXCLUDE_REGEXES ".*"
+)
+
+install(
+  TARGETS exe
+  DESTINATION results_any
+  RUNTIME_DEPENDENCIES
+    DIRECTORIES "${CMAKE_BINARY_DIR}/root-all\\bin\\lib1"
+    PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$"
+    PRE_EXCLUDE_REGEXES ".*"
+    POST_INCLUDE_REGEXES "(\\\\|/)lib1/(lib)?test\\.dll$"
+    POST_EXCLUDE_REGEXES ".*"
+)
+
+install(
+  TARGETS exe
+  DESTINATION results_any_forward
+  RUNTIME_DEPENDENCIES
+    DIRECTORIES "${CMAKE_BINARY_DIR}/root-all/bin/lib1"
+    PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$"
+    PRE_EXCLUDE_REGEXES ".*"
+    POST_INCLUDE_REGEXES "(\\\\|/)lib1/(lib)?test\\.dll$"
+    POST_EXCLUDE_REGEXES ".*"
+)
+
+install(
+  CODE [[
+    function(check_installed_lib directory out_var)
+      file(GLOB_RECURSE actual
+        LIST_DIRECTORIES FALSE
+        RELATIVE ${CMAKE_INSTALL_PREFIX}/${directory}
+        ${CMAKE_INSTALL_PREFIX}/${directory}/*.dll
+      )
+
+      if(actual)
+        list(SORT actual)
+      endif()
+
+      set(${out_var} "${actual}" PARENT_SCOPE)
+    endfunction()
+
+    check_installed_lib("results_old" results_old)
+    check_installed_lib("results_new" results_new)
+    check_installed_lib("results_any" results_any)
+    check_installed_lib("results_any_forward" results_any_forward)
+
+    if(NOT results_any)
+      message(SEND_ERROR "Any dependencies are empty: `${results_any}`")
+    endif()
+
+    if(NOT results_any_forward)
+      message(SEND_ERROR "Any forward dependencies are empty: `${results_any_forward}`")
+    endif()
+  ]]
+)
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-subdir/CMakeLists.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-subdir/CMakeLists.txt
new file mode 100644
index 0000000..8a1946c
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-subdir/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c")
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
index 5583407..88ed1bb 100644
--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
@@ -49,6 +49,9 @@
   run_cmake(badargs1)
   run_cmake(badargs2)
 elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
+  run_install_test(CMP0207-OLD)
+  run_install_test(CMP0207-WARN)
+  run_install_test(CMP0207-NEW)
   run_install_test(windows)
   run_install_test(windows-unresolved)
   run_install_test(windows-conflict)
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake
index aad9077..c45955f 100644
--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake
@@ -50,6 +50,7 @@
 
 install(CODE [[
   function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
+    cmake_policy(SET CMP0207 NEW)
     file(GET_RUNTIME_DEPENDENCIES
       RESOLVED_DEPENDENCIES_VAR deps
       UNRESOLVED_DEPENDENCIES_VAR udeps
diff --git a/Tests/RunCMake/include_external_msproject/AutoType-check-slnx.cmake b/Tests/RunCMake/include_external_msproject/AutoType-check-slnx.cmake
index 560c9c0..ba68941 100644
--- a/Tests/RunCMake/include_external_msproject/AutoType-check-slnx.cmake
+++ b/Tests/RunCMake/include_external_msproject/AutoType-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <BuildDependency Project="external\.csproj"/>
     <BuildDependency Project="external\.dbproj"/>
diff --git a/Tests/RunCMake/include_external_msproject/CustomConfig-check-slnx.cmake b/Tests/RunCMake/include_external_msproject/CustomConfig-check-slnx.cmake
index 439d9ff..d3f5b8b 100644
--- a/Tests/RunCMake/include_external_msproject/CustomConfig-check-slnx.cmake
+++ b/Tests/RunCMake/include_external_msproject/CustomConfig-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <BuildDependency Project="external.project"/>
     <Build Solution="Debug\|\*" Project="false"/>
diff --git a/Tests/RunCMake/include_external_msproject/CustomGuid-check-slnx.cmake b/Tests/RunCMake/include_external_msproject/CustomGuid-check-slnx.cmake
index c03a428..07a16b6 100644
--- a/Tests/RunCMake/include_external_msproject/CustomGuid-check-slnx.cmake
+++ b/Tests/RunCMake/include_external_msproject/CustomGuid-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <BuildDependency Project="external.project"/>
     <Build Solution="Debug\|\*" Project="false"/>
diff --git a/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check-slnx.cmake b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check-slnx.cmake
index 9792fde..a5806d0 100644
--- a/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check-slnx.cmake
+++ b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <BuildDependency Project="external.project"/>
     <Build Solution="Debug\|\*" Project="false"/>
diff --git a/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check-slnx.cmake b/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check-slnx.cmake
index 30156f1..5eb6622 100644
--- a/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check-slnx.cmake
+++ b/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check-slnx.cmake
@@ -8,7 +8,7 @@
     <BuildType Name="RelWithDebInfo"/>
     <Platform Name="[^"]+"/>
   </Configurations>
-  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+">
+  <Project Path="ALL_BUILD\.vcxproj" Id="[0-9a-f-]+" DefaultStartup="true">
     <BuildDependency Project="ZERO_CHECK\.vcxproj"/>
     <BuildDependency Project="external.project"/>
     <Build Solution="Debug\|\*" Project="false"/>
diff --git a/b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW-all-result.txt b/b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW-all-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW-all-stderr.txt b/b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW-all-stderr.txt
new file mode 100644
index 0000000..4df8527
--- /dev/null
+++ b/b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMP0207-NEW-all-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+  file Could not resolve runtime dependencies:
+
+    [^
+]*test\.dll$