Merge topic 'export-multiple-set-not-installed' into release-4.0

d723409e8e export: Allow multiple exports when only one export is installed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10489
This commit is contained in:
Brad King
2025-03-18 13:32:44 +00:00
committed by Kitware Robot
3 changed files with 11 additions and 4 deletions
+6 -4
View File
@@ -280,12 +280,14 @@ cmExportFileGenerator::ExportInfo cmExportInstallFileGenerator::FindExportInfo(
[&name](std::unique_ptr<cmTargetExport> const& te) {
return te->TargetName == name;
})) {
exportSets.insert(exp.first);
std::vector<cmInstallExportGenerator const*> const* installs =
exportSet.GetInstallations();
for (cmInstallExportGenerator const* install : *installs) {
exportFiles.push_back(install->GetDestinationFile());
namespaces.insert(install->GetNamespace());
if (!installs->empty()) {
exportSets.insert(exp.first);
for (cmInstallExportGenerator const* install : *installs) {
exportFiles.push_back(install->GetDestinationFile());
namespaces.insert(install->GetNamespace());
}
}
}
}
@@ -0,0 +1,4 @@
project(DependsMultipleNotInstalled CXX)
set(NAMESPACE foo::)
include(DependsMultipleCommon.cmake)
install(TARGETS foo EXPORT foo-alt) # set foo-alt never installed
@@ -34,3 +34,4 @@ run_cmake(LowerCaseFile)
run_cmake(Requirements)
run_cmake(TargetTypes)
run_cmake(DependsMultiple)
run_cmake(DependsMultipleNotInstalled)