install(EXPORT): Drop REQUIRED from exported find_dependency calls

In commit c6e6861e63 (install(EXPORT): Export find_dependency() calls,
2023-11-07, v3.29.0-rc1~439^2~1) we made the calls `REQUIRED`.  However,
a dependency is only required if the dependent package is required.
`find_dependency` already forwards the `REQUIRED` mark, and also already
marks the dependent package as not found if the dependency is missing.

Fixes: #25756
This commit is contained in:
Brad King
2024-03-11 11:57:41 -04:00
parent 04d8bc6bb9
commit b1c4806914
3 changed files with 6 additions and 6 deletions

View File

@@ -1260,7 +1260,7 @@ void cmExportFileGenerator::GenerateFindDependencyCalls(std::ostream& os)
for (auto const& it : packageDependenciesSorted) {
if (it.second.Enabled == cmExportSet::PackageDependencyExportEnabled::On) {
os << "find_dependency(" << it.first << " REQUIRED";
os << "find_dependency(" << it.first;
for (auto const& arg : it.second.ExtraArguments) {
os << " " << cmOutputConverter::EscapeForCMake(arg);
}