Merge branch 'backport-4.0-cmake-P-script-case'

This commit is contained in:
Brad King
2026-04-13 14:23:26 -04:00
5 changed files with 16 additions and 4 deletions
+2 -2
View File
@@ -667,7 +667,7 @@ bool cmake::SetCacheArgs(std::vector<std::string> const& args)
cmake::CommandFailureAction::FATAL_ERROR);
state->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
state->SetHomeOutputDirectory(cmSystemTools::GetLogicalWorkingDirectory());
state->ReadListFile(args, path);
state->ReadListFile(args, cmSystemTools::ToNormalizedPathOnDisk(path));
return true;
};
@@ -808,7 +808,7 @@ void cmake::ReadListFile(std::vector<std::string> const& args,
snapshot.SetDefaultDefinitions();
cmMakefile mf(gg, snapshot);
if (this->GetWorkingMode() != NORMAL_MODE) {
mf.SetScriptModeFile(cmSystemTools::ToNormalizedPathOnDisk(path));
mf.SetScriptModeFile(path);
mf.SetArgcArgv(args);
}
if (!cmSystemTools::FileExists(path, true)) {
@@ -0,0 +1,2 @@
^-- CMAKE_SCRIPT_MODE_FILE='[^']*/Tests/RunCMake/CommandLine/P_PathOnDisk.cmake'
-- CMAKE_CURRENT_LIST_FILE='[^']*/Tests/RunCMake/CommandLine/P_PathOnDisk.cmake'$
@@ -0,0 +1,2 @@
message(STATUS "CMAKE_SCRIPT_MODE_FILE='${CMAKE_SCRIPT_MODE_FILE}'")
message(STATUS "CMAKE_CURRENT_LIST_FILE='${CMAKE_CURRENT_LIST_FILE}'")
@@ -1,2 +1,4 @@
^CMake Error: Not a file: nosuchscriptfile\.cmake
CMake Error: Error processing file: nosuchscriptfile\.cmake$
^CMake Error: Not a file: [^
]*/Tests/RunCMake/CommandLine/P_no-file-build/nosuchscriptfile\.cmake
CMake Error: Error processing file: [^
]*/Tests/RunCMake/CommandLine/P_no-file-build/nosuchscriptfile\.cmake$
@@ -70,6 +70,12 @@ run_cmake_command(P_P_in_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_D
run_cmake_command(P_P_in_arbitrary_args_2 ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -P -o)
run_cmake_command(P_fresh ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_fresh.cmake" --fresh)
if(CMAKE_HOST_WIN32)
run_cmake_command(P_PathOnDisk ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/../CommandLine/P_pathondisk.cmake")
else()
run_cmake_command(P_PathOnDisk ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/../CommandLine/P_PathOnDisk.cmake")
endif()
run_cmake_command(build-no-dir
${CMAKE_COMMAND} --build)
run_cmake_command(build-no-dir2