mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
cmake: Friendlier message when trying to --build the wrong dir
Also for --open. Fixes: #11166
This commit is contained in:
@@ -3850,7 +3850,8 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
|
||||
|
||||
std::string cachePath = FindCacheFile(dir);
|
||||
if (!this->LoadCache(cachePath)) {
|
||||
std::cerr << "Error: could not load cache\n";
|
||||
std::cerr
|
||||
<< "Error: not a CMake build directory (missing CMakeCache.txt)\n";
|
||||
return 1;
|
||||
}
|
||||
cmValue cachedGenerator = this->State->GetCacheEntryValue("CMAKE_GENERATOR");
|
||||
@@ -3979,7 +3980,8 @@ bool cmake::Open(std::string const& dir, bool dryRun)
|
||||
|
||||
std::string cachePath = FindCacheFile(dir);
|
||||
if (!this->LoadCache(cachePath)) {
|
||||
std::cerr << "Error: could not load cache\n";
|
||||
std::cerr
|
||||
<< "Error: not a CMake build directory (missing CMakeCache.txt)\n";
|
||||
return false;
|
||||
}
|
||||
cmValue genName = this->State->GetCacheEntryValue("CMAKE_GENERATOR");
|
||||
|
||||
@@ -1 +1 @@
|
||||
^Error: could not load cache
|
||||
^Error: not a CMake build directory \(missing CMakeCache\.txt\)$
|
||||
|
||||
@@ -1 +1 @@
|
||||
^Error: could not load cache$
|
||||
^Error: not a CMake build directory \(missing CMakeCache\.txt\)$
|
||||
|
||||
Reference in New Issue
Block a user