Merge topic 'improve-cps-project-error' into release-4.2

f2b7184b98 cmPackageInfoArguments: Improve error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !11363
This commit is contained in:
Brad King
2025-10-28 13:25:09 +00:00
committed by Kitware Robot
3 changed files with 3 additions and 3 deletions

View File

@@ -170,7 +170,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;
}

View File

@@ -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\)

View File

@@ -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\)