mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-11 16:50:50 -05:00
cmake: Improve error message if CMAKE_BINARY_DIR not writable
Fixes: #24407
This commit is contained in:
+9
-2
@@ -2397,8 +2397,15 @@ int cmake::ActualConfigure()
|
|||||||
cmSystemTools::RemoveADirectory(redirectsDir);
|
cmSystemTools::RemoveADirectory(redirectsDir);
|
||||||
if (!cmSystemTools::MakeDirectory(redirectsDir)) {
|
if (!cmSystemTools::MakeDirectory(redirectsDir)) {
|
||||||
cmSystemTools::Error(
|
cmSystemTools::Error(
|
||||||
"Unable to (re)create the private pkgRedirects directory:\n" +
|
cmStrCat("Unable to (re)create the private pkgRedirects directory:\n ",
|
||||||
redirectsDir);
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
this->AddCacheEntry("CMAKE_FIND_PACKAGE_REDIRECTS_DIR", redirectsDir,
|
this->AddCacheEntry("CMAKE_FIND_PACKAGE_REDIRECTS_DIR", redirectsDir,
|
||||||
|
|||||||
Reference in New Issue
Block a user