summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-18 15:06:14 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-24 07:19:53 (GMT)
commit67b2f4312c431eb363dd94a2bb5d88cc6c8a7c95 (patch)
tree11419dddadbd492b9baef008e3e70eff5ae3e402 /Source/cmLocalVisualStudio7Generator.cxx
parentf528e6bcb9b2e181dcd7ee0c1cc327b6cad84ad5 (diff)
downloadCMake-67b2f4312c431eb363dd94a2bb5d88cc6c8a7c95.zip
CMake-67b2f4312c431eb363dd94a2bb5d88cc6c8a7c95.tar.gz
CMake-67b2f4312c431eb363dd94a2bb5d88cc6c8a7c95.tar.bz2
Port to GetGeneratorTargets.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx45
1 files changed, 21 insertions, 24 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 819998c..4895698 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -67,19 +67,19 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator()
void cmLocalVisualStudio7Generator::AddHelperCommands()
{
// Now create GUIDs for targets
- 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;
}
- const char* path = l->second.GetProperty("EXTERNAL_MSPROJECT");
+ const char* path = (*l)->GetProperty("EXTERNAL_MSPROJECT");
if(path)
{
this->ReadAndStoreExternalGUID(
- l->second.GetName().c_str(), path);
+ (*l)->GetName().c_str(), path);
}
}
@@ -95,7 +95,6 @@ void cmLocalVisualStudio7Generator::Generate()
void cmLocalVisualStudio7Generator::AddCMakeListsRules()
{
- cmTargets &tgts = this->Makefile->GetTargets();
// Create the regeneration custom rule.
if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION"))
{
@@ -104,17 +103,17 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules()
if(cmSourceFile* sf = this->CreateVCProjBuildRule())
{
// Add the rule to targets that need it.
- 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::GLOBAL_TARGET)
+ if ((*l)->GetType() == cmState::GLOBAL_TARGET)
{
continue;
}
- if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
+ if((*l)->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
{
- cmGeneratorTarget* gt =
- this->GlobalGenerator->GetGeneratorTarget(&l->second);
- gt->AddSource(sf->GetFullPath());
+ (*l)->AddSource(sf->GetFullPath());
}
}
}
@@ -126,11 +125,11 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
// Visual Studio .NET 2003 Service Pack 1 will not run post-build
// commands for targets in which no sources are built. Add dummy
// rules to force these targets to build.
- cmTargets &tgts = this->Makefile->GetTargets();
- for(cmTargets::iterator l = tgts.begin();
+ std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
+ for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
l != tgts.end(); l++)
{
- cmTarget& tgt = l->second;
+ cmTarget& tgt = *(*l)->Target;
if(tgt.GetType() == cmState::GLOBAL_TARGET)
{
std::vector<std::string> no_depends;
@@ -150,9 +149,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
force.c_str(), no_depends, no_main_dependency,
force_commands, " ", 0, true))
{
- cmGeneratorTarget* gt =
- this->GlobalGenerator->GetGeneratorTarget(&tgt);
- gt->AddSource(file->GetFullPath());
+ (*l)->AddSource(file->GetFullPath());
}
}
}
@@ -176,21 +173,21 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
}
// Get the set of targets in this directory.
- cmTargets &tgts = this->Makefile->GetTargets();
+ std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
// Create the project file for each target.
- for(cmTargets::iterator l = tgts.begin();
+ 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_EXTERNAL_MSPROJECT command only affects the workspace
// so don't build a projectfile for it
- if(!l->second.GetProperty("EXTERNAL_MSPROJECT"))
+ if(!(*l)->GetProperty("EXTERNAL_MSPROJECT"))
{
- this->CreateSingleVCProj(l->first.c_str(),l->second);
+ this->CreateSingleVCProj((*l)->GetName().c_str(), *(*l)->Target);
}
}
}