mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 13:10:17 -06:00
find_package: Fix reporting of transitive dependency errors
Fix find_package to set an error message when trying to find dependencies of a CPS package fails. This fixes the command previously reporting "find_package unknown error" for such failures.
This commit is contained in:
committed by
Brad King
parent
0bd26d4527
commit
ac20cd43c0
@@ -1969,6 +1969,8 @@ bool cmFindPackageCommand::FindPackageDependencies(
|
||||
|
||||
// Try to find the requirement; fail if we can't.
|
||||
if (!fp.FindPackage() || fp.FileFound.empty()) {
|
||||
this->SetError(cmStrCat("could not find "_s, dep.Name,
|
||||
", required by "_s, this->Name, '.'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,3 +23,8 @@ Call Stack \(most recent call first\):
|
||||
cps/[Ii]ncomplete\.cps
|
||||
MissingTransitiveDependency\.cmake:[0-9]+ \(find_package\)
|
||||
CMakeLists\.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Error at MissingTransitiveDependency\.cmake:[0-9]+ \(find_package\):
|
||||
find_package could not find StillIncomplete, required by Incomplete\.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:[0-9]+ \(include\)
|
||||
|
||||
Reference in New Issue
Block a user