summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f54196b..32064b4 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1576,14 +1576,15 @@ void cmake::SetArgs(const std::vector<std::string>& args)
if (!expandedPreset->ArchitectureStrategy ||
expandedPreset->ArchitectureStrategy ==
cmCMakePresetsGraph::ArchToolsetStrategy::Set) {
- if (!this->GeneratorPlatformSet) {
+ if (!this->GeneratorPlatformSet &&
+ !expandedPreset->Architecture.empty()) {
this->SetGeneratorPlatform(expandedPreset->Architecture);
}
}
if (!expandedPreset->ToolsetStrategy ||
expandedPreset->ToolsetStrategy ==
cmCMakePresetsGraph::ArchToolsetStrategy::Set) {
- if (!this->GeneratorToolsetSet) {
+ if (!this->GeneratorToolsetSet && !expandedPreset->Toolset.empty()) {
this->SetGeneratorToolset(expandedPreset->Toolset);
}
}
@@ -2395,8 +2396,15 @@ int cmake::ActualConfigure()
cmSystemTools::RemoveADirectory(redirectsDir);
if (!cmSystemTools::MakeDirectory(redirectsDir)) {
cmSystemTools::Error(
- "Unable to (re)create the private pkgRedirects directory:\n" +
- redirectsDir);
+ cmStrCat("Unable to (re)create the private pkgRedirects directory:\n ",
+ redirectsDir,
+ "\n"
+ "This may be caused by not having read/write access to "
+ "the build directory.\n"
+ "Try specifying a location with read/write access like:\n"
+ " cmake -B build\n"
+ "If using a CMake presets file, ensure that preset parameter\n"
+ "'binaryDir' expands to a writable directory.\n"));
return -1;
}
this->AddCacheEntry("CMAKE_FIND_PACKAGE_REDIRECTS_DIR", redirectsDir,
@@ -2508,6 +2516,16 @@ int cmake::ActualConfigure()
"Name of generator toolset.", cmStateEnums::INTERNAL);
}
+ if (!this->State->GetInitializedCacheValue("CMAKE_TEST_LAUNCHER")) {
+ cm::optional<std::string> testLauncher =
+ cmSystemTools::GetEnvVar("CMAKE_TEST_LAUNCHER");
+ if (testLauncher && !testLauncher->empty()) {
+ std::string message = "Test launcher to run tests executable.";
+ this->AddCacheEntry("CMAKE_TEST_LAUNCHER", *testLauncher, message,
+ cmStateEnums::STRING);
+ }
+ }
+
if (!this->State->GetInitializedCacheValue(
"CMAKE_CROSSCOMPILING_EMULATOR")) {
cm::optional<std::string> emulator =