diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 8a76c21..c37417d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -132,15 +132,15 @@ void cmLocalGenerator::TraceDependencies() this->GlobalGenerator->CreateEvaluationSourceFiles(*ci); } // Generate the rule files for each target. - cmGeneratorTargetsType targets = this->GetGeneratorTargets(); - for(cmGeneratorTargetsType::iterator t = targets.begin(); + std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets(); + for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin(); t != targets.end(); ++t) { - if (t->second->GetType() == cmState::INTERFACE_LIBRARY) + if ((*t)->GetType() == cmState::INTERFACE_LIBRARY) { continue; } - t->second->TraceDependencies(); + (*t)->TraceDependencies(); } } @@ -448,9 +448,16 @@ void cmLocalGenerator::GenerateInstallRules() } -void cmLocalGenerator::AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt) +void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt) { - this->GeneratorTargets[t] = gt; + this->GeneratorTargets.push_back(gt); +} + +cmGeneratorTarget* cmLocalGenerator::FindGeneratorTarget( + const std::string& name) const +{ + return this->GetGlobalGenerator()->GetGeneratorTarget( + this->Makefile->FindTarget(name)); } //---------------------------------------------------------------------------- @@ -465,12 +472,12 @@ void cmLocalGenerator::ComputeTargetManifest() } // Add our targets to the manifest for each configuration. - cmGeneratorTargetsType targets = this->GetGeneratorTargets(); - for(cmGeneratorTargetsType::iterator t = targets.begin(); + std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets(); + for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin(); t != targets.end(); ++t) { - cmGeneratorTarget& target = *t->second; - if (target.GetType() == cmState::INTERFACE_LIBRARY) + cmGeneratorTarget* target = *t; + if (target->GetType() == cmState::INTERFACE_LIBRARY) { continue; } @@ -478,7 +485,7 @@ void cmLocalGenerator::ComputeTargetManifest() ci != configNames.end(); ++ci) { const char* config = ci->c_str(); - target.ComputeTargetManifest(config); + target->ComputeTargetManifest(config); } } } @@ -2133,7 +2140,7 @@ void cmLocalGenerator "has the following visibility properties set for " << lang << ":\n" << warnCMP0063 << "For compatibility CMake is not honoring them for this target."; - target->Target->GetMakefile()->GetCMakeInstance() + target->GetLocalGenerator()->GetCMakeInstance() ->IssueMessage(cmake::AUTHOR_WARNING, w.str(), target->GetBacktrace()); } @@ -2503,28 +2510,29 @@ cmLocalGenerator { // Convert the old-style install specification from each target to // an install generator and run it. - cmTargets& tgts = this->Makefile->GetTargets(); - for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets(); + for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin(); + l != tgts.end(); ++l) { - if (l->second.GetType() == cmState::INTERFACE_LIBRARY) + if ((*l)->GetType() == cmState::INTERFACE_LIBRARY) { continue; } // Include the user-specified pre-install script for this target. - if(const char* preinstall = l->second.GetProperty("PRE_INSTALL_SCRIPT")) + if(const char* preinstall = (*l)->GetProperty("PRE_INSTALL_SCRIPT")) { cmInstallScriptGenerator g(preinstall, false, 0); g.Generate(os, config, configurationTypes); } // Install this target if a destination is given. - if(l->second.GetInstallPath() != "") + if((*l)->Target->GetInstallPath() != "") { // Compute the full install destination. Note that converting // to unix slashes also removes any trailing slash. // We also skip over the leading slash given by the user. - std::string destination = l->second.GetInstallPath().substr(1); + std::string destination = (*l)->Target->GetInstallPath().substr(1); cmSystemTools::ConvertToUnixSlashes(destination); if(destination.empty()) { @@ -2532,7 +2540,7 @@ cmLocalGenerator } // Generate the proper install generator for this target type. - switch(l->second.GetType()) + switch((*l)->GetType()) { case cmState::EXECUTABLE: case cmState::STATIC_LIBRARY: @@ -2540,7 +2548,7 @@ cmLocalGenerator { // Use a target install generator. cmInstallTargetGeneratorLocal - g(this, l->first, destination.c_str(), false); + g(this, (*l)->GetName(), destination.c_str(), false); g.Generate(os, config, configurationTypes); } break; @@ -2551,18 +2559,18 @@ cmLocalGenerator // to the normal destination and the DLL to the runtime // destination. cmInstallTargetGeneratorLocal - g1(this, l->first, destination.c_str(), true); + g1(this, (*l)->GetName(), destination.c_str(), true); g1.Generate(os, config, configurationTypes); // We also skip over the leading slash given by the user. - destination = l->second.GetRuntimeInstallPath().substr(1); + destination = (*l)->Target->GetRuntimeInstallPath().substr(1); cmSystemTools::ConvertToUnixSlashes(destination); cmInstallTargetGeneratorLocal - g2(this, l->first, destination.c_str(), false); + g2(this, (*l)->GetName(), destination.c_str(), false); g2.Generate(os, config, configurationTypes); #else // Use a target install generator. cmInstallTargetGeneratorLocal - g(this, l->first, destination.c_str(), false); + g(this, (*l)->GetName(), destination.c_str(), false); g.Generate(os, config, configurationTypes); #endif } @@ -2573,7 +2581,7 @@ cmLocalGenerator } // Include the user-specified post-install script for this target. - if(const char* postinstall = l->second.GetProperty("POST_INSTALL_SCRIPT")) + if(const char* postinstall = (*l)->GetProperty("POST_INSTALL_SCRIPT")) { cmInstallScriptGenerator g(postinstall, false, 0); g.Generate(os, config, configurationTypes); |