mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-28 01:49:23 -05:00
Populate the ExportedTargets member early in GenerateMainFile
The member variable is checked to determine whether to call HandleMissingTarget(). As that could be called during the loop in the comming commits, ensure that it contains all targets being exported.
This commit is contained in:
@@ -22,6 +22,7 @@ cmExportBuildFileGenerator::cmExportBuildFileGenerator()
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
||||
{
|
||||
std::vector<cmTarget*> allTargets;
|
||||
{
|
||||
std::string expectedTargets;
|
||||
std::string sep;
|
||||
@@ -31,20 +32,10 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
||||
{
|
||||
expectedTargets += sep + this->Namespace + (*tei)->GetName();
|
||||
sep = " ";
|
||||
}
|
||||
|
||||
this->GenerateExpectedTargetsCode(os, expectedTargets);
|
||||
}
|
||||
|
||||
// Create all the imported targets.
|
||||
for(std::vector<cmTarget*>::const_iterator
|
||||
tei = this->Exports->begin();
|
||||
tei != this->Exports->end(); ++tei)
|
||||
{
|
||||
cmTarget* te = *tei;
|
||||
if(this->ExportedTargets.insert(te).second)
|
||||
{
|
||||
this->GenerateImportTargetCode(os, te);
|
||||
allTargets.push_back(te);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -58,6 +49,18 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
||||
}
|
||||
}
|
||||
|
||||
this->GenerateExpectedTargetsCode(os, expectedTargets);
|
||||
}
|
||||
|
||||
// Create all the imported targets.
|
||||
for(std::vector<cmTarget*>::const_iterator
|
||||
tei = allTargets.begin();
|
||||
tei != allTargets.end(); ++tei)
|
||||
{
|
||||
cmTarget* te = *tei;
|
||||
this->GenerateImportTargetCode(os, te);
|
||||
}
|
||||
|
||||
// Generate import file content for each configuration.
|
||||
for(std::vector<std::string>::const_iterator
|
||||
ci = this->Configurations.begin();
|
||||
|
||||
Reference in New Issue
Block a user