diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index a319f0cb6a..7bd60e8cb9 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -139,10 +139,9 @@ void cmExportBuildFileGenerator::HandleMissingTarget( // The target is not in the export. if (!this->AppendMode) { auto const& exportInfo = this->FindExportInfo(dependee); - auto const& exportFiles = exportInfo.first; - if (exportFiles.size() == 1) { - std::string missingTarget = exportInfo.second; + if (exportInfo.Files.size() == 1) { + std::string missingTarget = exportInfo.Namespace; missingTarget += dependee->GetExportName(); link_libs += missingTarget; @@ -151,7 +150,7 @@ void cmExportBuildFileGenerator::HandleMissingTarget( } // We are not appending, so all exported targets should be // known here. This is probably user-error. - this->ComplainAboutMissingTarget(depender, dependee, exportFiles); + this->ComplainAboutMissingTarget(depender, dependee, exportInfo.Files); } // Assume the target will be exported by another command. // Append it with the export namespace. diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index b1c9ce3b11..accf14c29b 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -8,7 +8,6 @@ #include #include #include -#include #include #include @@ -133,7 +132,11 @@ protected: virtual void ReportError(std::string const& errorMessage) const = 0; - using ExportInfo = std::pair, std::string>; + struct ExportInfo + { + std::vector Files; + std::string Namespace; + }; /** Find the set of export files and the unique namespace (if any) for a * target. */ diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 5767dc3230..8abc26a426 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -247,10 +247,9 @@ void cmExportInstallFileGenerator::HandleMissingTarget( cmGeneratorTarget* dependee) { auto const& exportInfo = this->FindExportInfo(dependee); - auto const& exportFiles = exportInfo.first; - if (exportFiles.size() == 1) { - std::string missingTarget = exportInfo.second; + if (exportInfo.Files.size() == 1) { + std::string missingTarget = exportInfo.Namespace; missingTarget += dependee->GetExportName(); link_libs += missingTarget; @@ -258,7 +257,7 @@ void cmExportInstallFileGenerator::HandleMissingTarget( } else { // All exported targets should be known here and should be unique. // This is probably user-error. - this->ComplainAboutMissingTarget(depender, dependee, exportFiles); + this->ComplainAboutMissingTarget(depender, dependee, exportInfo.Files); } } diff --git a/Source/cmExportPackageInfoGenerator.cxx b/Source/cmExportPackageInfoGenerator.cxx index 3f6628b21d..034f14562c 100644 --- a/Source/cmExportPackageInfoGenerator.cxx +++ b/Source/cmExportPackageInfoGenerator.cxx @@ -266,8 +266,8 @@ bool cmExportPackageInfoGenerator::NoteLinkedTarget( // Target belongs to another export from this build. auto const& exportInfo = this->FindExportInfo(linkedTarget); - if (exportInfo.first.size() == 1) { - auto const& linkNamespace = exportInfo.second; + if (exportInfo.Files.size() == 1) { + auto const& linkNamespace = exportInfo.Namespace; if (!cmHasSuffix(linkNamespace, "::")) { target->Makefile->IssueMessage( MessageType::FATAL_ERROR,