This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  da4fd959e23e6775e31f7911d56f6f862279bb6b (commit)
       via  f5ba69f99b7d2620409c9fe650a39005120e2df7 (commit)
      from  0efeb967c31ca2ab2fb38ffde27f20349517c423 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da4fd959e23e6775e31f7911d56f6f862279bb6b
commit da4fd959e23e6775e31f7911d56f6f862279bb6b
Merge: 0efeb96 f5ba69f
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Mon Jun 8 18:47:39 2015 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Jun 8 18:47:39 2015 -0400

    Merge topic 'use-generator-target' into next
    
    f5ba69f9 Revert topic.

diff --cc Source/cmMakefile.cxx
index 615bedc,a8b163a..2a9a806
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@@ -129,10 -100,12 +129,10 @@@ public
  
    bool RaiseScope(std::string const& var, const char* varDef, cmMakefile* mf)
    {
 -    std::list<cmDefinitions>::reverse_iterator it = this->VarStack.rbegin();
 -    assert(it != this->VarStack.rend());
 -    ++it;
 -    if(it == this->VarStack.rend())
 +    assert(this->VarScopeIter->Vars != this->VarTree.Root());
 +    if(this->VarScopeIter->Parent == this->VarTree.Root())
        {
-       cmLocalGenerator* plg = mf->LocalGenerator->GetParent();
+       cmLocalGenerator* plg = mf->GetLocalGenerator()->GetParent();
        if(!plg)
          {
          return false;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f5ba69f99b7d2620409c9fe650a39005120e2df7
commit f5ba69f99b7d2620409c9fe650a39005120e2df7
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Tue Jun 9 00:47:06 2015 +0200
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Tue Jun 9 00:47:24 2015 +0200

    Revert topic.

diff --git a/Source/cmComputeTargetDepends.cxx 
b/Source/cmComputeTargetDepends.cxx
index c4a03a0..87b47b4 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -147,12 +147,12 @@ bool cmComputeTargetDepends::Compute()
 
 //----------------------------------------------------------------------------
 void
-cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t,
+cmComputeTargetDepends::GetTargetDirectDepends(cmTarget const* t,
                                                cmTargetDependSet& deps)
 {
   // Lookup the index for this target.  All targets should be known by
   // this point.
-  std::map<cmGeneratorTarget const*, int>::const_iterator tii
+  std::map<cmTarget const*, int>::const_iterator tii
                                                   = this->TargetIndex.find(t);
   assert(tii != this->TargetIndex.end());
   int i = tii->second;
@@ -161,7 +161,7 @@ 
cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t,
   EdgeList const& nl = this->FinalGraph[i];
   for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
     {
-    cmGeneratorTarget const* dep = this->Targets[*ni];
+    cmTarget const* dep = this->Targets[*ni];
     cmTargetDependSet::iterator di = deps.insert(dep).first;
     di->SetType(ni->IsStrong());
     }
@@ -180,11 +180,9 @@ void cmComputeTargetDepends::CollectTargets()
         ti != targets.end(); ++ti)
       {
       cmTarget const* target = &ti->second;
-      cmGeneratorTarget* gt =
-          this->GlobalGenerator->GetGeneratorTarget(target);
       int index = static_cast<int>(this->Targets.size());
-      this->TargetIndex[gt] = index;
-      this->Targets.push_back(gt);
+      this->TargetIndex[target] = index;
+      this->Targets.push_back(target);
       }
     }
 }
@@ -206,7 +204,7 @@ void cmComputeTargetDepends::CollectDepends()
 void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
 {
   // Get the depender.
-  cmGeneratorTarget const* depender = this->Targets[depender_index];
+  cmTarget const* depender = this->Targets[depender_index];
   if (depender->GetType() == cmTarget::INTERFACE_LIBRARY)
     {
     return;
@@ -218,9 +216,10 @@ void cmComputeTargetDepends::CollectTargetDepends(int 
depender_index)
   // deal with config-specific dependencies.
   {
   std::set<std::string> emitted;
+  cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(depender);
 
   std::vector<std::string> configs;
-  depender->Makefile->GetConfigurations(configs);
+  depender->GetMakefile()->GetConfigurations(configs);
   if (configs.empty())
     {
     configs.push_back("");
@@ -229,7 +228,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int 
depender_index)
     it != configs.end(); ++it)
     {
     std::vector<cmSourceFile const*> objectFiles;
-    depender->GetExternalObjects(objectFiles, *it);
+    gt->GetExternalObjects(objectFiles, *it);
     for(std::vector<cmSourceFile const*>::const_iterator
         oi = objectFiles.begin(); oi != objectFiles.end(); ++oi)
       {
@@ -245,15 +244,15 @@ void cmComputeTargetDepends::CollectTargetDepends(int 
depender_index)
             ->IssueMessage(cmake::FATAL_ERROR,
                             "Only executables and non-OBJECT libraries may "
                             "reference target objects.",
-                            depender->Target->GetBacktrace());
+                            depender->GetBacktrace());
           return;
           }
-        const_cast<cmGeneratorTarget*>(depender)->Target->AddUtility(objLib);
+        const_cast<cmTarget*>(depender)->AddUtility(objLib);
         }
       }
 
     cmTarget::LinkImplementation const* impl =
-      depender->Target->GetLinkImplementation(*it);
+      depender->GetLinkImplementation(*it);
 
     // A target should not depend on itself.
     emitted.insert(depender->GetName());
@@ -273,7 +272,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int 
depender_index)
 
   // Loop over all utility dependencies.
   {
-  std::set<cmLinkItem> const& tutils = depender->Target->GetUtilityItems();
+  std::set<cmLinkItem> const& tutils = depender->GetUtilityItems();
   std::set<std::string> emitted;
   // A target should not depend on itself.
   emitted.insert(depender->GetName());
@@ -291,14 +290,13 @@ void cmComputeTargetDepends::CollectTargetDepends(int 
depender_index)
 
 //----------------------------------------------------------------------------
 void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
-                                             const cmGeneratorTarget* dependee,
-                                             const std::string& config,
-                                             std::set<std::string> &emitted)
+                                                 cmTarget const* dependee,
+                                                 const std::string& config,
+                                               std::set<std::string> &emitted)
 {
-  cmGeneratorTarget const* depender = this->Targets[depender_index];
+  cmTarget const* depender = this->Targets[depender_index];
   if(cmTarget::LinkInterface const* iface =
-                                dependee->Target->GetLinkInterface(config,
-                                                           depender->Target))
+                                dependee->GetLinkInterface(config, depender))
     {
     for(std::vector<cmLinkItem>::const_iterator
         lib = iface->Libraries.begin();
@@ -319,7 +317,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int 
depender_index,
                                              cmLinkItem const& dependee_name,
                                              std::set<std::string> &emitted)
 {
-  cmGeneratorTarget const* depender = this->Targets[depender_index];
+  cmTarget const* depender = this->Targets[depender_index];
   cmTarget const* dependee = dependee_name.Target;
   // Skip targets that will not really be linked.  This is probably a
   // name conflict between an external library and an executable
@@ -333,17 +331,16 @@ void cmComputeTargetDepends::AddInterfaceDepends(int 
depender_index,
 
   if(dependee)
     {
-    cmGeneratorTarget* gt =
-        this->GlobalGenerator->GetGeneratorTarget(dependee);
-    this->AddInterfaceDepends(depender_index, gt, "", emitted);
+    this->AddInterfaceDepends(depender_index, dependee, "", emitted);
     std::vector<std::string> configs;
-    depender->Makefile->GetConfigurations(configs);
+    depender->GetMakefile()->GetConfigurations(configs);
     for (std::vector<std::string>::const_iterator it = configs.begin();
       it != configs.end(); ++it)
       {
       // A target should not depend on itself.
       emitted.insert(depender->GetName());
-      this->AddInterfaceDepends(depender_index, gt, *it, emitted);
+      this->AddInterfaceDepends(depender_index, dependee,
+                                *it, emitted);
       }
     }
 }
@@ -354,7 +351,7 @@ void cmComputeTargetDepends::AddTargetDepend(
   bool linking)
 {
   // Get the depender.
-  cmGeneratorTarget const* depender = this->Targets[depender_index];
+  cmTarget const* depender = this->Targets[depender_index];
 
   // Check the target's makefile first.
   cmTarget const* dependee = dependee_name.Target;
@@ -365,7 +362,7 @@ void cmComputeTargetDepends::AddTargetDepend(
     cmake::MessageType messageType = cmake::AUTHOR_WARNING;
     bool issueMessage = false;
     std::ostringstream e;
-    switch(depender->Target->GetPolicyStatusCMP0046())
+    switch(depender->GetPolicyStatusCMP0046())
       {
       case cmPolicies::WARN:
         e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0046) << "\n";
@@ -386,7 +383,7 @@ void cmComputeTargetDepends::AddTargetDepend(
         << "\" of target \"" << depender->GetName() << "\" does not exist.";
 
       cmListFileBacktrace const* backtrace =
-        depender->Target->GetUtilityBacktrace(dependee_name);
+        depender->GetUtilityBacktrace(dependee_name);
       if(backtrace)
         {
         cm->IssueMessage(messageType, e.str(), *backtrace);
@@ -411,31 +408,27 @@ void cmComputeTargetDepends::AddTargetDepend(
 
   if(dependee)
     {
-    cmGeneratorTarget* gt =
-        this->GlobalGenerator->GetGeneratorTarget(dependee);
-    this->AddTargetDepend(depender_index, gt, linking);
+    this->AddTargetDepend(depender_index, dependee, linking);
     }
 }
 
 //----------------------------------------------------------------------------
 void cmComputeTargetDepends::AddTargetDepend(int depender_index,
-                                             const cmGeneratorTarget* dependee,
+                                             cmTarget const* dependee,
                                              bool linking)
 {
-  if(dependee->Target->IsImported() ||
+  if(dependee->IsImported() ||
      dependee->GetType() == cmTarget::INTERFACE_LIBRARY)
     {
     // Skip IMPORTED and INTERFACE targets but follow their utility
     // dependencies.
-    std::set<cmLinkItem> const& utils = dependee->Target->GetUtilityItems();
+    std::set<cmLinkItem> const& utils = dependee->GetUtilityItems();
     for(std::set<cmLinkItem>::const_iterator i = utils.begin();
         i != utils.end(); ++i)
       {
       if(cmTarget const* transitive_dependee = i->Target)
         {
-        cmGeneratorTarget* gt =
-            this->GlobalGenerator->GetGeneratorTarget(transitive_dependee);
-        this->AddTargetDepend(depender_index, gt, false);
+        this->AddTargetDepend(depender_index, transitive_dependee, false);
         }
       }
     }
@@ -443,7 +436,7 @@ void cmComputeTargetDepends::AddTargetDepend(int 
depender_index,
     {
     // Lookup the index for this target.  All targets should be known by
     // this point.
-    std::map<cmGeneratorTarget const*, int>::const_iterator tii =
+    std::map<cmTarget const*, int>::const_iterator tii =
       this->TargetIndex.find(dependee);
     assert(tii != this->TargetIndex.end());
     int dependee_index = tii->second;
@@ -464,13 +457,13 @@ cmComputeTargetDepends::DisplayGraph(Graph const& graph,
   for(int depender_index = 0; depender_index < n; ++depender_index)
     {
     EdgeList const& nl = graph[depender_index];
-    cmGeneratorTarget const* depender = this->Targets[depender_index];
+    cmTarget const* depender = this->Targets[depender_index];
     fprintf(stderr, "target %d is [%s]\n",
             depender_index, depender->GetName().c_str());
     for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
       {
       int dependee_index = *ni;
-      cmGeneratorTarget const* dependee = this->Targets[dependee_index];
+      cmTarget const* dependee = this->Targets[dependee_index];
       fprintf(stderr, "  depends on target %d [%s] (%s)\n", dependee_index,
               dependee->GetName().c_str(), ni->IsStrong()? "strong" : "weak");
       }
@@ -557,11 +550,11 @@ cmComputeTargetDepends
     {
     // Get the depender.
     int i = *ci;
-    cmGeneratorTarget const* depender = this->Targets[i];
+    cmTarget const* depender = this->Targets[i];
 
     // Describe the depender.
     e << "  \"" << depender->GetName() << "\" of type "
-      << cmTarget::GetTargetTypeName(depender->Target->GetType()) << "\n";
+      << cmTarget::GetTargetTypeName(depender->GetType()) << "\n";
 
     // List its dependencies that are inside the component.
     EdgeList const& nl = this->InitialGraph[i];
@@ -570,7 +563,7 @@ cmComputeTargetDepends
       int j = *ni;
       if(cmap[j] == c)
         {
-        cmGeneratorTarget const* dependee = this->Targets[j];
+        cmTarget const* dependee = this->Targets[j];
         e << "    depends on \"" << dependee->GetName() << "\""
           << " (" << (ni->IsStrong()? "strong" : "weak") << ")\n";
         }
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index 6100d97..902f342 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -21,7 +21,7 @@
 class cmComputeComponentGraph;
 class cmGlobalGenerator;
 class cmLinkItem;
-class cmGeneratorTarget;
+class cmTarget;
 class cmTargetDependSet;
 
 /** \class cmComputeTargetDepends
@@ -39,10 +39,9 @@ public:
 
   bool Compute();
 
-  std::vector<cmGeneratorTarget const*> const&
+  std::vector<cmTarget const*> const&
   GetTargets() const { return this->Targets; }
-  void GetTargetDirectDepends(cmGeneratorTarget const* t,
-                              cmTargetDependSet& deps);
+  void GetTargetDirectDepends(cmTarget const* t, cmTargetDependSet& deps);
 private:
   void CollectTargets();
   void CollectDepends();
@@ -50,14 +49,13 @@ private:
   void AddTargetDepend(int depender_index,
                        cmLinkItem const& dependee_name,
                        bool linking);
-  void AddTargetDepend(int depender_index, cmGeneratorTarget const* dependee,
+  void AddTargetDepend(int depender_index, cmTarget const* dependee,
                        bool linking);
   bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
   void AddInterfaceDepends(int depender_index,
                            cmLinkItem const& dependee_name,
                            std::set<std::string> &emitted);
-  void AddInterfaceDepends(int depender_index,
-                           cmGeneratorTarget const* dependee,
+  void AddInterfaceDepends(int depender_index, cmTarget const* dependee,
                            const std::string& config,
                            std::set<std::string> &emitted);
   cmGlobalGenerator* GlobalGenerator;
@@ -65,8 +63,8 @@ private:
   bool NoCycles;
 
   // Collect all targets.
-  std::vector<cmGeneratorTarget const*> Targets;
-  std::map<cmGeneratorTarget const*, int> TargetIndex;
+  std::vector<cmTarget const*> Targets;
+  std::map<cmTarget const*, int> TargetIndex;
 
   // Represent the target dependency graph.  The entry at each
   // top-level index corresponds to a depender whose dependencies are
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx 
b/Source/cmExtraCodeBlocksGenerator.cxx
index a31e832..e374387 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -313,7 +313,7 @@ void cmExtraCodeBlocksGenerator
         "      "<<virtualFolders<<"\n"
         "      <Build>\n";
 
-  this->AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str());
+  this->AppendTarget(fout, "all", 0, make.c_str(), mf, compiler.c_str());
 
   // add all executable and library targets and some of the GLOBAL
   // and UTILITY targets
@@ -335,7 +335,7 @@ void cmExtraCodeBlocksGenerator
                      makefile->GetHomeOutputDirectory())==0)
             {
             this->AppendTarget(fout, ti->first, 0,
-                               make.c_str(), *lg, compiler.c_str());
+                               make.c_str(), makefile, compiler.c_str());
             }
           }
           break;
@@ -351,7 +351,7 @@ void cmExtraCodeBlocksGenerator
             }
 
           this->AppendTarget(fout, ti->first, 0,
-                                 make.c_str(), *lg, compiler.c_str());
+                                 make.c_str(), makefile, compiler.c_str());
           break;
         case cmTarget::EXECUTABLE:
         case cmTarget::STATIC_LIBRARY:
@@ -360,11 +360,11 @@ void cmExtraCodeBlocksGenerator
         case cmTarget::OBJECT_LIBRARY:
           {
           this->AppendTarget(fout, ti->first, &ti->second,
-                             make.c_str(), *lg, compiler.c_str());
+                             make.c_str(), makefile, compiler.c_str());
           std::string fastTarget = ti->first;
           fastTarget += "/fast";
           this->AppendTarget(fout, fastTarget, &ti->second,
-                             make.c_str(), *lg, compiler.c_str());
+                             make.c_str(), makefile, compiler.c_str());
           }
           break;
         default:
@@ -519,16 +519,14 @@ void cmExtraCodeBlocksGenerator
 
 // Write a dummy file for OBJECT libraries, so C::B can reference some file
 std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
-                                        cmLocalGenerator* lg,
-                                        cmTarget* target) const
+                                        cmMakefile* mf, cmTarget* target) const
 {
-  cmMakefile *mf = lg->GetMakefile();
   // this file doesn't seem to be used by C::B in custom makefile mode,
   // but we generate a unique file for each OBJECT library so in case
   // C::B uses it in some way, the targets don't interfere with each other.
   std::string filename = mf->GetCurrentBinaryDirectory();
   filename += "/";
-  filename += lg->GetTargetDirectory(*target);
+  filename += mf->GetLocalGenerator()->GetTargetDirectory(*target);
   filename += "/";
   filename += target->GetName();
   filename += ".objlib";
@@ -549,10 +547,9 @@ void 
cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
                                               const std::string& targetName,
                                               cmTarget* target,
                                               const char* make,
-                                              const cmLocalGenerator* lg,
+                                              const cmMakefile* makefile,
                                               const char* compiler)
 {
-  cmMakefile const* makefile = lg->GetMakefile();
   std::string makefileName = makefile->GetCurrentBinaryDirectory();
   makefileName += "/Makefile";
 
@@ -586,7 +583,7 @@ void 
cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
     std::string location;
     if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
       {
-      location = this->CreateDummyTargetFile(const_cast<cmLocalGenerator*>(lg),
+      location = this->CreateDummyTargetFile(const_cast<cmMakefile*>(makefile),
                                              target);
       }
     else
@@ -621,7 +618,8 @@ void 
cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
     std::set<std::string> uniqIncludeDirs;
 
     std::vector<std::string> includes;
-    lg->GetIncludeDirectories(includes, gtgt, "C", buildType);
+    target->GetMakefile()->GetLocalGenerator()->
+      GetIncludeDirectories(includes, gtgt, "C", buildType);
 
     uniqIncludeDirs.insert(includes.begin(), includes.end());
 
diff --git a/Source/cmExtraCodeBlocksGenerator.h 
b/Source/cmExtraCodeBlocksGenerator.h
index e5ede9a..97da1b8 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -48,8 +48,7 @@ private:
 
   void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
                                 const std::string& filename);
-  std::string CreateDummyTargetFile(cmLocalGenerator* lg,
-                                    cmTarget* target) const;
+  std::string CreateDummyTargetFile(cmMakefile* mf, cmTarget* target) const;
 
   std::string GetCBCompilerId(const cmMakefile* mf);
   int GetCBTargetType(cmTarget* target);
@@ -59,7 +58,7 @@ private:
                     const std::string& targetName,
                     cmTarget* target,
                     const char* make,
-                    const cmLocalGenerator* lg,
+                    const cmMakefile* makefile,
                     const char* compiler);
 
 };
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 7aeb613..67d0d54 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -220,20 +220,14 @@ struct TagVisitor
 };
 
 //----------------------------------------------------------------------------
-cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
-  : Target(t),
+cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t),
   SourceFileFlagsConstructed(false)
 {
   this->Makefile = this->Target->GetMakefile();
-  this->LocalGenerator = lg;
+  this->LocalGenerator = this->Makefile->GetLocalGenerator();
   this->GlobalGenerator = this->Makefile->GetGlobalGenerator();
 }
 
-cmLocalGenerator* cmGeneratorTarget::GetLocalGenerator() const
-{
-  return this->LocalGenerator;
-}
-
 //----------------------------------------------------------------------------
 int cmGeneratorTarget::GetType() const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 675ee9f..a8edcb8 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -24,9 +24,7 @@ class cmTarget;
 class cmGeneratorTarget
 {
 public:
-  cmGeneratorTarget(cmTarget*, cmLocalGenerator* lg);
-
-  cmLocalGenerator* GetLocalGenerator() const;
+  cmGeneratorTarget(cmTarget*);
 
   int GetType() const;
   std::string GetName() const;
diff --git a/Source/cmGhsMultiTargetGenerator.cxx 
b/Source/cmGhsMultiTargetGenerator.cxx
index da371b1..01e2011 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -21,24 +21,23 @@
 
 std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
 
-cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target)
-  : Target(target->Target)
-  , GeneratorTarget(target)
+cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget *target)
+  : Target(target)
   , LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
-                     target->GetLocalGenerator()))
-  , Makefile(target->Target->GetMakefile())
-  , TargetGroup(DetermineIfTargetGroup(target->Target))
+                     target->GetMakefile()->GetLocalGenerator()))
+  , Makefile(target->GetMakefile())
+  , TargetGroup(DetermineIfTargetGroup(target))
   , DynamicDownload(false)
 {
-  this->RelBuildFilePath = this->GetRelBuildFilePath(target->Target);
+  this->RelBuildFilePath = this->GetRelBuildFilePath(target);
 
   this->RelOutputFileName =
     this->RelBuildFilePath + this->Target->GetName() + ".a";
 
   this->RelBuildFileName = this->RelBuildFilePath;
-  this->RelBuildFileName += this->GetBuildFileName(target->Target);
+  this->RelBuildFileName += this->GetBuildFileName(target);
 
-  std::string absPathToRoot = this->GetAbsPathToRoot(target->Target);
+  std::string absPathToRoot = this->GetAbsPathToRoot(target);
   absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
   this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
   this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
@@ -355,11 +354,11 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
 {
   // library directories
   cmTargetDependSet tds =
-    this->GetGlobalGenerator()->GetTargetDirectDepends(this->GeneratorTarget);
+    this->GetGlobalGenerator()->GetTargetDirectDepends(*this->Target);
   for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
        ++tdsI)
     {
-    const cmTarget *tg = (*tdsI)->Target;
+    const cmTarget *tg(*tdsI);
     *this->GetFolderBuildStreams() << "    -L\"" << GetAbsBuildFilePath(tg)
                                    << "\"" << std::endl;
     }
@@ -374,8 +373,7 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
     cmTarget *tg(GetGlobalGenerator()->FindTarget(libName));
     if (NULL != tg)
       {
-      cmGeneratorTarget* gt = GetGlobalGenerator()->GetGeneratorTarget(tg);
-      cmGhsMultiTargetGenerator gmtg(gt);
+      cmGhsMultiTargetGenerator gmtg(tg);
       libName = tg->GetName() + ".a";
       }
     *this->GetFolderBuildStreams() << "    -l\"" << libName << "\""
diff --git a/Source/cmGhsMultiTargetGenerator.h 
b/Source/cmGhsMultiTargetGenerator.h
index c29a31e..8e81db8 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -27,7 +27,7 @@ class cmCustomCommand;
 class cmGhsMultiTargetGenerator
 {
 public:
-  cmGhsMultiTargetGenerator(cmGeneratorTarget* target);
+  cmGhsMultiTargetGenerator(cmTarget *target);
 
   virtual ~cmGhsMultiTargetGenerator();
 
@@ -100,7 +100,6 @@ private:
                                   const std::string &language);
 
   cmTarget *Target;
-  cmGeneratorTarget* GeneratorTarget;
   cmLocalGhsMultiGenerator *LocalGenerator;
   cmMakefile *Makefile;
   std::string AbsBuildFilePath;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 83cf810..bd949bb 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1345,9 +1345,9 @@ bool cmGlobalGenerator::ComputeTargetDepends()
     {
     return false;
     }
-  std::vector<cmGeneratorTarget const*> const& targets = ctd.GetTargets();
-  for(std::vector<cmGeneratorTarget const*>::const_iterator ti
-      = targets.begin(); ti != targets.end(); ++ti)
+  std::vector<cmTarget const*> const& targets = ctd.GetTargets();
+  for(std::vector<cmTarget const*>::const_iterator ti = targets.begin();
+      ti != targets.end(); ++ti)
     {
     ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]);
     }
@@ -1451,16 +1451,15 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
+void cmGlobalGenerator::CreateGeneratorTargets(cmMakefile *mf)
 {
   cmGeneratorTargetsType generatorTargets;
-  cmMakefile* mf = lg->GetMakefile();
   cmTargets& targets = mf->GetTargets();
   for(cmTargets::iterator ti = targets.begin();
       ti != targets.end(); ++ti)
     {
     cmTarget* t = &ti->second;
-    cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
+    cmGeneratorTarget* gt = new cmGeneratorTarget(t);
     this->ComputeTargetObjectDirectory(gt);
     this->GeneratorTargets[t] = gt;
     generatorTargets[t] = gt;
@@ -1470,7 +1469,7 @@ void 
cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
         j = mf->GetOwnedImportedTargets().begin();
       j != mf->GetOwnedImportedTargets().end(); ++j)
     {
-    cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
+    cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
     this->GeneratorTargets[*j] = gt;
     generatorTargets[*j] = gt;
     }
@@ -1483,7 +1482,7 @@ void cmGlobalGenerator::CreateGeneratorTargets()
   // Construct per-target generator information.
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
-    this->CreateGeneratorTargets(this->LocalGenerators[i]);
+    this->CreateGeneratorTargets(this->LocalGenerators[i]->GetMakefile());
     }
 }
 
@@ -1955,10 +1954,10 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* 
root,
 }
 
 bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
-                                   cmGeneratorTarget* target) const
+                                   cmTarget const& target) const
 {
-  if(target->GetType() == cmTarget::INTERFACE_LIBRARY
-      || target->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+  if(target.GetType() == cmTarget::INTERFACE_LIBRARY
+      || target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
     {
     // This target is excluded from its directory.
     return true;
@@ -1967,7 +1966,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
     {
     // This target is included in its directory.  Check whether the
     // directory is excluded.
-    return this->IsExcluded(root, target->GetLocalGenerator());
+    return this->IsExcluded(root, target.GetMakefile()->GetLocalGenerator());
     }
 }
 
@@ -2028,26 +2027,25 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
       {
       cmTarget const& target = t->second;
 
-      cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
-
       // Consider the directory containing the target and all its
       // parents until something excludes the target.
-      for(cmLocalGenerator* clg = lg; clg && !this->IsExcluded(clg, gt);
+      for(cmLocalGenerator* clg = lg; clg && !this->IsExcluded(clg, target);
           clg = clg->GetParent())
         {
         // This local generator includes the target.
-        std::set<cmGeneratorTarget const*>& targetSet =
+        std::set<cmTarget const*>& targetSet =
           this->LocalGeneratorToTargetMap[clg];
-        targetSet.insert(gt);
+        targetSet.insert(&target);
 
         // Add dependencies of the included target.  An excluded
         // target may still be included if it is a dependency of a
         // non-excluded target.
-        TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(gt);
+        TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target);
         for(TargetDependSet::const_iterator ti = tgtdeps.begin();
             ti != tgtdeps.end(); ++ti)
           {
-          targetSet.insert(*ti);
+          cmTarget const* ttt = *ti;
+          targetSet.insert(ttt);
           }
         }
       }
@@ -2509,9 +2507,9 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const 
std::string&,
 
 //----------------------------------------------------------------------------
 cmGlobalGenerator::TargetDependSet const&
-cmGlobalGenerator::GetTargetDirectDepends(cmGeneratorTarget const* target)
+cmGlobalGenerator::GetTargetDirectDepends(cmTarget const& target)
 {
-  return this->TargetDependencies[target];
+  return this->TargetDependencies[&target];
 }
 
 void cmGlobalGenerator::AddTarget(cmTarget* t)
@@ -2611,10 +2609,9 @@ void cmGlobalGenerator::GetTargetSets(TargetDependSet& 
projectTargets,
         continue;
         }
       // put the target in the set of original targets
-      cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
-      originalTargets.insert(gt);
+      originalTargets.insert(target);
       // Get the set of targets that depend on target
-      this->AddTargetDepends(gt, projectTargets);
+      this->AddTargetDepends(target, projectTargets);
       }
     }
 }
@@ -2627,7 +2624,7 @@ bool cmGlobalGenerator::IsRootOnlyTarget(cmTarget* 
target) const
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::AddTargetDepends(cmGeneratorTarget const* target,
+void cmGlobalGenerator::AddTargetDepends(cmTarget const* target,
                                          TargetDependSet& projectTargets)
 {
   // add the target itself
@@ -2635,10 +2632,11 @@ void 
cmGlobalGenerator::AddTargetDepends(cmGeneratorTarget const* target,
     {
     // This is the first time we have encountered the target.
     // Recursively follow its dependencies.
-    TargetDependSet const& ts = this->GetTargetDirectDepends(target);
+    TargetDependSet const& ts = this->GetTargetDirectDepends(*target);
     for(TargetDependSet::const_iterator i = ts.begin(); i != ts.end(); ++i)
       {
-      this->AddTargetDepends(*i, projectTargets);
+      cmTarget const* dtarget = *i;
+      this->AddTargetDepends(dtarget, projectTargets);
       }
     }
 }
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 3d5c8aa..f02df90 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -292,8 +292,7 @@ public:
 
   // what targets does the specified target depend on directly
   // via a target_link_libraries or add_dependencies
-  TargetDependSet const& GetTargetDirectDepends(
-      const cmGeneratorTarget* target);
+  TargetDependSet const& GetTargetDirectDepends(cmTarget const& target);
 
   /** Get per-target generator information.  */
   cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const;
@@ -369,7 +368,7 @@ protected:
                              TargetDependSet& originalTargets,
                              cmLocalGenerator* root, GeneratorVector const&);
   bool IsRootOnlyTarget(cmTarget* target) const;
-  void AddTargetDepends(const cmGeneratorTarget* target,
+  void AddTargetDepends(cmTarget const* target,
                         TargetDependSet& projectTargets);
   void SetLanguageEnabledFlag(const std::string& l, cmMakefile* mf);
   void SetLanguageEnabledMaps(const std::string& l, cmMakefile* mf);
@@ -391,7 +390,7 @@ protected:
   void FillProjectMap();
   void CheckLocalGenerators();
   bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
-  bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
+  bool IsExcluded(cmLocalGenerator* root, cmTarget const& target) const;
   void FillLocalGeneratorToTargetMap();
   void CreateDefaultGlobalTargets(cmTargets* targets);
   cmTarget CreateGlobalTarget(const std::string& name, const char* message,
@@ -406,7 +405,7 @@ protected:
   cmMakefile* CurrentMakefile;
   // map from project name to vector of local generators in that project
   std::map<std::string, std::vector<cmLocalGenerator*> > ProjectMap;
-  std::map<cmLocalGenerator*, std::set<cmGeneratorTarget const*> >
+  std::map<cmLocalGenerator*, std::set<cmTarget const*> >
                                                     LocalGeneratorToTargetMap;
 
   // Set of named installation components requested by the project.
@@ -478,13 +477,13 @@ private:
   std::vector<std::string> FilesReplacedDuringGenerate;
 
   // Store computed inter-target dependencies.
-  typedef std::map<cmGeneratorTarget const*, TargetDependSet> TargetDependMap;
+  typedef std::map<cmTarget const*, TargetDependSet> TargetDependMap;
   TargetDependMap TargetDependencies;
 
   // Per-target generator information.
   cmGeneratorTargetsType GeneratorTargets;
   friend class cmake;
-  void CreateGeneratorTargets(cmLocalGenerator* lg);
+  void CreateGeneratorTargets(cmMakefile* mf);
   void CreateGeneratorTargets();
 
   void ClearGeneratorMembers();
diff --git a/Source/cmGlobalNinjaGenerator.cxx 
b/Source/cmGlobalNinjaGenerator.cxx
index 722294b..103d75a 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -949,8 +949,8 @@ cmGlobalNinjaGenerator
     std::set<std::string> const& utils = target->GetUtilities();
     std::copy(utils.begin(), utils.end(), std::back_inserter(outputs));
   } else {
-    cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
-    cmTargetDependSet const& targetDeps = this->GetTargetDirectDepends(gt);
+    cmTargetDependSet const& targetDeps =
+      this->GetTargetDirectDepends(*target);
     for (cmTargetDependSet::const_iterator i = targetDeps.begin();
          i != targetDeps.end(); ++i)
       {
@@ -958,7 +958,7 @@ cmGlobalNinjaGenerator
         {
         continue;
         }
-      this->AppendTargetOutputs((*i)->Target, outputs);
+      this->AppendTargetOutputs(*i, outputs);
     }
   }
 }
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 0d3177c..ffd1cdc 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -289,7 +289,7 @@ public:
   const std::vector<cmLocalGenerator*>& GetLocalGenerators() const {
     return LocalGenerators; }
 
-  bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) {
+  bool IsExcluded(cmLocalGenerator* root, cmTarget& target) {
     return cmGlobalGenerator::IsExcluded(root, target); }
 
   int GetRuleCmdLength(const std::string& name) {
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx 
b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 980b6cd..4fe52dd 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -529,7 +529,7 @@ cmGlobalUnixMakefileGenerator3
                        cmLocalUnixMakefileGenerator3* lg)
 {
   // Only subdirectories need these rules.
-  if(lg->GetMakefile()->IsRootMakefile())
+  if(lg->IsRootMakefile())
     {
     return;
     }
@@ -804,12 +804,12 @@ cmGlobalUnixMakefileGenerator3
       lg->AppendEcho(commands, "Built target " + name,
         cmLocalUnixMakefileGenerator3::EchoNormal, &progress);
 
-      this->AppendGlobalTargetDepends(depends, gtarget);
+      this->AppendGlobalTargetDepends(depends,*gtarget->Target);
       lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
                         localName, depends, commands, true);
 
       // add the all/all dependency
-      if(!this->IsExcluded(this->LocalGenerators[0], gtarget))
+      if(!this->IsExcluded(this->LocalGenerators[0], *gtarget->Target))
         {
         depends.clear();
         depends.push_back(localName);
@@ -830,9 +830,9 @@ cmGlobalUnixMakefileGenerator3
                               cmLocalGenerator::FULL,
                               cmLocalGenerator::SHELL);
       //
-      std::set<cmGeneratorTarget const*> emitted;
+      std::set<cmTarget const*> emitted;
       progCmd << " "
-              << this->CountProgressMarksInTarget(gtarget, emitted);
+              << this->CountProgressMarksInTarget(gtarget->Target, emitted);
       commands.push_back(progCmd.str());
       }
       std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
@@ -877,7 +877,7 @@ cmGlobalUnixMakefileGenerator3
                           "Pre-install relink rule for target.",
                           localName, depends, commands, true);
 
-        if(!this->IsExcluded(this->LocalGenerators[0], gtarget))
+        if(!this->IsExcluded(this->LocalGenerators[0], *gtarget->Target))
           {
           depends.clear();
           depends.push_back(localName);
@@ -908,14 +908,14 @@ cmGlobalUnixMakefileGenerator3
 //----------------------------------------------------------------------------
 size_t
 cmGlobalUnixMakefileGenerator3
-::CountProgressMarksInTarget(cmGeneratorTarget const* target,
-                             std::set<cmGeneratorTarget const*>& emitted)
+::CountProgressMarksInTarget(cmTarget const* target,
+                             std::set<cmTarget const*>& emitted)
 {
   size_t count = 0;
   if(emitted.insert(target).second)
     {
-    count = this->ProgressMap[target->Target].Marks.size();
-    TargetDependSet const& depends = this->GetTargetDirectDepends(target);
+    count = this->ProgressMap[target].Marks.size();
+    TargetDependSet const& depends = this->GetTargetDirectDepends(*target);
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
       {
@@ -935,10 +935,10 @@ cmGlobalUnixMakefileGenerator3
 ::CountProgressMarksInAll(cmLocalUnixMakefileGenerator3* lg)
 {
   size_t count = 0;
-  std::set<cmGeneratorTarget const*> emitted;
-  std::set<cmGeneratorTarget const*> const& targets
+  std::set<cmTarget const*> emitted;
+  std::set<cmTarget const*> const& targets
                                         = this->LocalGeneratorToTargetMap[lg];
-  for(std::set<cmGeneratorTarget const*>::const_iterator t = targets.begin();
+  for(std::set<cmTarget const*>::const_iterator t = targets.begin();
       t != targets.end(); ++t)
     {
     count += this->CountProgressMarksInTarget(*t, emitted);
@@ -987,21 +987,22 @@ cmGlobalUnixMakefileGenerator3::TargetProgress
 void
 cmGlobalUnixMakefileGenerator3
 ::AppendGlobalTargetDepends(std::vector<std::string>& depends,
-                            cmGeneratorTarget* target)
+                            cmTarget& target)
 {
   TargetDependSet const& depends_set = this->GetTargetDirectDepends(target);
   for(TargetDependSet::const_iterator i = depends_set.begin();
       i != depends_set.end(); ++i)
     {
     // Create the target-level dependency.
-    cmGeneratorTarget const* dep = *i;
+    cmTarget const* dep = *i;
     if (dep->GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
       }
     cmLocalUnixMakefileGenerator3* lg3 =
-      static_cast<cmLocalUnixMakefileGenerator3*>(dep->GetLocalGenerator());
-    std::string tgtName = lg3->GetRelativeTargetDirectory(*(*dep).Target);
+      static_cast<cmLocalUnixMakefileGenerator3*>
+      (dep->GetMakefile()->GetLocalGenerator());
+    std::string tgtName = lg3->GetRelativeTargetDirectory(*dep);
     tgtName += "/all";
     depends.push_back(tgtName);
     }
@@ -1033,7 +1034,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
       static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
     // for the passed in makefile or if this is the top Makefile wripte out
     // the targets
-    if (lg2 == lg || lg->GetMakefile()->IsRootMakefile())
+    if (lg2 == lg || lg->IsRootMakefile())
       {
       // for each target Generate the rule files for each target.
       cmTargets& targets = lg2->GetMakefile()->GetTargets();
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h 
b/Source/cmGlobalUnixMakefileGenerator3.h
index 14adf2e..a639ff0 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -153,7 +153,7 @@ protected:
                             cmLocalUnixMakefileGenerator3* lg);
 
   void AppendGlobalTargetDepends(std::vector<std::string>& depends,
-                                 cmGeneratorTarget* target);
+                                 cmTarget& target);
 
   // does this generator need a requires step for any of its targets
   bool NeedRequiresStep(cmTarget const&);
@@ -198,8 +198,8 @@ protected:
                    cmStrictTargetComparison> ProgressMapType;
   ProgressMapType ProgressMap;
 
-  size_t CountProgressMarksInTarget(cmGeneratorTarget const* target,
-                                 std::set<cmGeneratorTarget const*>& emitted);
+  size_t CountProgressMarksInTarget(cmTarget const* target,
+                                    std::set<cmTarget const*>& emitted);
   size_t CountProgressMarksInAll(cmLocalUnixMakefileGenerator3* lg);
 
   cmGeneratedFileStream *CommandDatabase;
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx 
b/Source/cmGlobalVisualStudio6Generator.cxx
index 65a15ee..632141a 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -224,7 +224,7 @@ void cmGlobalVisualStudio6Generator
         tt = orderedProjectTargets.begin();
       tt != orderedProjectTargets.end(); ++tt)
     {
-    cmTarget const* target = (*tt)->Target;
+    cmTarget const* target = *tt;
     if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx 
b/Source/cmGlobalVisualStudio7Generator.cxx
index 1674e98..f453da1 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -402,7 +402,7 @@ void 
cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
   for(OrderedTargetDependSet::const_iterator tt =
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
-    cmTarget const* target = (*tt)->Target;
+    cmTarget const* target = *tt;
     if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
@@ -442,7 +442,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
   for(OrderedTargetDependSet::const_iterator tt =
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
-    cmTarget const* target = (*tt)->Target;
+    cmTarget const* target = *tt;
     if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
@@ -534,7 +534,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
   for(OrderedTargetDependSet::const_iterator tt =
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
-    cmTarget const* target = (*tt)->Target;
+    cmTarget const* target = *tt;
     if(target->GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
@@ -1045,12 +1045,12 @@ cmGlobalVisualStudio7Generator
 ::IsDependedOn(OrderedTargetDependSet const& projectTargets,
                cmTarget const* targetIn)
 {
-  cmGeneratorTarget* gtIn = this->GetGeneratorTarget(targetIn);
   for (OrderedTargetDependSet::const_iterator l = projectTargets.begin();
        l != projectTargets.end(); ++l)
     {
-    TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(*l);
-    if(tgtdeps.count(gtIn))
+    cmTarget const& target = **l;
+    TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target);
+    if(tgtdeps.count(targetIn))
       {
       return true;
       }
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx 
b/Source/cmGlobalVisualStudio8Generator.cxx
index f3cf36e..b96a799 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -441,8 +441,7 @@ bool cmGlobalVisualStudio8Generator::ComputeTargetDepends()
 void cmGlobalVisualStudio8Generator::WriteProjectDepends(
   std::ostream& fout, const std::string&, const char*, cmTarget const& t)
 {
-  cmGeneratorTarget* gt = this->GetGeneratorTarget(&t);
-  TargetDependSet const& unordered = this->GetTargetDirectDepends(gt);
+  TargetDependSet const& unordered = this->GetTargetDirectDepends(t);
   OrderedTargetDependSet depends(unordered);
   for(OrderedTargetDependSet::const_iterator i = depends.begin();
       i != depends.end(); ++i)
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx 
b/Source/cmGlobalVisualStudioGenerator.cxx
index bdf2b8d..585d19a 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -106,8 +106,7 @@ void cmGlobalVisualStudioGenerator::Generate()
         for(cmTargets::iterator t = targets.begin();
             t != targets.end(); ++t)
           {
-          cmGeneratorTarget* gt = this->GetGeneratorTarget(&t->second);
-          if(!this->IsExcluded(gen[0], gt))
+          if(!this->IsExcluded(gen[0], t->second))
             {
             allBuild->AddUtility(t->second.GetName());
             }
@@ -300,14 +299,13 @@ void 
cmGlobalVisualStudioGenerator::FillLinkClosure(cmTarget const* target,
 {
   if(linked.insert(target).second)
     {
-    cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
-    TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
+    TargetDependSet const& depends = this->GetTargetDirectDepends(*target);
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
       {
       if(di->IsLink())
         {
-        this->FillLinkClosure((*di)->Target, linked);
+        this->FillLinkClosure(*di, linked);
         }
       }
     }
@@ -340,14 +338,13 @@ void cmGlobalVisualStudioGenerator::FollowLinkDepends(
     {
     // Static library targets do not list their link dependencies so
     // we must follow them transitively now.
-    cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
-    TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
+    TargetDependSet const& depends = this->GetTargetDirectDepends(*target);
     for(TargetDependSet::const_iterator di = depends.begin();
         di != depends.end(); ++di)
       {
       if(di->IsLink())
         {
-        this->FollowLinkDepends((*di)->Target, linked);
+        this->FollowLinkDepends(*di, linked);
         }
       }
     }
@@ -416,8 +413,7 @@ void 
cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
                         target.GetType() != cmTarget::MODULE_LIBRARY &&
                         target.GetType() != cmTarget::EXECUTABLE);
 
-  cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
-  TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
+  TargetDependSet const& depends = this->GetTargetDirectDepends(target);
 
   // Collect implicit link dependencies (target_link_libraries).
   // Static libraries cannot depend on their link implementation
@@ -431,7 +427,7 @@ void 
cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
       cmTargetDepend dep = *di;
       if(dep.IsLink())
         {
-        this->FollowLinkDepends(dep->Target, linkDepends);
+        this->FollowLinkDepends(dep, linkDepends);
         }
       }
     }
@@ -444,7 +440,7 @@ void 
cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
     cmTargetDepend dep = *di;
     if(dep.IsUtil())
       {
-      this->FollowLinkDepends(dep->Target, utilDepends);
+      this->FollowLinkDepends(dep, utilDepends);
       }
     }
 
@@ -847,7 +843,7 @@ cmGlobalVisualStudioGenerator::TargetIsFortranOnly(cmTarget 
const& target)
 //----------------------------------------------------------------------------
 bool
 cmGlobalVisualStudioGenerator::TargetCompare
-::operator()(cmGeneratorTarget const* l, cmGeneratorTarget const* r) const
+::operator()(cmTarget const* l, cmTarget const* r) const
 {
   // Make sure ALL_BUILD is first so it is the default active project.
   if(r->GetName() == "ALL_BUILD")
@@ -872,13 +868,7 @@ cmGlobalVisualStudioGenerator::OrderedTargetDependSet
 cmGlobalVisualStudioGenerator::OrderedTargetDependSet
 ::OrderedTargetDependSet(TargetSet const& targets)
 {
-  for (TargetSet::const_iterator it = targets.begin();
-       it != targets.end(); ++it)
-    {
-    cmGeneratorTarget* gt =
-        (*it)->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(*it);
-    this->insert(gt);
-    }
+  this->insert(targets.begin(), targets.end());
 }
 
 std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir(
diff --git a/Source/cmGlobalVisualStudioGenerator.h 
b/Source/cmGlobalVisualStudioGenerator.h
index 41843b3..69b4564 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -91,8 +91,7 @@ public:
   class TargetSet: public std::set<cmTarget const*> {};
   struct TargetCompare
   {
-    bool operator()(cmGeneratorTarget const* l,
-                    cmGeneratorTarget const* r) const;
+    bool operator()(cmTarget const* l, cmTarget const* r) const;
   };
   class OrderedTargetDependSet;
 
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2587764..5ed53d0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -68,6 +68,11 @@ cmLocalGenerator::~cmLocalGenerator()
   delete this->Makefile;
 }
 
+bool cmLocalGenerator::IsRootMakefile() const
+{
+  return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
+}
+
 //----------------------------------------------------------------------------
 void cmLocalGenerator::ComputeObjectMaxPath()
 {
@@ -1330,7 +1335,7 @@ void 
cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
                                              const std::string& lang,
                                              const std::string& config,
                                              bool stripImplicitInclDirs
-                                            ) const
+                                            )
 {
   // Need to decide whether to automatically include the source and
   // binary directories at the beginning of the include path.
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 9b1dfaf..efdd487 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -39,6 +39,9 @@ public:
                    cmState::Snapshot snapshot);
   virtual ~cmLocalGenerator();
 
+  /// @return whether we are processing the top CMakeLists.txt file.
+  bool IsRootMakefile() const;
+
   /**
    * Generate the makefile for this directory.
    */
@@ -185,7 +188,7 @@ public:
                              cmGeneratorTarget* target,
                              const std::string& lang = "C",
                              const std::string& config = "",
-                             bool stripImplicitInclDirs = true) const;
+                             bool stripImplicitInclDirs = true);
   void AddCompileOptions(std::string& flags, cmTarget* target,
                          const std::string& lang, const std::string& config);
   void AddCompileDefinitions(std::set<std::string>& defines,
diff --git a/Source/cmLocalGhsMultiGenerator.cxx 
b/Source/cmLocalGhsMultiGenerator.cxx
index 8e498dd..870b9b9 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -37,7 +37,7 @@ void cmLocalGhsMultiGenerator::Generate()
       {
       continue;
       }
-    cmGhsMultiTargetGenerator tg(l->second);
+    cmGhsMultiTargetGenerator tg(l->second->Target);
     tg.Generate();
     }
 }
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index aac85f9..427ae10 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -58,7 +58,7 @@ void cmLocalNinjaGenerator::Generate()
 #endif
 
   // We do that only once for the top CMakeLists.txt file.
-  if(this->Makefile->IsRootMakefile())
+  if(this->IsRootMakefile())
     {
     this->WriteBuildFileTop();
 
@@ -91,7 +91,7 @@ void cmLocalNinjaGenerator::Generate()
       // Add the target to "all" if required.
       if (!this->GetGlobalNinjaGenerator()->IsExcluded(
             this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0],
-            t->second))
+            *t->second->Target))
         this->GetGlobalNinjaGenerator()->AddDependencyToAll(t->second->Target);
       delete tg;
       }
@@ -298,7 +298,7 @@ void 
cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os)
     << "# Write statements declared in CMakeLists.txt:" << std::endl
     << "# "
     << this->Makefile->GetDefinition("CMAKE_CURRENT_LIST_FILE") << std::endl;
-  if(this->Makefile->IsRootMakefile())
+  if(this->IsRootMakefile())
     os << "# Which is the root file." << std::endl;
   cmGlobalNinjaGenerator::WriteDivider(os);
   os << std::endl;
diff --git a/Source/cmLocalUnixMakefileGenerator3.h 
b/Source/cmLocalUnixMakefileGenerator3.h
index 78fe19d..dcb3016 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -147,6 +147,9 @@ public:
   void AddImplicitDepends(cmTarget const& tgt, const std::string& lang,
                           const char* obj, const char* src);
 
+  void AppendGlobalTargetDepends(std::vector<std::string>& depends,
+                                 cmTarget& target);
+
   // write the target rules for the local Makefile into the stream
   void WriteLocalAllRules(std::ostream& ruleFileStream);
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bc9f9d6..a8b163a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -105,7 +105,7 @@ public:
     ++it;
     if(it == this->VarStack.rend())
       {
-      cmLocalGenerator* plg = mf->LocalGenerator->GetParent();
+      cmLocalGenerator* plg = mf->GetLocalGenerator()->GetParent();
       if(!plg)
         {
         return false;
@@ -1608,11 +1608,6 @@ void cmMakefile::PopMacroScope(bool reportError)
   this->PopFunctionBlockerBarrier(reportError);
 }
 
-bool cmMakefile::IsRootMakefile() const
-{
-  return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
-}
-
 //----------------------------------------------------------------------------
 class cmMakefileCurrent
 {
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index c031ee8..6f6ed27 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -79,9 +79,6 @@ public:
    */
   ~cmMakefile();
 
-  /// @return whether we are processing the top CMakeLists.txt file.
-  bool IsRootMakefile() const;
-
   bool ReadListFile(const char* listfile);
 
   bool ReadDependentFile(const char* listfile, bool noPolicyScope = true);
@@ -134,6 +131,10 @@ public:
 
   bool GetIsSourceFileTryCompile() const;
 
+  ///! Get the current makefile generator.
+  cmLocalGenerator* GetLocalGenerator() const
+    { return this->LocalGenerator;}
+
   /**
    * Help enforce global target name uniqueness.
    */
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx 
b/Source/cmMakefileExecutableTargetGenerator.cxx
index 416063f..37b297e 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -22,7 +22,7 @@
 //----------------------------------------------------------------------------
 cmMakefileExecutableTargetGenerator
 ::cmMakefileExecutableTargetGenerator(cmGeneratorTarget* target):
-  cmMakefileTargetGenerator(target)
+  cmMakefileTargetGenerator(target->Target)
 {
   this->CustomCommandDriver = OnDepends;
   this->Target->GetExecutableNames(
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx 
b/Source/cmMakefileLibraryTargetGenerator.cxx
index 660027c..450f573 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -22,7 +22,7 @@
 //----------------------------------------------------------------------------
 cmMakefileLibraryTargetGenerator
 ::cmMakefileLibraryTargetGenerator(cmGeneratorTarget* target):
-  cmMakefileTargetGenerator(target)
+  cmMakefileTargetGenerator(target->Target)
 {
   this->CustomCommandDriver = OnDepends;
   if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
diff --git a/Source/cmMakefileTargetGenerator.cxx 
b/Source/cmMakefileTargetGenerator.cxx
index dd60a1f..923aa7b 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -32,7 +32,7 @@
 
 #include <ctype.h>
 
-cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
+cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
   : OSXBundleGenerator(0)
   , MacOSXContentGenerator(0)
 {
@@ -41,15 +41,16 @@ 
cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
   this->FlagFileStream = 0;
   this->CustomCommandDriver = OnBuild;
   this->FortranModuleDirectoryComputed = false;
-  this->Target = target->Target;
+  this->Target = target;
   this->Makefile = this->Target->GetMakefile();
   this->LocalGenerator =
-    static_cast<cmLocalUnixMakefileGenerator3*>(target->GetLocalGenerator());
+    static_cast<cmLocalUnixMakefileGenerator3*>(
+      this->Makefile->GetLocalGenerator());
   this->ConfigName = this->LocalGenerator->ConfigurationName.c_str();
   this->GlobalGenerator =
     static_cast<cmGlobalUnixMakefileGenerator3*>(
       this->LocalGenerator->GetGlobalGenerator());
-  this->GeneratorTarget = target;
+  this->GeneratorTarget = this->GlobalGenerator->GetGeneratorTarget(target);
   cmake* cm = this->GlobalGenerator->GetCMakeInstance();
   this->NoRuleMessages = false;
   if(const char* ruleStatus = cm->GetState()
@@ -1154,10 +1155,8 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
                 && linkee->GetType() != cmTarget::INTERFACE_LIBRARY
                 && emitted.insert(linkee).second)
         {
-        cmGeneratorTarget* gt =
-            this->GlobalGenerator->GetGeneratorTarget(linkee);
-        cmLocalGenerator* lg = gt->GetLocalGenerator();
         cmMakefile* mf = linkee->GetMakefile();
+        cmLocalGenerator* lg = mf->GetLocalGenerator();
         std::string di = mf->GetCurrentBinaryDirectory();
         di += "/";
         di += lg->GetTargetDirectory(*linkee);
diff --git a/Source/cmMakefileTargetGenerator.h 
b/Source/cmMakefileTargetGenerator.h
index 9182236..2e1b052 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -34,7 +34,7 @@ class cmMakefileTargetGenerator
 {
 public:
   // constructor to set the ivars
-  cmMakefileTargetGenerator(cmGeneratorTarget* target);
+  cmMakefileTargetGenerator(cmTarget* target);
   virtual ~cmMakefileTargetGenerator();
 
   // construct using this factory call
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx 
b/Source/cmMakefileUtilityTargetGenerator.cxx
index 303ca63..25d929c 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -21,7 +21,7 @@
 //----------------------------------------------------------------------------
 cmMakefileUtilityTargetGenerator
 ::cmMakefileUtilityTargetGenerator(cmGeneratorTarget* target):
-  cmMakefileTargetGenerator(target)
+  cmMakefileTargetGenerator(target->Target)
 {
   this->CustomCommandDriver = OnUtility;
   this->OSXBundleGenerator = new cmOSXBundleGenerator(target,
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx 
b/Source/cmNinjaNormalTargetGenerator.cxx
index 2fe53bf..bbf03ff 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -32,7 +32,7 @@
 
 cmNinjaNormalTargetGenerator::
 cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
-  : cmNinjaTargetGenerator(target)
+  : cmNinjaTargetGenerator(target->Target)
   , TargetNameOut()
   , TargetNameSO()
   , TargetNameReal()
diff --git a/Source/cmNinjaTargetGenerator.cxx 
b/Source/cmNinjaTargetGenerator.cxx
index fcf4a62..b2aef68 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -56,18 +56,19 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
     }
 }
 
-cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
+cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmTarget* target)
   :
     MacOSXContentGenerator(0),
     OSXBundleGenerator(0),
     MacContentFolders(),
-    Target(target->Target),
-    Makefile(target->Makefile),
+    Target(target),
+    Makefile(target->GetMakefile()),
     LocalGenerator(
-      static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator())),
+      static_cast<cmLocalNinjaGenerator*>(Makefile->GetLocalGenerator())),
     Objects()
 {
-  this->GeneratorTarget = target;
+  this->GeneratorTarget =
+    this->GetGlobalGenerator()->GetGeneratorTarget(target);
   MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
 }
 
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index fc361b2..4e7d8b3 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -33,7 +33,7 @@ public:
   static cmNinjaTargetGenerator* New(cmGeneratorTarget* target);
 
   /// Build a NinjaTargetGenerator.
-  cmNinjaTargetGenerator(cmGeneratorTarget* target);
+  cmNinjaTargetGenerator(cmTarget* target);
 
   /// Destructor.
   virtual ~cmNinjaTargetGenerator();
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx 
b/Source/cmNinjaUtilityTargetGenerator.cxx
index c3bf011..42d6b46 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -21,7 +21,7 @@
 
 cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
     cmGeneratorTarget *target)
-  : cmNinjaTargetGenerator(target) {}
+  : cmNinjaTargetGenerator(target->Target) {}
 
 cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator() {}
 
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 3bc0eb7..a8eef82 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -22,7 +22,7 @@ cmOSXBundleGenerator(cmGeneratorTarget* target,
                      const std::string& configName)
  : GT(target)
  , Makefile(target->Target->GetMakefile())
- , LocalGenerator(target->GetLocalGenerator())
+ , LocalGenerator(Makefile->GetLocalGenerator())
  , ConfigName(configName)
  , MacContentFolders(0)
 {
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 2e17a7d..176cb0d 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -53,7 +53,7 @@ bool cmProjectCommand
   // CMAKE_PROJECT_NAME will match PROJECT_NAME, and cmake --build
   // will work.
   if(!this->Makefile->GetDefinition("CMAKE_PROJECT_NAME")
-     || (this->Makefile->IsRootMakefile()))
+     || (this->Makefile->GetLocalGenerator()->IsRootMakefile()))
     {
     this->Makefile->AddDefinition("CMAKE_PROJECT_NAME", args[0].c_str());
     this->Makefile->AddCacheDefinition
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 3d6ef57..ef32c75 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -368,7 +368,8 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* 
target)
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
   bool usePRE_BUILD = false;
-  cmGlobalGenerator* gg = makefile->GetGlobalGenerator();
+  cmLocalGenerator* localGen = makefile->GetLocalGenerator();
+  cmGlobalGenerator* gg = localGen->GetGlobalGenerator();
   if(gg->GetName().find("Visual Studio") != std::string::npos)
     {
     cmGlobalVisualStudioGenerator* vsgg =
@@ -521,10 +522,10 @@ static void GetCompileDefinitionsAndDirectories(cmTarget 
const* target,
                                                 std::string &defs)
 {
   cmMakefile* makefile = target->GetMakefile();
-  cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator();
+  cmLocalGenerator* localGen = makefile->GetLocalGenerator();
   std::vector<std::string> includeDirs;
-  cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target);
-  cmLocalGenerator *localGen = gtgt->GetLocalGenerator();
+  cmGeneratorTarget *gtgt = localGen->GetGlobalGenerator()
+                                    ->GetGeneratorTarget(target);
   // Get the include dirs for this target, without stripping the implicit
   // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
   localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false);
diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h
index c5059ee..1feb072 100644
--- a/Source/cmTargetDepend.h
+++ b/Source/cmTargetDepend.h
@@ -14,24 +14,23 @@
 
 #include "cmStandardIncludes.h"
 
-class cmGeneratorTarget;
+class cmTarget;
 
 /** One edge in the global target dependency graph.
     It may be marked as a 'link' or 'util' edge or both.  */
 class cmTargetDepend
 {
-  cmGeneratorTarget const* Target;
+  cmTarget const* Target;
 
   // The set order depends only on the Target, so we use
   // mutable members to acheive a map with set syntax.
   mutable bool Link;
   mutable bool Util;
 public:
-  cmTargetDepend(cmGeneratorTarget const* t)
-    : Target(t), Link(false), Util(false) {}
-  operator cmGeneratorTarget const*() const { return this->Target; }
-  cmGeneratorTarget const* operator->() const { return this->Target; }
-  cmGeneratorTarget const& operator*() const { return *this->Target; }
+  cmTargetDepend(cmTarget const* t): Target(t), Link(false), Util(false) {}
+  operator cmTarget const*() const { return this->Target; }
+  cmTarget const* operator->() const { return this->Target; }
+  cmTarget const& operator*() const { return *this->Target; }
   friend bool operator < (cmTargetDepend const& l, cmTargetDepend const& r)
     { return l.Target < r.Target; }
   void SetType(bool strong) const
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx 
b/Source/cmVisualStudio10TargetGenerator.cxx
index 591c2db..9b78df3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -176,7 +176,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
   this->Makefile->GetConfigurations(this->Configurations);
   this->LocalGenerator =
     (cmLocalVisualStudio7Generator*)
-    this->GeneratorTarget->GetLocalGenerator();
+    this->Makefile->GetLocalGenerator();
   this->Name = this->Target->GetName();
   this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
   this->Platform = gg->GetPlatformName();
@@ -2660,7 +2660,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
 void cmVisualStudio10TargetGenerator::WriteProjectReferences()
 {
   cmGlobalGenerator::TargetDependSet const& unordered
-    = this->GlobalGenerator->GetTargetDirectDepends(this->GeneratorTarget);
+    = this->GlobalGenerator->GetTargetDirectDepends(*this->Target);
   typedef cmGlobalVisualStudioGenerator::OrderedTargetDependSet
     OrderedTargetDependSet;
   OrderedTargetDependSet depends(unordered);
@@ -2668,7 +2668,7 @@ void 
cmVisualStudio10TargetGenerator::WriteProjectReferences()
   for( OrderedTargetDependSet::const_iterator i = depends.begin();
        i != depends.end(); ++i)
     {
-    cmTarget const* dt = (*i)->Target;
+    cmTarget const* dt = *i;
     if(dt->GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 6ff388d..eeb6575 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -482,7 +482,7 @@ bool cmake::FindPackage(const std::vector<std::string>& 
args)
     std::string linkPath;
     std::string flags;
     std::string linkFlags;
-    gg->CreateGeneratorTargets(lg.get());
+    gg->CreateGeneratorTargets(mf);
     cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
     lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
                        gtgt, false);

-----------------------------------------------------------------------

Summary of changes:
 Source/cmComputeTargetDepends.cxx              |   81 +++++++++++-------------
 Source/cmComputeTargetDepends.h                |   16 ++---
 Source/cmExtraCodeBlocksGenerator.cxx          |   24 ++++---
 Source/cmExtraCodeBlocksGenerator.h            |    5 +-
 Source/cmGeneratorTarget.cxx                   |   10 +--
 Source/cmGeneratorTarget.h                     |    4 +-
 Source/cmGhsMultiTargetGenerator.cxx           |   24 ++++---
 Source/cmGhsMultiTargetGenerator.h             |    3 +-
 Source/cmGlobalGenerator.cxx                   |   52 ++++++++-------
 Source/cmGlobalGenerator.h                     |   13 ++--
 Source/cmGlobalNinjaGenerator.cxx              |    6 +-
 Source/cmGlobalNinjaGenerator.h                |    2 +-
 Source/cmGlobalUnixMakefileGenerator3.cxx      |   37 +++++------
 Source/cmGlobalUnixMakefileGenerator3.h        |    6 +-
 Source/cmGlobalVisualStudio6Generator.cxx      |    2 +-
 Source/cmGlobalVisualStudio7Generator.cxx      |   12 ++--
 Source/cmGlobalVisualStudio8Generator.cxx      |    3 +-
 Source/cmGlobalVisualStudioGenerator.cxx       |   30 +++------
 Source/cmGlobalVisualStudioGenerator.h         |    3 +-
 Source/cmLocalGenerator.cxx                    |    7 +-
 Source/cmLocalGenerator.h                      |    5 +-
 Source/cmLocalGhsMultiGenerator.cxx            |    2 +-
 Source/cmLocalNinjaGenerator.cxx               |    6 +-
 Source/cmLocalUnixMakefileGenerator3.h         |    3 +
 Source/cmMakefile.cxx                          |    7 +-
 Source/cmMakefile.h                            |    7 +-
 Source/cmMakefileExecutableTargetGenerator.cxx |    2 +-
 Source/cmMakefileLibraryTargetGenerator.cxx    |    2 +-
 Source/cmMakefileTargetGenerator.cxx           |   13 ++--
 Source/cmMakefileTargetGenerator.h             |    2 +-
 Source/cmMakefileUtilityTargetGenerator.cxx    |    2 +-
 Source/cmNinjaNormalTargetGenerator.cxx        |    2 +-
 Source/cmNinjaTargetGenerator.cxx              |   11 ++--
 Source/cmNinjaTargetGenerator.h                |    2 +-
 Source/cmNinjaUtilityTargetGenerator.cxx       |    2 +-
 Source/cmOSXBundleGenerator.cxx                |    2 +-
 Source/cmProjectCommand.cxx                    |    2 +-
 Source/cmQtAutoGenerators.cxx                  |    9 +--
 Source/cmTargetDepend.h                        |   13 ++--
 Source/cmVisualStudio10TargetGenerator.cxx     |    6 +-
 Source/cmake.cxx                               |    2 +-
 41 files changed, 206 insertions(+), 236 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to