mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 11:49:55 -06:00
cmPackageInfoArguments: Improve error message
When given the name of a project that doesn't exist, report it as an "unknown project" rather than an "invalid project". This is more consistent with other, similar reporting.
This commit is contained in:
@@ -163,7 +163,7 @@ bool cmPackageInfoArguments::SetEffectiveProject(cmExecutionStatus& status)
|
||||
if (!this->ProjectName.empty()) {
|
||||
// User specified a project; make sure it exists.
|
||||
if (!mf.GetStateSnapshot().CheckProjectName(this->ProjectName)) {
|
||||
status.SetError(cmStrCat(R"(PROJECT given invalid project name ")"_s,
|
||||
status.SetError(cmStrCat(R"(PROJECT given unknown project name ")"_s,
|
||||
this->ProjectName, R"(".)"_s));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ Call Stack \(most recent call first\):
|
||||
|
||||
|
||||
CMake Error at BadArgs1\.cmake:6 \(export\):
|
||||
export PROJECT given invalid project name "bar"\.
|
||||
export PROJECT given unknown project name "bar"\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:3 \(include\)
|
||||
|
||||
@@ -17,6 +17,6 @@ Call Stack \(most recent call first\):
|
||||
|
||||
|
||||
CMake Error at BadArgs1\.cmake:6 \(install\):
|
||||
install PROJECT given invalid project name "bar"\.
|
||||
install PROJECT given unknown project name "bar"\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:3 \(include\)
|
||||
|
||||
Reference in New Issue
Block a user