Merge topic 'file-GLOB-CONFIGURE_DEPENDS-quoting' into release-4.0

249e364dd7 Merge branch 'backport-3.31-file-GLOB-CONFIGURE_DEPENDS-quoting'
2c89c2a74c file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names
9a9ce6637b file(GLOB): Teach CONFIGURE_DEPENDS to handle quotes in matched file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12378
This commit is contained in:
Brad King
2026-08-07 10:49:40 -04:00
5 changed files with 10 additions and 4 deletions

View File

@@ -11,6 +11,7 @@
#include "cmListFileCache.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
#include "cmOutputConverter.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
@@ -63,7 +64,8 @@ bool cmGlobVerificationManager::SaveVerificationScript(std::string const& path,
verifyScriptFile << "set(OLD_GLOB\n";
for (std::string const& file : v.Files) {
verifyScriptFile << " \"" << file << "\"\n";
verifyScriptFile << " " << cmOutputConverter::EscapeForCMake(file)
<< '\n';
}
verifyScriptFile << " )\n";

View File

@@ -1 +1 @@
.*b9fbdd8803c036dbe9f5ea6b74db4b9670c78a72
.*(f7e3d5ebf4a6976f057a883301f2066b10bd4cd6|b9fbdd8803c036dbe9f5ea6b74db4b9670c78a72)

View File

@@ -1,2 +1,2 @@
.*Running CMake on GLOB-CONFIGURE_DEPENDS-RerunCMake
.*6bc141b40c0f851d20fa9a1fe5fbdae94acc5de0
.*(293478329e0cb75b6b85e35dbe513b175f4c2311|6bc141b40c0f851d20fa9a1fe5fbdae94acc5de0)

View File

@@ -1,2 +1,2 @@
.*Running CMake on GLOB-CONFIGURE_DEPENDS-RerunCMake
.*0c3ceab9daa7914fde7410c34cae4049e140aa51
.*(be528f629fe14e32494b2bba544361392e177d4c|0c3ceab9daa7914fde7410c34cae4049e140aa51)

View File

@@ -144,6 +144,10 @@ else()
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/test")
if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows|CYGWIN|MSYS")
# Test literal quotes in matched file names.
file(WRITE "${RunCMake_TEST_BINARY_DIR}/test/\".txt" "")
endif()
set(tf_1 "${RunCMake_TEST_BINARY_DIR}/test/1.txt")
file(WRITE "${tf_1}" "1")