diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-10-10 19:32:37 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-11-22 14:06:25 (GMT) |
commit | c34968a9aa12221f54973a56d4e98940cff676a5 (patch) | |
tree | 706aef3eddc310e5836120498fdf054a2334b8d4 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | abb13ea5659cdaa4254724fca582f56570f88164 (diff) | |
download | CMake-c34968a9aa12221f54973a56d4e98940cff676a5.zip CMake-c34968a9aa12221f54973a56d4e98940cff676a5.tar.gz CMake-c34968a9aa12221f54973a56d4e98940cff676a5.tar.bz2 |
Port some of the generator API to cmGeneratorTarget.
Just enough to reach the BuildMacContentDirectory method and the
NeedRelinkBeforeInstall methods.
In the future, those methods can be moved to cmGeneratorTarget.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 8ed8d0a..9af5c29 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -145,13 +145,18 @@ void cmLocalUnixMakefileGenerator3::Generate() this->Makefile->IsOn("CMAKE_SKIP_ASSEMBLY_SOURCE_RULES"); // Generate the rule files for each target. - cmTargets& targets = this->Makefile->GetTargets(); + cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets(); cmGlobalUnixMakefileGenerator3* gg = static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator); - for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t) + for(cmGeneratorTargetsType::iterator t = targets.begin(); + t != targets.end(); ++t) { + if (t->second->Target->IsImported()) + { + continue; + } cmsys::auto_ptr<cmMakefileTargetGenerator> tg( - cmMakefileTargetGenerator::New(&(t->second))); + cmMakefileTargetGenerator::New(t->second)); if (tg.get()) { tg->WriteRuleFiles(); @@ -372,22 +377,23 @@ void cmLocalUnixMakefileGenerator3 // for each target we just provide a rule to cd up to the top and do a make // on the target - cmTargets& targets = this->Makefile->GetTargets(); + cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets(); std::string localName; - for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t) - { - if((t->second.GetType() == cmTarget::EXECUTABLE) || - (t->second.GetType() == cmTarget::STATIC_LIBRARY) || - (t->second.GetType() == cmTarget::SHARED_LIBRARY) || - (t->second.GetType() == cmTarget::MODULE_LIBRARY) || - (t->second.GetType() == cmTarget::OBJECT_LIBRARY) || - (t->second.GetType() == cmTarget::INTERFACE_LIBRARY) || - (t->second.GetType() == cmTarget::UTILITY)) + for(cmGeneratorTargetsType::iterator t = targets.begin(); + t != targets.end(); ++t) + { + if((t->second->GetType() == cmTarget::EXECUTABLE) || + (t->second->GetType() == cmTarget::STATIC_LIBRARY) || + (t->second->GetType() == cmTarget::SHARED_LIBRARY) || + (t->second->GetType() == cmTarget::MODULE_LIBRARY) || + (t->second->GetType() == cmTarget::OBJECT_LIBRARY) || + (t->second->GetType() == cmTarget::INTERFACE_LIBRARY) || + (t->second->GetType() == cmTarget::UTILITY)) { - emitted.insert(t->second.GetName()); + emitted.insert(t->second->GetName()); // for subdirs add a rule to build this specific target by name. - localName = this->GetRelativeTargetDirectory(t->second); + localName = this->GetRelativeTargetDirectory(*t->second->Target); localName += "/rule"; commands.clear(); depends.clear(); @@ -404,22 +410,23 @@ void cmLocalUnixMakefileGenerator3 localName.c_str(), depends, commands, true); // Add a target with the canonical name (no prefix, suffix or path). - if(localName != t->second.GetName()) + if(localName != t->second->GetName()) { commands.clear(); depends.push_back(localName); this->WriteMakeRule(ruleFileStream, "Convenience name for target.", - t->second.GetName(), depends, commands, true); + t->second->GetName(), depends, commands, true); } // Add a fast rule to build the target - std::string makefileName = this->GetRelativeTargetDirectory(t->second); + std::string makefileName = + this->GetRelativeTargetDirectory(*t->second->Target); makefileName += "/build.make"; // make sure the makefile name is suitable for a makefile std::string makeTargetName = - this->GetRelativeTargetDirectory(t->second); + this->GetRelativeTargetDirectory(*t->second->Target); makeTargetName += "/build"; - localName = t->second.GetName(); + localName = t->second->GetName(); localName += "/fast"; depends.clear(); commands.clear(); @@ -433,11 +440,12 @@ void cmLocalUnixMakefileGenerator3 // Add a local name for the rule to relink the target before // installation. - if(t->second.NeedRelinkBeforeInstall(this->ConfigurationName.c_str())) + if(t->second->Target + ->NeedRelinkBeforeInstall(this->ConfigurationName.c_str())) { - makeTargetName = this->GetRelativeTargetDirectory(t->second); + makeTargetName = this->GetRelativeTargetDirectory(*t->second->Target); makeTargetName += "/preinstall"; - localName = t->second.GetName(); + localName = t->second->GetName(); localName += "/preinstall"; depends.clear(); commands.clear(); |