summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-12-30 21:06:12 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-01-05 00:18:37 (GMT)
commitf5b1980fb27fa902d37856ec3e22daddfeb9d52f (patch)
tree3d99a89698345ca324f1c7a366fa8c67dfdd69f6 /Source/cmExportInstallFileGenerator.cxx
parentc67b8124f735e7f96567a276e16969607b300e43 (diff)
downloadCMake-f5b1980fb27fa902d37856ec3e22daddfeb9d52f.zip
CMake-f5b1980fb27fa902d37856ec3e22daddfeb9d52f.tar.gz
CMake-f5b1980fb27fa902d37856ec3e22daddfeb9d52f.tar.bz2
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.
Diffstat (limited to 'Source/cmExportInstallFileGenerator.cxx')
-rw-r--r--Source/cmExportInstallFileGenerator.cxx25
1 files changed, 14 insertions, 11 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 6ba7d9f..2b7937e 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -39,6 +39,7 @@ std::string cmExportInstallFileGenerator::GetConfigImportFileGlob()
//----------------------------------------------------------------------------
bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
+ std::vector<cmTarget*> allTargets;
{
std::string expectedTargets;
std::string sep;
@@ -48,20 +49,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
expectedTargets += sep + this->Namespace + (*tei)->Target->GetName();
sep = " ";
- }
-
- this->GenerateExpectedTargetsCode(os, expectedTargets);
- }
-
- // Create all the imported targets.
- for(std::vector<cmTargetExport*>::const_iterator
- tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
- tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
- {
cmTargetExport const* te = *tei;
if(this->ExportedTargets.insert(te->Target).second)
{
- this->GenerateImportTargetCode(os, te->Target);
+ allTargets.push_back(te->Target);
}
else
{
@@ -75,6 +66,18 @@ bool cmExportInstallFileGenerator::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);
+ }
+
// Now load per-configuration properties for them.
os << "# Load information for each installed configuration.\n"
<< "GET_FILENAME_COMPONENT(_DIR \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n"