[Cmake-commits] CMake branch, next, updated. v3.4.0-rc2-1124-gdcf76f3

Stephen Kelly steveire at gmail.com
Tue Oct 27 02:45:03 EDT 2015


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  dcf76f3c79b4fae61eadee59bc1ca5e0ecd36dfe (commit)
       via  79c3a2a8f72ea175533da9f323f88c507220486e (commit)
       via  c389f8bb07e900d805ca3163f47b06e3dbe4303b (commit)
       via  02533038dae9fb5b4ae1b6f7d55bb5af397400af (commit)
       via  b6278e9ff714d8bdacb54f055eac71fe073b28d8 (commit)
       via  7a6caae1a78e8d67422b144ceffdd97595f67683 (commit)
       via  0fb187cc589b83ded107d9a9a1971830efb6c751 (commit)
       via  8caf1f361b2207522d19bf4a28cecaa3a2391918 (commit)
       via  278ba2db477fdc8cccd2313eb56e0179234747a0 (commit)
       via  79c11d23405d3894a254a8c03df5ead32464b109 (commit)
       via  9b244cc0ecff0cde22b71b7097a3d84c018c6044 (commit)
       via  def6da616b81958c9f1058a4e520ac3cbc534757 (commit)
       via  a67231ac114235f0af4673235c4c07fa896c8ab6 (commit)
       via  d566f39a640297114bd3ad933bb3279440b2f38f (commit)
       via  0c97d32f7a592a768d614c19b3fd48eab245a2c4 (commit)
       via  383bfd95432990365ac5c7fc3ab190bfb05cbec1 (commit)
       via  7f6beddae372a7ae47789f5460bcdfdac39c64e6 (commit)
       via  520ca0ff6c123250c633a3618459d0161cbc4683 (commit)
       via  3e3c754b8cc3af463dcea95000daf3a18b359b7a (commit)
       via  593f347b5385a510e641eca0448f7ddf64c1c12b (commit)
       via  7b127c62d4d4c94cf96e9d406859dbd24eed7dc9 (commit)
       via  780bff5279c6c2d356e5c7726b656bd9c68532b8 (commit)
       via  6bd7bd1e06fcf92d40c762f2713626d125cb8f87 (commit)
       via  b397eae82e14fdf75eddcbfd022d9f2d5933eb1e (commit)
       via  00b8c0a8d4b59dc01276d083ccae4a8138718b12 (commit)
       via  4c6374bcc56ea7d7f7e67c518e60de94be267256 (commit)
       via  7d409f500e3403f8dbb4a0fee6ecdad94f45c35e (commit)
       via  7a1b83cb3fc79639b9e2c1bf11af2d2274e4224a (commit)
       via  736c2042c6bade0322441aafabababcbd92af52e (commit)
       via  f210cb131e5814631d6d2974cf2437632446654f (commit)
      from  e1cff3e94cf6d46776d33d0ebe83aaf826bc0037 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dcf76f3c79b4fae61eadee59bc1ca5e0ecd36dfe
commit dcf76f3c79b4fae61eadee59bc1ca5e0ecd36dfe
Merge: e1cff3e 79c3a2a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 27 02:45:00 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Oct 27 02:45:00 2015 -0400

    Merge topic 'use-generator-target' into next
    
    79c3a2a8 cmGlobalGenerator: Remove map from cmTarget to cmGeneratorTarget
    c389f8bb cmLocalGenerator: Port Find method away from GetGeneratorTarget
    02533038 VS6: Port to FindGeneratorTarget
    b6278e9f cmake: Port find_package mode away from GetGeneratorTarget
    7a6caae1 cmMakefile: Add imported target accessor
    0fb187cc CMP0026: Port away from GetGeneratorTarget
    8caf1f36 cmGlobalGenerator: Add FindGeneratorTarget API
    278ba2db cmGeneratorTarget: Add API for globally visible IMPORTED
    79c11d23 Xcode: Port away from GetGeneratorTarget
    9b244cc0 cmLocalGenerator: Store imported targets in a separate container.
    def6da61 cmLocalGenerator: Port FindGeneratorTarget away from GetGeneratorTarget
    a67231ac cmTarget: Implement ALIAS in terms of name mapping
    d566f39a cmGlobalGenerator: Remove unneeded GetGeneratorTarget
    0c97d32f cmGlobalGenerator: Remove direct storage of targets
    383bfd95 cmTargetCollectLinkLanguages: Remove cmMakefile dependency
    7f6bedda cmGeneratorTarget: Port cmOptionalLinkImplementation
    ...


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79c3a2a8f72ea175533da9f323f88c507220486e
commit 79c3a2a8f72ea175533da9f323f88c507220486e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:22:42 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:26 2015 +0100

    cmGlobalGenerator: Remove map from cmTarget to cmGeneratorTarget
    
    The configure-time and generate-time types should be completely
    independent.
    
    Add ownership of cmGeneratorTarget instances to the cmLocalGenerator.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index d53f0e3..3d2db42 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1208,8 +1208,6 @@ void cmGlobalGenerator::Configure()
 void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
 {
   this->CreateLocalGenerators();
-  cmDeleteAll(this->GeneratorTargets);
-  this->GeneratorTargets.clear();
   this->CreateGeneratorTargets(targetTypes);
   this->ComputeBuildFileGenerators();
 }
@@ -1597,7 +1595,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(
       {
       cmTarget* t = &ti->second;
       cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
-      this->GeneratorTargets[t] = gt;
       lg->AddGeneratorTarget(gt);
       }
     }
@@ -1622,9 +1619,9 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
           j = mf->GetOwnedImportedTargets().begin();
         j != mf->GetOwnedImportedTargets().end(); ++j)
       {
-      cmGeneratorTarget* gt =
-          new cmGeneratorTarget(*j, this->LocalGenerators[i]);
-      this->GeneratorTargets[*j] = gt;
+      cmLocalGenerator* lg = this->LocalGenerators[i];
+      cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
+      lg->AddOwnedImportedGeneratorTarget(gt);
       importedMap[*j] = gt;
       }
     }
@@ -1641,9 +1638,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
 //----------------------------------------------------------------------------
 void cmGlobalGenerator::ClearGeneratorMembers()
 {
-  cmDeleteAll(this->GeneratorTargets);
-  this->GeneratorTargets.clear();
-
   cmDeleteAll(this->BuildExportSets);
   this->BuildExportSets.clear();
 
@@ -1662,20 +1656,6 @@ void cmGlobalGenerator::ClearGeneratorMembers()
 }
 
 //----------------------------------------------------------------------------
-cmGeneratorTarget*
-cmGlobalGenerator::GetGeneratorTarget(cmTarget const* t) const
-{
-  cmGeneratorTargetsType::const_iterator ti = this->GeneratorTargets.find(t);
-  if(ti == this->GeneratorTargets.end())
-    {
-    this->CMakeInstance->IssueMessage(
-      cmake::INTERNAL_ERROR, "Missing cmGeneratorTarget instance!");
-    return 0;
-    }
-  return ti->second;
-}
-
-//----------------------------------------------------------------------------
 void cmGlobalGenerator::ComputeTargetObjectDirectory(cmGeneratorTarget*) const
 {
 }
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 0057d61..bc6e17d 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -42,10 +42,6 @@ class cmInstallTargetGenerator;
 class cmInstallFilesGenerator;
 class cmExportBuildFileGenerator;
 
-typedef std::map<cmTarget const*,
-                 cmGeneratorTarget*,
-                 cmTarget::StrictTargetComparison> cmGeneratorTargetsType;
-
 /** \class cmGlobalGenerator
  * \brief Responsible for overseeing the generation process for the entire tree
  *
@@ -307,14 +303,6 @@ public:
   TargetDependSet const& GetTargetDirectDepends(
       const cmGeneratorTarget* target);
 
-  /** Get per-target generator information.  */
-  cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const;
-
-  void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
-  {
-    this->GeneratorTargets[t] = gt;
-  }
-
   const std::map<std::string, std::vector<cmLocalGenerator*> >& GetProjectMap()
                                                const {return this->ProjectMap;}
 
@@ -482,8 +470,6 @@ private:
   typedef std::map<cmGeneratorTarget const*, TargetDependSet> TargetDependMap;
   TargetDependMap TargetDependencies;
 
-  // Per-target generator information.
-  cmGeneratorTargetsType GeneratorTargets;
   friend class cmake;
   void CreateGeneratorTargets(TargetTypes targetTypes, cmMakefile* mf,
                    cmLocalGenerator* lg,
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index f08ab5a..5e239b8 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -257,7 +257,6 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
 
   cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg);
   lg->AddGeneratorTarget(gt);
-  this->AddGeneratorTarget(tgt, gt);
 
   // Organize in the "predefined targets" folder:
   //
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index b819dad..bb0c974 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -88,7 +88,6 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
 
       cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
       gen[0]->AddGeneratorTarget(gt);
-      this->AddGeneratorTarget(allBuild, gt);
 
 #if 0
       // Can't activate this code because we want ALL_BUILD
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6d4fc1f..da8c814 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -460,7 +460,6 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
 
   cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root);
   root->AddGeneratorTarget(allBuildGt);
-  root->GetGlobalGenerator()->AddGeneratorTarget(allbuild, allBuildGt);
 
   // Refer to the main build configuration file for easy editing.
   std::string listfile = root->GetCurrentSourceDirectory();
@@ -496,7 +495,6 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
 
     cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root);
     root->AddGeneratorTarget(checkGt);
-    root->GetGlobalGenerator()->AddGeneratorTarget(check, checkGt);
     }
 
   // now make the allbuild depend on all the non-utility targets
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ec7c29f..d92cbea 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -62,6 +62,8 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
 
 cmLocalGenerator::~cmLocalGenerator()
 {
+  cmDeleteAll(this->GeneratorTargets);
+  cmDeleteAll(this->OwnedImportedGeneratorTargets);
 }
 
 void cmLocalGenerator::IssueMessage(cmake::MessageType t,
@@ -460,6 +462,11 @@ void cmLocalGenerator::AddImportedGeneratorTarget(cmGeneratorTarget* gt)
   this->ImportedGeneratorTargets.push_back(gt);
 }
 
+void cmLocalGenerator::AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt)
+{
+  this->OwnedImportedGeneratorTargets.push_back(gt);
+}
+
 struct NamedGeneratorTargetFinder
 {
   NamedGeneratorTargetFinder(std::string const& name)
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 67383d7..e2f5519 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -127,6 +127,7 @@ public:
 
   void AddGeneratorTarget(cmGeneratorTarget* gt);
   void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
+  void AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt);
 
   cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const;
   cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
@@ -380,6 +381,7 @@ protected:
   std::set<cmGeneratorTarget const*> WarnCMP0063;
   std::vector<cmGeneratorTarget*> GeneratorTargets;
   std::vector<cmGeneratorTarget*> ImportedGeneratorTargets;
+  std::vector<cmGeneratorTarget*> OwnedImportedGeneratorTargets;
   std::map<std::string, std::string> AliasTargets;
 
   bool EmitUniversalBinaryFlags;
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 225c03e..b813c14 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -896,7 +896,6 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
 
     cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
     lg->AddGeneratorTarget(gt);
-    lg->GetGlobalGenerator()->AddGeneratorTarget(autogenTarget, gt);
 
     // Set target folder
     const char* autogenFolder = makefile->GetState()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c389f8bb07e900d805ca3163f47b06e3dbe4303b
commit c389f8bb07e900d805ca3163f47b06e3dbe4303b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:14:44 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:26 2015 +0100

    cmLocalGenerator: Port Find method away from GetGeneratorTarget
    
    Mirror the cmMakefile::FindTarget method.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 5928fb5..d53f0e3 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1583,10 +1583,12 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
-                                               cmLocalGenerator *lg)
+void cmGlobalGenerator::CreateGeneratorTargets(
+    TargetTypes targetTypes,
+    cmMakefile *mf,
+    cmLocalGenerator *lg,
+    std::map<cmTarget*, cmGeneratorTarget*> const& importedMap)
 {
-  cmMakefile* mf = lg->GetMakefile();
   if (targetTypes == AllTargets)
     {
     cmTargets& targets = mf->GetTargets();
@@ -1600,23 +1602,38 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
       }
     }
 
+  std::vector<cmTarget*> itgts = mf->GetImportedTargets();
+
   for(std::vector<cmTarget*>::const_iterator
-        j = mf->GetOwnedImportedTargets().begin();
-      j != mf->GetOwnedImportedTargets().end(); ++j)
+        j = itgts.begin(); j != itgts.end(); ++j)
     {
-    cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
-    this->GeneratorTargets[*j] = gt;
-    lg->AddImportedGeneratorTarget(gt);
+    lg->AddImportedGeneratorTarget(importedMap.find(*j)->second);
     }
 }
 
 //----------------------------------------------------------------------------
 void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
 {
+  std::map<cmTarget*, cmGeneratorTarget*> importedMap;
+  for(unsigned int i=0; i < this->Makefiles.size(); ++i)
+    {
+    cmMakefile* mf = this->Makefiles[i];
+    for(std::vector<cmTarget*>::const_iterator
+          j = mf->GetOwnedImportedTargets().begin();
+        j != mf->GetOwnedImportedTargets().end(); ++j)
+      {
+      cmGeneratorTarget* gt =
+          new cmGeneratorTarget(*j, this->LocalGenerators[i]);
+      this->GeneratorTargets[*j] = gt;
+      importedMap[*j] = gt;
+      }
+    }
+
   // Construct per-target generator information.
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
-    this->CreateGeneratorTargets(targetTypes, this->LocalGenerators[i]);
+    this->CreateGeneratorTargets(targetTypes, this->Makefiles[i],
+                                 this->LocalGenerators[i], importedMap);
     }
 }
 
@@ -2240,11 +2257,11 @@ cmGeneratorTarget* cmGlobalGenerator::FindImportedGeneratorTargetImpl(
   for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
     {
     std::vector<cmGeneratorTarget*> tgts =
-        this->LocalGenerators[i]->GetGeneratorTargets();
+        this->LocalGenerators[i]->GetImportedGeneratorTargets();
     for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
          it != tgts.end(); ++it)
       {
-      if ((*it)->GetName() == name && (*it)->IsImportedGloballyVisible())
+      if ((*it)->IsImportedGloballyVisible() && (*it)->GetName() == name)
         {
         return *it;
         }
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index c52b209..0057d61 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -485,7 +485,9 @@ private:
   // Per-target generator information.
   cmGeneratorTargetsType GeneratorTargets;
   friend class cmake;
-  void CreateGeneratorTargets(TargetTypes targetTypes, cmLocalGenerator* lg);
+  void CreateGeneratorTargets(TargetTypes targetTypes, cmMakefile* mf,
+                   cmLocalGenerator* lg,
+                   std::map<cmTarget*, cmGeneratorTarget*> const& importedMap);
   void CreateGeneratorTargets(TargetTypes targetTypes);
 
   void ClearGeneratorMembers();
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 1bc7f81..ec7c29f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1821,11 +1821,21 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
 cmGeneratorTarget*
 cmLocalGenerator::FindGeneratorTargetToUse(const std::string& name) const
 {
-  if (cmTarget *t = this->Makefile->FindTargetToUse(name))
+  std::vector<cmGeneratorTarget*>::const_iterator
+    imported = std::find_if(this->ImportedGeneratorTargets.begin(),
+                            this->ImportedGeneratorTargets.end(),
+                            NamedGeneratorTargetFinder(name));
+  if(imported != this->ImportedGeneratorTargets.end())
     {
-    return this->GetGlobalGenerator()->GetGeneratorTarget(t);
+    return *imported;
     }
-  return 0;
+
+  if(cmGeneratorTarget* t = this->FindGeneratorTarget(name))
+    {
+    return t;
+    }
+
+  return this->GetGlobalGenerator()->FindGeneratorTarget(name);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 7841d05..67383d7 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -120,6 +120,11 @@ public:
       return this->GeneratorTargets;
     }
 
+  const std::vector<cmGeneratorTarget*> &GetImportedGeneratorTargets() const
+    {
+      return this->ImportedGeneratorTargets;
+    }
+
   void AddGeneratorTarget(cmGeneratorTarget* gt);
   void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=02533038dae9fb5b4ae1b6f7d55bb5af397400af
commit 02533038dae9fb5b4ae1b6f7d55bb5af397400af
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:19:38 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:26 2015 +0100

    VS6: Port to FindGeneratorTarget

diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index fd0af61..cdacb9e 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1112,15 +1112,14 @@ void cmLocalVisualStudio6Generator
       // Compute the proper name to use to link this library.
       std::string lib;
       std::string libDebug;
-      cmTarget* tgt = this->GlobalGenerator->FindTarget(j->first.c_str());
+      cmGeneratorTarget* tgt =
+          this->GlobalGenerator->FindGeneratorTarget(j->first.c_str());
       if(tgt)
         {
-        cmGeneratorTarget* gt =
-          this->GlobalGenerator->GetGeneratorTarget(tgt);
         lib = cmSystemTools::GetFilenameWithoutExtension
-          (gt->GetFullName().c_str());
+          (tgt->GetFullName().c_str());
         libDebug = cmSystemTools::GetFilenameWithoutExtension
-          (gt->GetFullName("Debug").c_str());
+          (tgt->GetFullName("Debug").c_str());
         lib += ".lib";
         libDebug += ".lib";
         }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6278e9ff714d8bdacb54f055eac71fe073b28d8
commit b6278e9ff714d8bdacb54f055eac71fe073b28d8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 14:17:56 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:26 2015 +0100

    cmake: Port find_package mode away from GetGeneratorTarget

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 16417fc..d5bc3d2 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -447,8 +447,8 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
     (cmSystemTools::GetCurrentWorkingDirectory());
   // read in the list file to fill the cache
   snapshot.SetDefaultDefinitions();
-  cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
-  cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(mf.get()));
+  cmMakefile* mf = new cmMakefile(gg, snapshot);
+  gg->AddMakefile(mf);
 
   mf->SetArgcArgv(args);
 
@@ -481,6 +481,8 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
     std::vector<std::string> includeDirs;
     cmSystemTools::ExpandListArgument(includes, includeDirs);
 
+    gg->CreateGenerationObjects();
+    cmLocalGenerator* lg = gg->LocalGenerators[0];
     std::string includeFlags = lg->GetIncludeFlags(includeDirs, 0, language);
 
     std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS");
@@ -510,8 +512,9 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
     std::string linkPath;
     std::string flags;
     std::string linkFlags;
-    gg->CreateGeneratorTargets(cmGlobalGenerator::AllTargets, lg.get());
-    cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
+    gg->CreateGenerationObjects();
+    cmGeneratorTarget *gtgt = gg->FindGeneratorTarget(tgt->GetName());
+    cmLocalGenerator* lg = gtgt->GetLocalGenerator();
     lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
                        gtgt, false);
     linkLibs = frameworkPath + linkPath + linkLibs;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7a6caae1a78e8d67422b144ceffdd97595f67683
commit 7a6caae1a78e8d67422b144ceffdd97595f67683
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 26 22:18:20 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:25 2015 +0100

    cmMakefile: Add imported target accessor

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8f72f67..ffe92af 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1766,6 +1766,18 @@ const char* cmMakefile::GetCurrentBinaryDirectory() const
   return this->StateSnapshot.GetDirectory().GetCurrentBinary();
 }
 
+std::vector<cmTarget*> cmMakefile::GetImportedTargets() const
+{
+  std::vector<cmTarget*> tgts;
+  tgts.reserve(this->ImportedTargets.size());
+  for (TargetMap::const_iterator it = this->ImportedTargets.begin();
+       it != this->ImportedTargets.end(); ++it)
+    {
+    tgts.push_back(it->second);
+    }
+  return tgts;
+}
+
 //----------------------------------------------------------------------------
 void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
                                        bool before)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 01c4524..f1dd374 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -390,6 +390,7 @@ public:
     {
       return this->ImportedTargetsOwned;
     }
+  std::vector<cmTarget*> GetImportedTargets() const;
 
   cmTarget* FindTarget(const std::string& name,
                        bool excludeAliases = false) const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fb187cc589b83ded107d9a9a1971830efb6c751
commit 0fb187cc589b83ded107d9a9a1971830efb6c751
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:19:54 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:25 2015 +0100

    CMP0026: Port away from GetGeneratorTarget

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f0f404c..1eebd12 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1602,7 +1602,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         // CMake time.
         cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
         gg->CreateGenerationObjects();
-        cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
+        cmGeneratorTarget* gt = gg->FindGeneratorTarget(this->GetName());
         this->Properties.SetProperty(propLOCATION,
                                      gt->GetLocationForBuild());
         }
@@ -1627,7 +1627,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         {
         cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
         gg->CreateGenerationObjects();
-        cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
+        cmGeneratorTarget* gt = gg->FindGeneratorTarget(this->GetName());
         this->Properties.SetProperty(
                 prop, gt->GetFullPath(configName, false).c_str());
         }
@@ -1651,7 +1651,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
           {
           cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
           gg->CreateGenerationObjects();
-          cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
+          cmGeneratorTarget* gt = gg->FindGeneratorTarget(this->GetName());
           this->Properties.SetProperty(
                   prop, gt->GetFullPath(configName, false).c_str());
           }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8caf1f361b2207522d19bf4a28cecaa3a2391918
commit 8caf1f361b2207522d19bf4a28cecaa3a2391918
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:06:59 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:25 2015 +0100

    cmGlobalGenerator: Add FindGeneratorTarget API

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6b5cb97..5928fb5 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2196,6 +2196,25 @@ cmTarget* cmGlobalGenerator::FindTargetImpl(std::string const& name) const
   return 0;
 }
 
+cmGeneratorTarget*
+cmGlobalGenerator::FindGeneratorTargetImpl(std::string const& name) const
+{
+  for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+    {
+    std::vector<cmGeneratorTarget*> tgts =
+        this->LocalGenerators[i]->GetGeneratorTargets();
+    for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
+         it != tgts.end(); ++it)
+      {
+      if ((*it)->GetName() == name)
+        {
+        return *it;
+        }
+      }
+    }
+  return 0;
+}
+
 cmTarget*
 cmGlobalGenerator::FindImportedTargetImpl(std::string const& name) const
 {
@@ -2215,6 +2234,25 @@ cmGlobalGenerator::FindImportedTargetImpl(std::string const& name) const
   return 0;
 }
 
+cmGeneratorTarget* cmGlobalGenerator::FindImportedGeneratorTargetImpl(
+    std::string const& name) const
+{
+  for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+    {
+    std::vector<cmGeneratorTarget*> tgts =
+        this->LocalGenerators[i]->GetGeneratorTargets();
+    for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
+         it != tgts.end(); ++it)
+      {
+      if ((*it)->GetName() == name && (*it)->IsImportedGloballyVisible())
+        {
+        return *it;
+        }
+      }
+    }
+  return 0;
+}
+
 //----------------------------------------------------------------------------
 cmTarget*
 cmGlobalGenerator::FindTarget(const std::string& name,
@@ -2236,6 +2274,16 @@ cmGlobalGenerator::FindTarget(const std::string& name,
   return this->FindImportedTargetImpl(name);
 }
 
+cmGeneratorTarget*
+cmGlobalGenerator::FindGeneratorTarget(const std::string& name) const
+{
+  if (cmGeneratorTarget* tgt = this->FindGeneratorTargetImpl(name))
+    {
+    return tgt;
+    }
+  return this->FindImportedGeneratorTargetImpl(name);
+}
+
 //----------------------------------------------------------------------------
 bool
 cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 419cada..c52b209 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -254,6 +254,8 @@ public:
   cmTarget* FindTarget(const std::string& name,
                        bool excludeAliases = false) const;
 
+  cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const;
+
   void AddAlias(const std::string& name, const std::string& tgtName);
   bool IsAlias(const std::string& name) const;
 
@@ -432,6 +434,10 @@ protected:
   cmTarget* FindTargetImpl(std::string const& name) const;
   cmTarget* FindImportedTargetImpl(std::string const& name) const;
 
+  cmGeneratorTarget* FindGeneratorTargetImpl(std::string const& name) const;
+  cmGeneratorTarget*
+  FindImportedGeneratorTargetImpl(std::string const& name) const;
+
   const char* GetPredefinedTargetsFolder();
   virtual bool UseFolderProperty();
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=278ba2db477fdc8cccd2313eb56e0179234747a0
commit 278ba2db477fdc8cccd2313eb56e0179234747a0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:06:37 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:25 2015 +0100

    cmGeneratorTarget: Add API for globally visible IMPORTED

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 9376e98..1f74eda 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -856,6 +856,11 @@ bool cmGeneratorTarget::IsImported() const
   return this->Target->IsImported();
 }
 
+bool cmGeneratorTarget::IsImportedGloballyVisible() const
+{
+  return this->Target->IsImportedGloballyVisible();
+}
+
 //----------------------------------------------------------------------------
 const char* cmGeneratorTarget::GetLocationForBuild() const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index c2607a7..da59a98 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -31,6 +31,7 @@ public:
   cmLocalGenerator* GetLocalGenerator() const;
 
   bool IsImported() const;
+  bool IsImportedGloballyVisible() const;
   const char *GetLocation(const std::string& config) const;
 
   std::vector<cmCustomCommand> const &GetPreBuildCommands() const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79c11d23405d3894a254a8c03df5ead32464b109
commit 79c11d23405d3894a254a8c03df5ead32464b109
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 12:59:39 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:24 2015 +0100

    Xcode: Port away from GetGeneratorTarget

diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index 3b430d2..aec2603 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -51,13 +51,11 @@ void cmLocalXCodeGenerator::Generate()
 {
   cmLocalGenerator::Generate();
 
-  cmTargets& targets = this->Makefile->GetTargets();
-  for(cmTargets::iterator iter = targets.begin();
+  std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
+  for(std::vector<cmGeneratorTarget*>::iterator iter = targets.begin();
       iter != targets.end(); ++iter)
     {
-    cmTarget* t = &iter->second;
-    cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(t);
-    gt->HasMacOSXRpathInstallNameDir("");
+    (*iter)->HasMacOSXRpathInstallNameDir("");
     }
 }
 
@@ -66,13 +64,11 @@ void cmLocalXCodeGenerator::GenerateInstallRules()
 {
   cmLocalGenerator::GenerateInstallRules();
 
-  cmTargets& targets = this->Makefile->GetTargets();
-  for(cmTargets::iterator iter = targets.begin();
+  std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
+  for(std::vector<cmGeneratorTarget*>::iterator iter = targets.begin();
       iter != targets.end(); ++iter)
     {
-    cmTarget* t = &iter->second;
-    cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(t);
-    gt->HasMacOSXRpathInstallNameDir("");
+    (*iter)->HasMacOSXRpathInstallNameDir("");
     }
 }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b244cc0ecff0cde22b71b7097a3d84c018c6044
commit 9b244cc0ecff0cde22b71b7097a3d84c018c6044
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 12:56:31 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:24 2015 +0100

    cmLocalGenerator: Store imported targets in a separate container.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 47d254e..6b5cb97 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1606,6 +1606,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
     {
     cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
     this->GeneratorTargets[*j] = gt;
+    lg->AddImportedGeneratorTarget(gt);
     }
 }
 
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 9d5335e..1bc7f81 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -455,6 +455,11 @@ void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt)
   this->GeneratorTargets.push_back(gt);
 }
 
+void cmLocalGenerator::AddImportedGeneratorTarget(cmGeneratorTarget* gt)
+{
+  this->ImportedGeneratorTargets.push_back(gt);
+}
+
 struct NamedGeneratorTargetFinder
 {
   NamedGeneratorTargetFinder(std::string const& name)
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 91a476f..7841d05 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -121,6 +121,7 @@ public:
     }
 
   void AddGeneratorTarget(cmGeneratorTarget* gt);
+  void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
 
   cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const;
   cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
@@ -373,6 +374,7 @@ protected:
 
   std::set<cmGeneratorTarget const*> WarnCMP0063;
   std::vector<cmGeneratorTarget*> GeneratorTargets;
+  std::vector<cmGeneratorTarget*> ImportedGeneratorTargets;
   std::map<std::string, std::string> AliasTargets;
 
   bool EmitUniversalBinaryFlags;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=def6da616b81958c9f1058a4e520ac3cbc534757
commit def6da616b81958c9f1058a4e520ac3cbc534757
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 12:52:46 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:24 2015 +0100

    cmLocalGenerator: Port FindGeneratorTarget away from GetGeneratorTarget

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b5f5ce9..9d5335e 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -51,6 +51,8 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
 
   this->Makefile = makefile;
 
+  this->AliasTargets = makefile->GetAliasTargets();
+
   this->EmitUniversalBinaryFlags = true;
   this->BackwardsCompatibility = 0;
   this->BackwardsCompatibilityFinal = false;
@@ -453,11 +455,45 @@ void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt)
   this->GeneratorTargets.push_back(gt);
 }
 
+struct NamedGeneratorTargetFinder
+{
+  NamedGeneratorTargetFinder(std::string const& name)
+    : Name(name)
+  {
+
+  }
+
+  bool operator()(cmGeneratorTarget* tgt)
+  {
+    return tgt->GetName() == this->Name;
+  }
+private:
+  std::string Name;
+};
+
 cmGeneratorTarget* cmLocalGenerator::FindGeneratorTarget(
     const std::string& name) const
 {
-  return this->GetGlobalGenerator()->GetGeneratorTarget(
-        this->Makefile->FindTarget(name));
+  std::map<std::string, std::string>::const_iterator i =
+      this->AliasTargets.find(name);
+  if (i != this->AliasTargets.end())
+    {
+    std::vector<cmGeneratorTarget*>::const_iterator ai =
+        std::find_if(this->GeneratorTargets.begin(),
+                     this->GeneratorTargets.end(),
+                     NamedGeneratorTargetFinder(i->second));
+    return *ai;
+    }
+  std::vector<cmGeneratorTarget*>::const_iterator ti =
+      std::find_if(this->GeneratorTargets.begin(),
+                   this->GeneratorTargets.end(),
+                   NamedGeneratorTargetFinder(name));
+  if ( ti != this->GeneratorTargets.end() )
+    {
+    return *ti;
+    }
+
+  return 0;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 46eb1b3..91a476f 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -373,6 +373,7 @@ protected:
 
   std::set<cmGeneratorTarget const*> WarnCMP0063;
   std::vector<cmGeneratorTarget*> GeneratorTargets;
+  std::map<std::string, std::string> AliasTargets;
 
   bool EmitUniversalBinaryFlags;
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 35dd3c6..01c4524 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -400,6 +400,11 @@ public:
                             bool excludeAliases = false) const;
   bool IsAlias(const std::string& name) const;
 
+  std::map<std::string, std::string> GetAliasTargets() const
+  {
+    return this->AliasTargets;
+  }
+
   /**
    * Mark include directories as system directories.
    */

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a67231ac114235f0af4673235c4c07fa896c8ab6
commit a67231ac114235f0af4673235c4c07fa896c8ab6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 12:43:00 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:24 2015 +0100

    cmTarget: Implement ALIAS in terms of name mapping
    
    Remove mapping to cmTarget.

diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index 47f6592..a84bb9d 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -192,7 +192,7 @@ bool cmAddExecutableCommand
       this->SetError(e.str());
       return false;
       }
-    this->Makefile->AddAlias(exename, aliasedTarget);
+    this->Makefile->AddAlias(exename, aliasedName);
     return true;
     }
 
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index e0adee3..5296cbb 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -314,7 +314,7 @@ bool cmAddLibraryCommand
       this->SetError(e.str());
       return false;
       }
-    this->Makefile->AddAlias(libName, aliasedTarget);
+    this->Makefile->AddAlias(libName, aliasedName);
     return true;
     }
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 215d63f..47d254e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2167,9 +2167,10 @@ cmGlobalGenerator::FindLocalGenerator(const std::string& start_dir) const
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::AddAlias(const std::string& name, cmTarget *tgt)
+void cmGlobalGenerator::AddAlias(const std::string& name,
+                                 std::string const& tgtName)
 {
-  this->AliasTargets[name] = tgt;
+  this->AliasTargets[name] = tgtName;
 }
 
 //----------------------------------------------------------------------------
@@ -2220,10 +2221,11 @@ cmGlobalGenerator::FindTarget(const std::string& name,
 {
   if (!excludeAliases)
     {
-    TargetMap::const_iterator ai = this->AliasTargets.find(name);
+    std::map<std::string, std::string>::const_iterator ai =
+        this->AliasTargets.find(name);
     if (ai != this->AliasTargets.end())
       {
-      return ai->second;
+      return this->FindTargetImpl(ai->second);
       }
     }
   if (cmTarget* tgt = this->FindTargetImpl(name))
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 5d4ce08..419cada 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -254,7 +254,7 @@ public:
   cmTarget* FindTarget(const std::string& name,
                        bool excludeAliases = false) const;
 
-  void AddAlias(const std::string& name, cmTarget *tgt);
+  void AddAlias(const std::string& name, const std::string& tgtName);
   bool IsAlias(const std::string& name) const;
 
   /** Determine if a name resolves to a framework on disk or a built target
@@ -427,17 +427,7 @@ protected:
   std::map<std::string, cmExportBuildFileGenerator*> BuildExportSets;
   std::map<std::string, cmExportBuildFileGenerator*> BuildExportExportSets;
 
-  // All targets in the entire project.
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-#ifdef CMake_HAVE_CXX11_UNORDERED_MAP
-  typedef std::unordered_map<std::string, cmTarget*> TargetMap;
-#else
-  typedef cmsys::hash_map<std::string, cmTarget*> TargetMap;
-#endif
-#else
-  typedef std::map<std::string,cmTarget *> TargetMap;
-#endif
-  TargetMap AliasTargets;
+  std::map<std::string, std::string> AliasTargets;
 
   cmTarget* FindTargetImpl(std::string const& name) const;
   cmTarget* FindImportedTargetImpl(std::string const& name) const;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d9d773d..8f72f67 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2036,10 +2036,11 @@ void cmMakefile::AddGlobalLinkInformation(const std::string& name,
 }
 
 
-void cmMakefile::AddAlias(const std::string& lname, cmTarget *tgt)
+void cmMakefile::AddAlias(const std::string& lname,
+                          std::string const& tgtName)
 {
-  this->AliasTargets[lname] = tgt;
-  this->GetGlobalGenerator()->AddAlias(lname, tgt);
+  this->AliasTargets[lname] = tgtName;
+  this->GetGlobalGenerator()->AddAlias(lname, tgtName);
 }
 
 cmTarget* cmMakefile::AddLibrary(const std::string& lname,
@@ -4024,10 +4025,12 @@ cmTarget* cmMakefile::FindTarget(const std::string& name,
 {
   if (!excludeAliases)
     {
-    TargetMap::const_iterator i = this->AliasTargets.find(name);
+    std::map<std::string, std::string>::const_iterator i =
+        this->AliasTargets.find(name);
     if (i != this->AliasTargets.end())
       {
-      return i->second;
+      cmTargets::iterator ai = this->Targets.find(i->second);
+      return &ai->second;
       }
     }
   cmTargets::iterator i = this->Targets.find( name );
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index f3dbb74..35dd3c6 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -283,7 +283,7 @@ public:
   cmTarget* AddLibrary(const std::string& libname, cmState::TargetType type,
                   const std::vector<std::string> &srcs,
                   bool excludeFromAll = false);
-  void AddAlias(const std::string& libname, cmTarget *tgt);
+  void AddAlias(const std::string& libname, const std::string& tgt);
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   /**
@@ -790,7 +790,7 @@ protected:
 #else
   typedef std::map<std::string, cmTarget*> TargetMap;
 #endif
-  TargetMap AliasTargets;
+  std::map<std::string, std::string> AliasTargets;
   std::vector<cmSourceFile*> SourceFiles;
 
   // Tests

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d566f39a640297114bd3ad933bb3279440b2f38f
commit d566f39a640297114bd3ad933bb3279440b2f38f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 12:33:38 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:24 2015 +0100

    cmGlobalGenerator: Remove unneeded GetGeneratorTarget

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index e33e942..215d63f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2244,8 +2244,7 @@ cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const
 
   if(cmTarget* tgt = this->FindTarget(libname))
     {
-    cmGeneratorTarget* gt = this->GetGeneratorTarget(tgt);
-    if(gt->IsFrameworkOnApple())
+    if(tgt->IsFrameworkOnApple())
        {
        return true;
        }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c97d32f7a592a768d614c19b3fd48eab245a2c4
commit 0c97d32f7a592a768d614c19b3fd48eab245a2c4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 12:22:51 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:23 2015 +0100

    cmGlobalGenerator: Remove direct storage of targets
    
    Find the target by looping when needed.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index d26cc34..e33e942 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1637,8 +1637,6 @@ void cmGlobalGenerator::ClearGeneratorMembers()
 
   this->ExportSets.clear();
   this->TargetDependencies.clear();
-  this->TotalTargets.clear();
-  this->ImportedTargets.clear();
   this->ProjectMap.clear();
   this->RuleHashes.clear();
   this->DirectoryContentMap.clear();
@@ -2180,6 +2178,41 @@ bool cmGlobalGenerator::IsAlias(const std::string& name) const
   return this->AliasTargets.find(name) != this->AliasTargets.end();
 }
 
+cmTarget* cmGlobalGenerator::FindTargetImpl(std::string const& name) const
+{
+  for (unsigned int i = 0; i < this->Makefiles.size(); ++i)
+    {
+    cmTargets& tgts = this->Makefiles[i]->GetTargets();
+    for (cmTargets::iterator it = tgts.begin(); it != tgts.end(); ++it)
+      {
+      if (it->second.GetName() == name)
+        {
+        return &it->second;
+        }
+      }
+    }
+  return 0;
+}
+
+cmTarget*
+cmGlobalGenerator::FindImportedTargetImpl(std::string const& name) const
+{
+  for (unsigned int i = 0; i < this->Makefiles.size(); ++i)
+    {
+    std::vector<cmTarget*> tgts =
+        this->Makefiles[i]->GetOwnedImportedTargets();
+    for (std::vector<cmTarget*>::iterator it = tgts.begin();
+         it != tgts.end(); ++it)
+      {
+      if ((*it)->GetName() == name && (*it)->IsImportedGloballyVisible())
+        {
+        return *it;
+        }
+      }
+    }
+  return 0;
+}
+
 //----------------------------------------------------------------------------
 cmTarget*
 cmGlobalGenerator::FindTarget(const std::string& name,
@@ -2193,17 +2226,11 @@ cmGlobalGenerator::FindTarget(const std::string& name,
       return ai->second;
       }
     }
-  TargetMap::const_iterator i = this->TotalTargets.find ( name );
-  if ( i != this->TotalTargets.end() )
-    {
-    return i->second;
-    }
-  i = this->ImportedTargets.find(name);
-  if ( i != this->ImportedTargets.end() )
+  if (cmTarget* tgt = this->FindTargetImpl(name))
     {
-    return i->second;
+    return tgt;
     }
-  return 0;
+  return this->FindImportedTargetImpl(name);
 }
 
 //----------------------------------------------------------------------------
@@ -2622,18 +2649,6 @@ cmGlobalGenerator::GetTargetDirectDepends(cmGeneratorTarget const* target)
   return this->TargetDependencies[target];
 }
 
-void cmGlobalGenerator::AddTarget(cmTarget* t)
-{
-  if(t->IsImported())
-    {
-    this->ImportedTargets[t->GetName()] = t;
-    }
-  else
-    {
-    this->TotalTargets[t->GetName()] = t;
-    }
-}
-
 bool cmGlobalGenerator::IsReservedTarget(std::string const& name)
 {
   // The following is a list of targets reserved
@@ -2939,17 +2954,20 @@ void cmGlobalGenerator::WriteSummary()
   fname += "/TargetDirectories.txt";
   cmGeneratedFileStream fout(fname.c_str());
 
-  // Generate summary information files for each target.
-  for(TargetMap::const_iterator ti =
-        this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
+  for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
     {
-    if ((ti->second)->GetType() == cmState::INTERFACE_LIBRARY)
+    std::vector<cmGeneratorTarget*> tgts =
+        this->LocalGenerators[i]->GetGeneratorTargets();
+    for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
+         it != tgts.end(); ++it)
       {
-      continue;
+      if ((*it)->GetType() == cmState::INTERFACE_LIBRARY)
+        {
+        continue;
+        }
+      this->WriteSummary(*it);
+      fout << (*it)->GetSupportDirectory() << "\n";
       }
-    cmGeneratorTarget* gt = this->GetGeneratorTarget(ti->second);
-    this->WriteSummary(gt);
-    fout << gt->GetSupportDirectory() << "\n";
     }
 }
 
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 18f5329..5d4ce08 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -280,8 +280,6 @@ public:
   std::set<std::string> const& GetDirectoryContent(std::string const& dir,
                                                    bool needDisk = true);
 
-  void AddTarget(cmTarget* t);
-
   static bool IsReservedTarget(std::string const& name);
 
   virtual const char* GetAllTargetName()         const { return "ALL_BUILD"; }
@@ -439,9 +437,10 @@ protected:
 #else
   typedef std::map<std::string,cmTarget *> TargetMap;
 #endif
-  TargetMap TotalTargets;
   TargetMap AliasTargets;
-  TargetMap ImportedTargets;
+
+  cmTarget* FindTargetImpl(std::string const& name) const;
+  cmTarget* FindImportedTargetImpl(std::string const& name) const;
 
   const char* GetPredefinedTargetsFolder();
   virtual bool UseFolderProperty();
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index b771f11..f08ab5a 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -354,14 +354,18 @@ void cmGlobalVisualStudio8Generator::AddExtraIDETargets()
   cmGlobalVisualStudio7Generator::AddExtraIDETargets();
   if(this->AddCheckTarget())
     {
-    // All targets depend on the build-system check target.
-    for(TargetMap::const_iterator
-          ti = this->TotalTargets.begin();
-        ti != this->TotalTargets.end(); ++ti)
+    for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
       {
-      if(ti->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
+      std::vector<cmGeneratorTarget*> tgts =
+          this->LocalGenerators[i]->GetGeneratorTargets();
+      // All targets depend on the build-system check target.
+      for(std::vector<cmGeneratorTarget*>::iterator ti = tgts.begin();
+          ti != tgts.end(); ++ti)
         {
-        ti->second->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
+        if((*ti)->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
+          {
+          (*ti)->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
+          }
         }
       }
     }
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 42f9758..6d4fc1f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1362,12 +1362,17 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
 //----------------------------------------------------------------------------
 void cmGlobalXCodeGenerator::ForceLinkerLanguages()
 {
-  // This makes sure all targets link using the proper language.
-  for(TargetMap::const_iterator
-        ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
+  for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
     {
-    cmGeneratorTarget* gt = this->GetGeneratorTarget(ti->second);
-    this->ForceLinkerLanguage(gt);
+    std::vector<cmGeneratorTarget*> tgts =
+        this->LocalGenerators[i]->GetGeneratorTargets();
+    // All targets depend on the build-system check target.
+    for(std::vector<cmGeneratorTarget*>::const_iterator ti = tgts.begin();
+        ti != tgts.end(); ++ti)
+      {
+      // This makes sure all targets link using the proper language.
+      this->ForceLinkerLanguage(*ti);
+      }
     }
 }
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3bf34e2..d9d773d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2096,7 +2096,6 @@ cmMakefile::AddNewTarget(cmState::TargetType type, const std::string& name)
   cmTarget& target = it->second;
   target.SetType(type, name);
   target.SetMakefile(this);
-  this->GetGlobalGenerator()->AddTarget(&it->second);
   return &it->second;
 }
 
@@ -4183,15 +4182,11 @@ cmMakefile::AddImportedTarget(const std::string& name,
   // Create the target.
   cmsys::auto_ptr<cmTarget> target(new cmTarget);
   target->SetType(type, name);
-  target->MarkAsImported();
+  target->MarkAsImported(global);
   target->SetMakefile(this);
 
   // Add to the set of available imported targets.
   this->ImportedTargets[name] = target.get();
-  if(global)
-    {
-    this->GetGlobalGenerator()->AddTarget(target.get());
-    }
 
   // Transfer ownership to this cmMakefile object.
   this->ImportedTargetsOwned.push_back(target.get());
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c887fc8..f0f404c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -63,6 +63,7 @@ cmTarget::cmTarget()
   this->IsAndroid = false;
   this->IsApple = false;
   this->IsImportedTarget = false;
+  this->ImportedGloballyVisible = false;
   this->BuildInterfaceIncludesAppended = false;
 }
 
@@ -1505,9 +1506,10 @@ void cmTarget::CheckProperty(const std::string& prop,
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::MarkAsImported()
+void cmTarget::MarkAsImported(bool global)
 {
   this->IsImportedTarget = true;
+  this->ImportedGloballyVisible = global;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 541e850..62e10f4 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -75,7 +75,7 @@ public:
    */
   void SetType(cmState::TargetType f, const std::string& name);
 
-  void MarkAsImported();
+  void MarkAsImported(bool global = false);
 
   ///! Set/Get the name of the target
   const std::string& GetName() const {return this->Name;}
@@ -186,6 +186,8 @@ public:
   void CheckProperty(const std::string& prop, cmMakefile* context) const;
 
   bool IsImported() const {return this->IsImportedTarget;}
+  bool IsImportedGloballyVisible() const
+  { return this->ImportedGloballyVisible; }
 
   // Get the properties
   cmPropertyMap &GetProperties() const { return this->Properties; }
@@ -349,6 +351,7 @@ private:
   bool IsAndroid;
   bool IsApple;
   bool IsImportedTarget;
+  bool ImportedGloballyVisible;
   bool BuildInterfaceIncludesAppended;
 #if defined(_WIN32) && !defined(__CYGWIN__)
   bool LinkLibrariesForVS6Analyzed;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=383bfd95432990365ac5c7fc3ab190bfb05cbec1
commit 383bfd95432990365ac5c7fc3ab190bfb05cbec1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 11:49:03 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:23 2015 +0100

    cmTargetCollectLinkLanguages: Remove cmMakefile dependency

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e19d5e5..9376e98 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1793,7 +1793,7 @@ public:
                                UNORDERED_SET<std::string>& languages,
                                cmGeneratorTarget const* head):
     Config(config), Languages(languages), HeadTarget(head),
-    Makefile(target->Target->GetMakefile()), Target(target)
+    Target(target)
   { this->Visited.insert(target); }
 
   void Visit(cmLinkItem const& item)
@@ -1805,7 +1805,8 @@ public:
         bool noMessage = false;
         cmake::MessageType messageType = cmake::FATAL_ERROR;
         std::stringstream e;
-        switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028))
+        switch(this->Target->GetLocalGenerator()
+               ->GetPolicyStatus(cmPolicies::CMP0028))
           {
           case cmPolicies::WARN:
             {
@@ -1859,7 +1860,6 @@ private:
   std::string Config;
   UNORDERED_SET<std::string>& Languages;
   cmGeneratorTarget const* HeadTarget;
-  cmMakefile* Makefile;
   const cmGeneratorTarget* Target;
   std::set<cmGeneratorTarget const*> Visited;
 };

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f6beddae372a7ae47789f5460bcdfdac39c64e6
commit 7f6beddae372a7ae47789f5460bcdfdac39c64e6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 11:37:34 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:23 2015 +0100

    cmGeneratorTarget: Port cmOptionalLinkImplementation

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3df43ff..e19d5e5 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5560,7 +5560,7 @@ cmGeneratorTarget::GetLinkImplementation(const std::string& config) const
     }
 
   std::string CONFIG = cmSystemTools::UpperCase(config);
-  cmOptionalLinkImplementation& impl = this->LinkImplMap[CONFIG][this->Target];
+  cmOptionalLinkImplementation& impl = this->LinkImplMap[CONFIG][this];
   if(!impl.LibrariesDone)
     {
     impl.LibrariesDone = true;
@@ -5840,7 +5840,7 @@ cmGeneratorTarget::GetLinkImplementationLibrariesInternal(
     return &hm.begin()->second;
     }
 
-  cmOptionalLinkImplementation& impl = hm[head->Target];
+  cmOptionalLinkImplementation& impl = hm[head];
   if(!impl.LibrariesDone)
     {
     impl.LibrariesDone = true;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 3c6f267..c2607a7 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -647,7 +647,7 @@ private:
                       const std::string& config) const;
 
   struct HeadToLinkImplementationMap:
-    public std::map<cmTarget const*, cmOptionalLinkImplementation> {};
+    public std::map<cmGeneratorTarget const*, cmOptionalLinkImplementation> {};
   typedef std::map<std::string,
                    HeadToLinkImplementationMap> LinkImplMapType;
   mutable LinkImplMapType LinkImplMap;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=520ca0ff6c123250c633a3618459d0161cbc4683
commit 520ca0ff6c123250c633a3618459d0161cbc4683
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 10:35:36 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:23 2015 +0100

    cmGeneratorTarget: Add API for property keys

diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 1daa67e..83127e7 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -105,16 +105,18 @@ cmExportTryCompileFileGenerator::PopulateProperties(
                                  ImportPropertyMap& properties,
                                  std::set<cmGeneratorTarget const*> &emitted)
 {
-  cmPropertyMap props = target->Target->GetProperties();
-  for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i)
+  std::vector<std::string> props = target->GetPropertyKeys();
+  for(std::vector<std::string>::const_iterator i = props.begin();
+      i != props.end(); ++i)
     {
-    properties[i->first] = i->second.GetValue();
 
-    if(i->first.find("IMPORTED_LINK_INTERFACE_LIBRARIES") == 0
-        || i->first.find("IMPORTED_LINK_DEPENDENT_LIBRARIES") == 0
-        || i->first.find("INTERFACE_LINK_LIBRARIES") == 0)
+    properties[*i] = target->GetProperty(*i);
+
+    if(i->find("IMPORTED_LINK_INTERFACE_LIBRARIES") == 0
+        || i->find("IMPORTED_LINK_DEPENDENT_LIBRARIES") == 0
+        || i->find("INTERFACE_LINK_LIBRARIES") == 0)
       {
-      std::string evalResult = this->FindTargets(i->first,
+      std::string evalResult = this->FindTargets(*i,
                                                  target, emitted);
 
       std::vector<std::string> depends;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 651c89c..3df43ff 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4251,9 +4251,11 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
                                           PropertyType *)
 {
   PropertyType propContent = getTypedProperty<PropertyType>(tgt, p);
-  const bool explicitlySet = tgt->Target->GetProperties()
-                                  .find(p)
-                                  != tgt->Target->GetProperties().end();
+  std::vector<std::string> headPropKeys = tgt->GetPropertyKeys();
+  const bool explicitlySet =
+      std::find(headPropKeys.begin(), headPropKeys.end(),
+                p) != headPropKeys.end();
+
   const bool impliedByUse =
           tgt->IsNullImpliedByLinkLibraries(p);
   assert((impliedByUse ^ explicitlySet)
@@ -4298,9 +4300,11 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
 
     cmGeneratorTarget const* theTarget = *li;
 
-    const bool ifaceIsSet = theTarget->Target->GetProperties()
-                            .find(interfaceProperty)
-                            != theTarget->Target->GetProperties().end();
+    std::vector<std::string> propKeys = theTarget->GetPropertyKeys();
+
+    const bool ifaceIsSet =
+        std::find(propKeys.begin(), propKeys.end(),
+                  interfaceProperty) != propKeys.end();
     PropertyType ifacePropContent =
                     getTypedProperty<PropertyType>(theTarget,
                               interfaceProperty);
@@ -4577,6 +4581,19 @@ void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
   vName += this->Makefile->IsOn("APPLE") ? suffix : std::string();
 }
 
+std::vector<std::string> cmGeneratorTarget::GetPropertyKeys() const
+{
+  cmPropertyMap propsObject = this->Target->GetProperties();
+  std::vector<std::string> props;
+  props.reserve(propsObject.size());
+  for (cmPropertyMap::const_iterator it = propsObject.begin();
+       it != propsObject.end(); ++it)
+    {
+    props.push_back(it->first);
+    }
+  return props;
+}
+
 //----------------------------------------------------------------------------
 void
 cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 58c3421..3c6f267 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -57,6 +57,7 @@ public:
   std::string GetName() const;
   std::string GetExportName() const;
 
+  std::vector<std::string> GetPropertyKeys() const;
   const char *GetProperty(const std::string& prop) const;
   bool GetPropertyAsBool(const std::string& prop) const;
   void GetSourceFiles(std::vector<cmSourceFile*>& files,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 5737bee..42f9758 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2486,13 +2486,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
   // put this last so it can override existing settings
   // Convert "XCODE_ATTRIBUTE_*" properties directly.
   {
-  cmPropertyMap const& props = gtgt->Target->GetProperties();
-  for(cmPropertyMap::const_iterator i = props.begin();
+  std::vector<std::string> const& props = gtgt->GetPropertyKeys();
+  for(std::vector<std::string>::const_iterator i = props.begin();
       i != props.end(); ++i)
     {
-    if(i->first.find("XCODE_ATTRIBUTE_") == 0)
+    if(i->find("XCODE_ATTRIBUTE_") == 0)
       {
-      std::string attribute = i->first.substr(16);
+      std::string attribute = i->substr(16);
       // Handle [variant=<config>] condition explicitly here.
       std::string::size_type beginVariant =
         attribute.find("[variant=");
@@ -2523,7 +2523,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
       if (!attribute.empty())
         {
         cmGeneratorExpression ge;
-        std::string processed = ge.Parse(i->second.GetValue())
+        std::string processed = ge.Parse(gtgt->GetProperty(*i))
           ->Evaluate(this->CurrentLocalGenerator, configName);
         buildSettings->AddAttribute(attribute.c_str(),
                                     this->CreateString(processed));
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 0eac203..ae6a24e 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -2219,17 +2219,18 @@ void cmLocalVisualStudio7Generator::WriteVCProjFooter(
 {
   fout << "\t<Globals>\n";
 
-  cmPropertyMap const& props = target->Target->GetProperties();
-  for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i)
+  std::vector<std::string> const& props = target->GetPropertyKeys();
+  for(std::vector<std::string>::const_iterator i = props.begin();
+      i != props.end(); ++i)
     {
-    if(i->first.find("VS_GLOBAL_") == 0)
+    if(i->find("VS_GLOBAL_") == 0)
       {
-      std::string name = i->first.substr(10);
+      std::string name = i->substr(10);
       if(name != "")
         {
         fout << "\t\t<Global\n"
              << "\t\t\tName=\"" << name << "\"\n"
-             << "\t\t\tValue=\"" << i->second.GetValue() << "\"\n"
+             << "\t\t\tValue=\"" << target->GetProperty(*i) << "\"\n"
              << "\t\t/>\n";
         }
       }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e3c754b8cc3af463dcea95000daf3a18b359b7a
commit 3e3c754b8cc3af463dcea95000daf3a18b359b7a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 01:19:14 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:22 2015 +0100

    cmLocalGenerator: Port internals to cmGeneratorTarget

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 1926772..b5f5ce9 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2033,7 +2033,7 @@ AddCompilerRequirementFlag(std::string &flags,
 }
 
 static void AddVisibilityCompileOption(std::string &flags,
-                                       cmTarget const* target,
+                                       cmGeneratorTarget const* target,
                                        cmLocalGenerator *lg,
                                        const std::string& lang,
                                        std::string* warnCMP0063)
@@ -2073,7 +2073,7 @@ static void AddVisibilityCompileOption(std::string &flags,
 }
 
 static void AddInlineVisibilityCompileOption(std::string &flags,
-                                       cmTarget const* target,
+                                       cmGeneratorTarget const* target,
                                        cmLocalGenerator *lg,
                                        std::string* warnCMP0063)
 {
@@ -2126,12 +2126,11 @@ void cmLocalGenerator
       }
     }
 
-  AddVisibilityCompileOption(flags, target->Target, this, lang, pWarnCMP0063);
+  AddVisibilityCompileOption(flags, target, this, lang, pWarnCMP0063);
 
   if(lang == "CXX")
     {
-    AddInlineVisibilityCompileOption(flags, target->Target,
-                                     this, pWarnCMP0063);
+    AddInlineVisibilityCompileOption(flags, target, this, pWarnCMP0063);
     }
 
   if (!warnCMP0063.empty() &&

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=593f347b5385a510e641eca0448f7ddf64c1c12b
commit 593f347b5385a510e641eca0448f7ddf64c1c12b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 00:49:31 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:22 2015 +0100

    VS7: Port some implementation details to cmGeneratorTarget

diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 95a299d..0eac203 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -783,10 +783,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   intermediateDir += "/";
   intermediateDir += configName;
 
-  if (target->Target->GetType() < cmState::UTILITY)
+  if (target->GetType() < cmState::UTILITY)
     {
     std::string const& outDir =
-      target->Target->GetType() == cmState::OBJECT_LIBRARY?
+      target->GetType() == cmState::OBJECT_LIBRARY?
       intermediateDir : target->GetDirectory(configName);
     fout << "\t\t\tOutputDirectory=\""
          << this->ConvertToXMLOutputPathSingle(outDir.c_str()) << "\"\n";
@@ -837,7 +837,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   if(this->FortranProject)
     {
     const char* target_mod_dir =
-      target->Target->GetProperty("Fortran_MODULE_DIRECTORY");
+      target->GetProperty("Fortran_MODULE_DIRECTORY");
     std::string modDir;
     if(target_mod_dir)
       {
@@ -877,7 +877,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.OutputFlagMap(fout, "\t\t\t\t");
   targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
   fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
-  if(target->Target->GetType() <= cmState::OBJECT_LIBRARY)
+  if(target->GetType() <= cmState::OBJECT_LIBRARY)
     {
     // Specify the compiler program database file if configured.
     std::string pdb = target->GetCompilePDBPath(configName);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b127c62d4d4c94cf96e9d406859dbd24eed7dc9
commit 7b127c62d4d4c94cf96e9d406859dbd24eed7dc9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 24 15:42:04 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:22 2015 +0100

    VS7: Port remaining interface to cmGeneratorTarget

diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 340a0f7..f5848ab 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -401,7 +401,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
   for(OrderedTargetDependSet::const_iterator tt =
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
-    cmTarget const* target = (*tt)->Target;
+    cmGeneratorTarget const* target = *tt;
     if(target->GetType() == cmState::INTERFACE_LIBRARY)
       {
       continue;
@@ -996,7 +996,8 @@ cmGlobalVisualStudio7Generator
 std::set<std::string>
 cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
   std::vector<std::string> const& configs,
-  OrderedTargetDependSet const& projectTargets, cmTarget const* target)
+  OrderedTargetDependSet const& projectTargets,
+  cmGeneratorTarget const* target)
 {
   std::set<std::string> activeConfigs;
   // if it is a utilitiy target then only make it part of the
@@ -1011,13 +1012,13 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
       for(std::vector<std::string>::const_iterator i = configs.begin();
           i != configs.end(); ++i)
         {
-        const char* propertyValue = target->GetMakefile()
+        const char* propertyValue = target->Target->GetMakefile()
           ->GetDefinition("CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD");
         cmGeneratorExpression ge;
         cmsys::auto_ptr<cmCompiledGeneratorExpression>
           cge = ge.Parse(propertyValue);
-        cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
-        if(cmSystemTools::IsOn(cge->Evaluate(gt->GetLocalGenerator(), *i)))
+        if(cmSystemTools::IsOn(cge->Evaluate(target->GetLocalGenerator(),
+                                             *i)))
           {
           activeConfigs.insert(*i);
           }
@@ -1029,13 +1030,12 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
     {
     return activeConfigs;
     }
-  cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
   // inspect EXCLUDE_FROM_DEFAULT_BUILD[_<CONFIG>] properties
   for(std::vector<std::string>::const_iterator i = configs.begin();
       i != configs.end(); ++i)
     {
     const char* propertyValue =
-      gt->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i->c_str());
+      target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i->c_str());
     if(cmSystemTools::IsOff(propertyValue))
       {
       activeConfigs.insert(*i);
@@ -1047,9 +1047,8 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
 bool
 cmGlobalVisualStudio7Generator
 ::IsDependedOn(OrderedTargetDependSet const& projectTargets,
-               cmTarget const* targetIn)
+               cmGeneratorTarget const* gtIn)
 {
-  cmGeneratorTarget* gtIn = this->GetGeneratorTarget(targetIn);
   for (OrderedTargetDependSet::const_iterator l = projectTargets.begin();
        l != projectTargets.end(); ++l)
     {
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 6a0e5e9..fe6db2e 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -163,9 +163,9 @@ protected:
   std::set<std::string>
     IsPartOfDefaultBuild(std::vector<std::string> const& configs,
                          OrderedTargetDependSet const& projectTargets,
-                         cmTarget const* target);
+                         cmGeneratorTarget const* target);
   bool IsDependedOn(OrderedTargetDependSet const& projectTargets,
-                    cmTarget const* target);
+                    cmGeneratorTarget const* target);
   std::map<std::string, std::string> GUIDMap;
 
   virtual void WriteFolders(std::ostream& fout);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=780bff5279c6c2d356e5c7726b656bd9c68532b8
commit 780bff5279c6c2d356e5c7726b656bd9c68532b8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 24 14:58:23 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:22 2015 +0100

    cmake: Store hardcoded lists of sources and headers
    
    Don't duplicate this in each cmMakefile.

diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index 5f5017d..92ac07d 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -60,10 +60,10 @@ bool cmAuxSourceDirectoryCommand::InitialPass
         std::string ext = file.substr(dotpos+1);
         std::string base = file.substr(0, dotpos);
         // Process only source files
-        if(!base.empty()
-            && std::find( this->Makefile->GetSourceExtensions().begin(),
-                          this->Makefile->GetSourceExtensions().end(), ext )
-                 != this->Makefile->GetSourceExtensions().end() )
+        std::vector<std::string> srcExts =
+            this->Makefile->GetCMakeInstance()->GetSourceExtensions();
+        if(!base.empty() &&
+           std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end())
           {
           std::string fullname = templateDirectory;
           fullname += "/";
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 597c9d8..9348ef2 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -383,6 +383,9 @@ void cmExtraCodeBlocksGenerator
   all_files_map_t allFiles;
   std::vector<std::string> cFiles;
 
+  std::vector<std::string> srcExts =
+      this->GlobalGenerator->GetCMakeInstance()->GetSourceExtensions();
+
   for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin();
        lg!=lgs.end(); lg++)
     {
@@ -420,9 +423,7 @@ void cmExtraCodeBlocksGenerator
               {
               std::string srcext = (*si)->GetExtension();
               for(std::vector<std::string>::const_iterator
-                  ext = mf->GetSourceExtensions().begin();
-                  ext !=  mf->GetSourceExtensions().end();
-                  ++ext)
+                  ext = srcExts.begin(); ext != srcExts.end(); ++ext)
                 {
                 if (srcext == *ext)
                   {
@@ -449,6 +450,9 @@ void cmExtraCodeBlocksGenerator
       }
     }
 
+  std::vector<std::string> headerExts =
+      this->GlobalGenerator->GetCMakeInstance()->GetHeaderExtensions();
+
   // The following loop tries to add header files matching to implementation
   // files to the project. It does that by iterating over all
   // C/C++ source files,
@@ -468,8 +472,8 @@ void cmExtraCodeBlocksGenerator
 
     // check if there's a matching header around
     for(std::vector<std::string>::const_iterator
-        ext = mf->GetHeaderExtensions().begin();
-        ext !=  mf->GetHeaderExtensions().end();
+        ext = headerExts.begin();
+        ext != headerExts.end();
         ++ext)
       {
       std::string hname=headerBasename;
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index f4a6537..67aa157 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -149,6 +149,11 @@ void cmExtraCodeLiteGenerator
   // which may have an acompanying header, one for all other files
   std::string projectType;
 
+  std::vector<std::string> srcExts =
+      this->GlobalGenerator->GetCMakeInstance()->GetSourceExtensions();
+  std::vector<std::string> headerExts =
+      this->GlobalGenerator->GetCMakeInstance()->GetHeaderExtensions();
+
   std::map<std::string, cmSourceFile*> cFiles;
   std::set<std::string> otherFiles;
   for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin();
@@ -207,9 +212,7 @@ void cmExtraCodeLiteGenerator
               {
               std::string srcext = (*si)->GetExtension();
               for(std::vector<std::string>::const_iterator
-                  ext = mf->GetSourceExtensions().begin();
-                  ext !=  mf->GetSourceExtensions().end();
-                  ++ext)
+                  ext = srcExts.begin(); ext != srcExts.end(); ++ext)
                 {
                 if (srcext == *ext)
                   {
@@ -253,8 +256,8 @@ void cmExtraCodeLiteGenerator
 
     // check if there's a matching header around
     for(std::vector<std::string>::const_iterator
-        ext = mf->GetHeaderExtensions().begin();
-        ext !=  mf->GetHeaderExtensions().end();
+        ext = headerExts.begin();
+        ext != headerExts.end();
         ++ext)
       {
       std::string hname=headerBasename;
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 7c6c48c..018ab24 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -105,6 +105,9 @@ bool cmGlobalKdevelopGenerator
   std::set<std::string> files;
   std::string tmp;
 
+  std::vector<std::string> hdrExts =
+      this->GlobalGenerator->GetCMakeInstance()->GetHeaderExtensions();
+
   for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin();
        it!=lgs.end(); it++)
     {
@@ -160,8 +163,7 @@ bool cmGlobalKdevelopGenerator
 
           // check if there's a matching header around
           for(std::vector<std::string>::const_iterator
-                ext = makefile->GetHeaderExtensions().begin();
-              ext !=  makefile->GetHeaderExtensions().end(); ++ext)
+                ext = hdrExts.begin(); ext != hdrExts.end(); ++ext)
             {
             std::string hname=headerBasename;
             hname += ".";
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 9a5c367..5737bee 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1420,7 +1420,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt)
 bool cmGlobalXCodeGenerator::IsHeaderFile(cmSourceFile* sf)
 {
   const std::vector<std::string>& hdrExts =
-    this->CurrentMakefile->GetHeaderExtensions();
+    this->CMakeInstance->GetHeaderExtensions();
   return (std::find(hdrExts.begin(), hdrExts.end(), sf->GetExtension()) !=
           hdrExts.end());
 }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 361aa99..3bf34e2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -57,31 +57,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
 
   // Setup the default include complaint regular expression (match nothing).
   this->ComplainFileRegularExpression = "^$";
-  // Source and header file extensions that we can handle
-
-  // Set up a list of source and header extensions
-  // these are used to find files when the extension
-  // is not given
-  // The "c" extension MUST precede the "C" extension.
-  this->SourceFileExtensions.push_back( "c" );
-  this->SourceFileExtensions.push_back( "C" );
-
-  this->SourceFileExtensions.push_back( "c++" );
-  this->SourceFileExtensions.push_back( "cc" );
-  this->SourceFileExtensions.push_back( "cpp" );
-  this->SourceFileExtensions.push_back( "cxx" );
-  this->SourceFileExtensions.push_back( "m" );
-  this->SourceFileExtensions.push_back( "M" );
-  this->SourceFileExtensions.push_back( "mm" );
-
-  this->HeaderFileExtensions.push_back( "h" );
-  this->HeaderFileExtensions.push_back( "hh" );
-  this->HeaderFileExtensions.push_back( "h++" );
-  this->HeaderFileExtensions.push_back( "hm" );
-  this->HeaderFileExtensions.push_back( "hpp" );
-  this->HeaderFileExtensions.push_back( "hxx" );
-  this->HeaderFileExtensions.push_back( "in" );
-  this->HeaderFileExtensions.push_back( "txx" );
 
   this->DefineFlags = " ";
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 725448b..f3dbb74 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -425,17 +425,6 @@ public:
   cmSourceFile* GetOrCreateSource(const std::string& sourceName,
                                   bool generated = false);
 
-  //@{
-  /**
-   * Return a list of extensions associated with source and header
-   * files
-   */
-  const std::vector<std::string>& GetSourceExtensions() const
-    {return this->SourceFileExtensions;}
-  const std::vector<std::string>& GetHeaderExtensions() const
-    {return this->HeaderFileExtensions;}
-  //@}
-
   /**
    * Given a variable name, return its value (as a string).
    * If the variable is not found in this makefile instance, the
@@ -823,8 +812,6 @@ protected:
   std::vector<cmTestGenerator*> TestGenerators;
 
   std::string ComplainFileRegularExpression;
-  std::vector<std::string> SourceFileExtensions;
-  std::vector<std::string> HeaderFileExtensions;
   std::string DefineFlags;
 
   // Track the value of the computed DEFINITIONS property.
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index fc690f8..b16eccd 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -528,7 +528,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
   cmSystemTools::ExpandListArgument(this->Sources, sourceFiles);
 
   const std::vector<std::string>& headerExtensions =
-                                               makefile->GetHeaderExtensions();
+      makefile->GetCMakeInstance()->GetHeaderExtensions();
 
   std::map<std::string, std::vector<std::string> > includedUis;
   std::map<std::string, std::vector<std::string> > skippedUis;
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 37383be..a9ac549 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -167,8 +167,10 @@ bool cmSourceFile::FindFullPath(std::string* error)
     {
     tryDirs[0] = "";
     }
-  const std::vector<std::string>& srcExts = mf->GetSourceExtensions();
-  const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
+  const std::vector<std::string>& srcExts =
+      mf->GetCMakeInstance()->GetSourceExtensions();
+  std::vector<std::string> hdrExts =
+      mf->GetCMakeInstance()->GetHeaderExtensions();
   for(const char* const* di = tryDirs; *di; ++di)
     {
     std::string tryPath = this->Location.GetDirectory();
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index b8d5c02..00d5d6a 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -121,8 +121,10 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name)
   // The global generator checks extensions of enabled languages.
   cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
   cmMakefile const* mf = this->Makefile;
-  const std::vector<std::string>& srcExts = mf->GetSourceExtensions();
-  const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
+  const std::vector<std::string>& srcExts =
+      mf->GetCMakeInstance()->GetSourceExtensions();
+  const std::vector<std::string>& hdrExts =
+      mf->GetCMakeInstance()->GetHeaderExtensions();
   if(!gg->GetLanguageFromExtension(ext.c_str()).empty() ||
      std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end() ||
      std::find(hdrExts.begin(), hdrExts.end(), ext) != hdrExts.end())
@@ -193,12 +195,14 @@ cmSourceFileLocation
   // disk.  One of these must match if loc refers to this source file.
   std::string const& ext = this->Name.substr(loc.Name.size()+1);
   cmMakefile const* mf = this->Makefile;
-  const std::vector<std::string>& srcExts = mf->GetSourceExtensions();
+  const std::vector<std::string>& srcExts =
+      mf->GetCMakeInstance()->GetSourceExtensions();
   if(std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end())
     {
     return true;
     }
-  const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
+  std::vector<std::string> hdrExts =
+      mf->GetCMakeInstance()->GetHeaderExtensions();
   if(std::find(hdrExts.begin(), hdrExts.end(), ext) != hdrExts.end())
     {
     return true;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 7268241..16417fc 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -165,6 +165,30 @@ cmake::cmake()
 
   // Make sure we can capture the build tool output.
   cmSystemTools::EnableVSConsoleOutput();
+
+  // Set up a list of source and header extensions
+  // these are used to find files when the extension
+  // is not given
+  // The "c" extension MUST precede the "C" extension.
+  this->SourceFileExtensions.push_back( "c" );
+  this->SourceFileExtensions.push_back( "C" );
+
+  this->SourceFileExtensions.push_back( "c++" );
+  this->SourceFileExtensions.push_back( "cc" );
+  this->SourceFileExtensions.push_back( "cpp" );
+  this->SourceFileExtensions.push_back( "cxx" );
+  this->SourceFileExtensions.push_back( "m" );
+  this->SourceFileExtensions.push_back( "M" );
+  this->SourceFileExtensions.push_back( "mm" );
+
+  this->HeaderFileExtensions.push_back( "h" );
+  this->HeaderFileExtensions.push_back( "hh" );
+  this->HeaderFileExtensions.push_back( "h++" );
+  this->HeaderFileExtensions.push_back( "hm" );
+  this->HeaderFileExtensions.push_back( "hpp" );
+  this->HeaderFileExtensions.push_back( "hxx" );
+  this->HeaderFileExtensions.push_back( "in" );
+  this->HeaderFileExtensions.push_back( "txx" );
 }
 
 cmake::~cmake()
diff --git a/Source/cmake.h b/Source/cmake.h
index 9d28cba..6b0e83f 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -182,6 +182,11 @@ class cmake
   ///! get the cmCachemManager used by this invocation of cmake
   cmCacheManager *GetCacheManager() { return this->CacheManager; }
 
+  const std::vector<std::string>& GetSourceExtensions() const
+    {return this->SourceFileExtensions;}
+  const std::vector<std::string>& GetHeaderExtensions() const
+    {return this->HeaderFileExtensions;}
+
   /**
    * Given a variable name, return its value (as a string).
    */
@@ -391,6 +396,8 @@ private:
   std::string CheckStampFile;
   std::string CheckStampList;
   std::string VSSolutionFile;
+  std::vector<std::string> SourceFileExtensions;
+  std::vector<std::string> HeaderFileExtensions;
   bool ClearBuildSystem;
   bool DebugTryCompile;
   cmFileTimeComparison* FileComparison;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6bd7bd1e06fcf92d40c762f2713626d125cb8f87
commit 6bd7bd1e06fcf92d40c762f2713626d125cb8f87
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 24 13:30:06 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:22 2015 +0100

    Export: Use existing IsDLLPlatform porcelain

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 23c11d7..9e36539 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -213,12 +213,8 @@ cmExportBuildFileGenerator
   properties[prop] = value;
   }
 
-  // Check whether this is a DLL platform.
-  bool dll_platform =
-    (mf->IsOn("WIN32") || mf->IsOn("CYGWIN") || mf->IsOn("MINGW"));
-
   // Add the import library for windows DLLs.
-  if(dll_platform &&
+  if(target->IsDLLPlatform() &&
      (target->GetType() == cmState::SHARED_LIBRARY ||
       target->IsExecutableWithExports()) &&
      mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index d52ce35..e8a2e6a 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -879,10 +879,7 @@ cmExportFileGenerator
   if(target->GetType() == cmState::SHARED_LIBRARY ||
      target->GetType() == cmState::MODULE_LIBRARY)
     {
-    // Check whether this is a DLL platform.
-    bool dll_platform =
-      (mf->IsOn("WIN32") || mf->IsOn("CYGWIN") || mf->IsOn("MINGW"));
-    if(!dll_platform)
+    if(!target->IsDLLPlatform())
       {
       std::string prop;
       std::string value;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b397eae82e14fdf75eddcbfd022d9f2d5933eb1e
commit b397eae82e14fdf75eddcbfd022d9f2d5933eb1e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Oct 24 09:29:49 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:21 2015 +0100

    cmGeneratorTarget: Move LinkLanguagePropagatesToDependents from cmTarget

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 7e75d93..df6e3fb 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -999,7 +999,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 
     if (propertyName == "LINKER_LANGUAGE")
       {
-      if (target->Target->LinkLanguagePropagatesToDependents() &&
+      if (target->LinkLanguagePropagatesToDependents() &&
           dagCheckerParent && (dagCheckerParent->EvaluatingLinkLibraries()
             || dagCheckerParent->EvaluatingSources()))
         {
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index eb433f5..651c89c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4770,7 +4770,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
     iface.WrongConfigLibraries = impl->WrongConfigLibraries;
     }
 
-  if(this->Target->LinkLanguagePropagatesToDependents())
+  if(this->LinkLanguagePropagatesToDependents())
     {
     // Targets using this archive need its language runtime libraries.
     if(cmLinkImplementation const* impl =
@@ -5485,7 +5485,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
   }
 
   // Get the link languages.
-  if(this->Target->LinkLanguagePropagatesToDependents())
+  if(this->LinkLanguagePropagatesToDependents())
     {
     std::string linkProp = "IMPORTED_LINK_INTERFACE_LANGUAGES";
     linkProp += suffix;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 588ff33..58c3421 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -189,6 +189,9 @@ public:
   std::set<std::string>const& GetUtilities() const;
   cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
 
+  bool LinkLanguagePropagatesToDependents() const
+  { return this->GetType() == cmState::STATIC_LIBRARY; }
+
   /** Get the macro to define when building sources in this target.
       If no macro should be defined null is returned.  */
   const char* GetExportMacro() const;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 17a1d4d..541e850 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -227,9 +227,6 @@ public:
   std::set<std::string> const & GetSystemIncludeDirectories() const
     { return this->SystemIncludeDirectories; }
 
-  bool LinkLanguagePropagatesToDependents() const
-  { return this->TargetTypeValue == cmState::STATIC_LIBRARY; }
-
   cmStringRange GetIncludeDirectoriesEntries() const;
   cmBacktraceRange GetIncludeDirectoriesBacktraces() const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00b8c0a8d4b59dc01276d083ccae4a8138718b12
commit 00b8c0a8d4b59dc01276d083ccae4a8138718b12
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 23 01:17:32 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:21 2015 +0100

    cmLocalGenerator: Add IsRootMakefile API

diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index b4a915c..7dd24fb 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -523,7 +523,7 @@ cmGlobalUnixMakefileGenerator3
                        cmLocalUnixMakefileGenerator3* lg)
 {
   // Only subdirectories need these rules.
-  if(lg->GetMakefile()->IsRootMakefile())
+  if(lg->IsRootMakefile())
     {
     return;
     }
@@ -1084,7 +1084,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.
       std::vector<cmGeneratorTarget*> targets = lg2->GetGeneratorTargets();
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 5f0242e..1926772 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -490,6 +490,11 @@ void cmLocalGenerator::ComputeTargetManifest()
     }
 }
 
+bool cmLocalGenerator::IsRootMakefile() const
+{
+  return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
+}
+
 cmState* cmLocalGenerator::GetState() const
 {
   return this->GlobalGenerator->GetCMakeInstance()->GetState();
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 6380db6..46eb1b3 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -67,6 +67,8 @@ public:
    */
   void ComputeTargetManifest();
 
+  bool IsRootMakefile() const;
+
   ///! Get the makefile for this generator
   cmMakefile *GetMakefile() {
     return this->Makefile; }
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 891c44e..7de48a4 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -56,7 +56,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();
 
@@ -277,7 +277,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.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 9bb2765..82e3b01 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -254,7 +254,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
     return;
     }
   // always write the top makefile
-  if (!this->GetMakefile()->IsRootMakefile())
+  if (!this->IsRootMakefile())
     {
     ruleFileStream.SetCopyIfDifferent(true);
     }
@@ -265,7 +265,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
   // only write local targets unless at the top Keep track of targets already
   // listed.
   std::set<std::string> emittedTargets;
-  if (!this->GetMakefile()->IsRootMakefile())
+  if (!this->IsRootMakefile())
     {
     // write our targets, and while doing it collect up the object
     // file rules
@@ -880,7 +880,7 @@ void cmLocalUnixMakefileGenerator3
   std::vector<std::string> no_depends;
   std::vector<std::string> commands;
   commands.push_back(runRule);
-  if(!this->GetMakefile()->IsRootMakefile())
+  if(!this->IsRootMakefile())
     {
     this->CreateCDCommand(commands,
                           this->GetBinaryDirectory(),

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c6374bcc56ea7d7f7e67c518e60de94be267256
commit 4c6374bcc56ea7d7f7e67c518e60de94be267256
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 23 01:14:08 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:21 2015 +0100

    Genex: use cmGeneratorTarget policy API

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 03f8d3f..7e75d93 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1442,7 +1442,7 @@ cmPolicies::PolicyStatus statusForTarget(cmGeneratorTarget const* tgt,
 #define RETURN_POLICY(POLICY) \
   if (strcmp(policy, #POLICY) == 0) \
   { \
-    return tgt->Target->GetPolicyStatus ## POLICY (); \
+    return tgt->GetPolicyStatus ## POLICY (); \
   } \
 
   CM_FOR_EACH_TARGET_POLICY(RETURN_POLICY)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d409f500e3403f8dbb4a0fee6ecdad94f45c35e
commit 7d409f500e3403f8dbb4a0fee6ecdad94f45c35e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 23 01:13:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:21 2015 +0100

    cmLocalGenerator: Add GetPolicyStatus API

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 7a7e4ff..03f8d3f 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -393,7 +393,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
 
     if (cmsysString_strcasecmp(parameters.begin()->c_str(), compilerId) == 0)
       {
-      switch(context->LG->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0044))
+      switch(context->LG->GetPolicyStatus(cmPolicies::CMP0044))
         {
         case cmPolicies::WARN:
           {
@@ -1100,7 +1100,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
                            "COMPILE_DEFINITIONS_"))
       {
       cmPolicies::PolicyStatus polSt =
-          context->LG->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0043);
+          context->LG->GetPolicyStatus(cmPolicies::CMP0043);
       if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD)
         {
         interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c37417d..5f0242e 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2201,7 +2201,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared,
 
     if (flags && flags != originalFlags)
       {
-      switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0018))
+      switch (this->GetPolicyStatus(cmPolicies::CMP0018))
         {
         case cmPolicies::WARN:
         {
@@ -2949,7 +2949,7 @@ bool cmLocalGenerator::NeedBackwardsCompatibility_2_4()
 {
   // Check the policy to decide whether to pay attention to this
   // variable.
-  switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0001))
+  switch(this->GetPolicyStatus(cmPolicies::CMP0001))
     {
     case cmPolicies::WARN:
       // WARN is just OLD without warning because user code does not
@@ -2976,6 +2976,12 @@ bool cmLocalGenerator::NeedBackwardsCompatibility_2_4()
           actual_compat <= CMake_VERSION_ENCODE(2, 4, 255));
 }
 
+cmPolicies::PolicyStatus
+cmLocalGenerator::GetPolicyStatus(cmPolicies::PolicyID id) const
+{
+  return this->Makefile->GetPolicyStatus(id);
+}
+
 //----------------------------------------------------------------------------
 bool cmLocalGenerator::CheckDefinition(std::string const& define) const
 {
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 552020b..6380db6 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -265,6 +265,8 @@ public:
    */
   bool NeedBackwardsCompatibility_2_4();
 
+  cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
+
   cmake* GetCMakeInstance() const;
 
   const char* GetSourceDirectory() const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7a1b83cb3fc79639b9e2c1bf11af2d2274e4224a
commit 7a1b83cb3fc79639b9e2c1bf11af2d2274e4224a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 23 01:04:07 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:21 2015 +0100

    cmGeneratorTarget: Add GetUtilityBacktrace API

diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 113c989..586b5bf 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -382,7 +382,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);
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 7d5a9d0..eb433f5 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1742,6 +1742,12 @@ const std::set<std::string>& cmGeneratorTarget::GetUtilities() const
   return this->Target->GetUtilities();
 }
 
+const cmListFileBacktrace*
+cmGeneratorTarget::GetUtilityBacktrace(const std::string& u) const
+{
+  return this->Target->GetUtilityBacktrace(u);
+}
+
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index ff975c5..588ff33 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -187,6 +187,8 @@ public:
   const std::vector<std::string>& GetLinkDirectories() const;
 
   std::set<std::string>const& GetUtilities() const;
+  cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
+
   /** Get the macro to define when building sources in this target.
       If no macro should be defined null is returned.  */
   const char* GetExportMacro() const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=736c2042c6bade0322441aafabababcbd92af52e
commit 736c2042c6bade0322441aafabababcbd92af52e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 23 01:01:46 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:20 2015 +0100

    cmGeneratorTarget: Add GetUtilities API

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 7516576..7d5a9d0 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -796,7 +796,7 @@ std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
   if(!this->UtilityItemsDone)
     {
     this->UtilityItemsDone = true;
-    std::set<std::string> const& utilities = this->Target->GetUtilities();
+    std::set<std::string> const& utilities = this->GetUtilities();
     for(std::set<std::string>::const_iterator i = utilities.begin();
         i != utilities.end(); ++i)
       {
@@ -1737,6 +1737,11 @@ const std::vector<std::string>&cmGeneratorTarget::GetLinkDirectories() const
   return this->Target->GetLinkDirectories();
 }
 
+const std::set<std::string>& cmGeneratorTarget::GetUtilities() const
+{
+  return this->Target->GetUtilities();
+}
+
 //----------------------------------------------------------------------------
 bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 38e1826..ff975c5 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -186,6 +186,7 @@ public:
 
   const std::vector<std::string>& GetLinkDirectories() const;
 
+  std::set<std::string>const& GetUtilities() const;
   /** Get the macro to define when building sources in this target.
       If no macro should be defined null is returned.  */
   const char* GetExportMacro() const;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 2671f4d..8498e39 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -965,7 +965,7 @@ cmGlobalNinjaGenerator
   if (target->GetType() == cmState::GLOBAL_TARGET) {
     // Global targets only depend on other utilities, which may not appear in
     // the TargetDepends set (e.g. "all").
-    std::set<std::string> const& utils = target->Target->GetUtilities();
+    std::set<std::string> const& utils = target->GetUtilities();
     std::copy(utils.begin(), utils.end(), std::back_inserter(outputs));
   } else {
     cmTargetDependSet const& targetDeps = this->GetTargetDirectDepends(target);
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index bb494f1..5866c0e 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -235,7 +235,7 @@ void cmGlobalVisualStudio6Generator
       std::string project = target->GetName();
       std::string location = expath;
       this->WriteExternalProject(fout, project.c_str(),
-          location.c_str(), target->Target->GetUtilities());
+          location.c_str(), target->GetUtilities());
       }
     else
       {
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 5473247..340a0f7 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -459,7 +459,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
                                  project.c_str(),
                                  location.c_str(),
                                  target->GetProperty("VS_PROJECT_TYPE"),
-                                 target->Target->GetUtilities());
+                                 target->GetUtilities());
       written = true;
       }
     else
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index bdb1b25..b771f11 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -464,8 +464,8 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
 {
   // Look for utility dependencies that magically link.
   for(std::set<std::string>::const_iterator ui =
-        target->Target->GetUtilities().begin();
-      ui != target->Target->GetUtilities().end(); ++ui)
+        target->GetUtilities().begin();
+      ui != target->GetUtilities().end(); ++ui)
     {
     if(cmGeneratorTarget* depTarget =
         target->GetLocalGenerator()->FindGeneratorTargetToUse(ui->c_str()))
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 541257b..9bb2765 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1778,8 +1778,8 @@ void cmLocalUnixMakefileGenerator3
         {
         text = "Running external command ...";
         }
-      depends.insert(depends.end(), (*glIt)->Target->GetUtilities().begin(),
-                     (*glIt)->Target->GetUtilities().end());
+      depends.insert(depends.end(), (*glIt)->GetUtilities().begin(),
+                     (*glIt)->GetUtilities().end());
       this->AppendEcho(commands, text,
                        cmLocalUnixMakefileGenerator3::EchoGlobal);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f210cb131e5814631d6d2974cf2437632446654f
commit f210cb131e5814631d6d2974cf2437632446654f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 23 00:59:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 27 07:44:20 2015 +0100

    cmTarget: Make compatbility API explicit.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 40e2892..361aa99 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -756,15 +756,26 @@ void cmMakefile::ConfigureFinalPass()
       "with CMake 2.4 or later. For compatibility with older versions please "
       "use any CMake 2.8.x release or lower.");
     }
-  for (cmTargets::iterator l = this->Targets.begin();
-       l != this->Targets.end(); l++)
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  // Do old-style link dependency analysis only for CM_USE_OLD_VS6.
+  if(this->GetGlobalGenerator()->IsForVS6())
     {
-    if (l->second.GetType() == cmState::INTERFACE_LIBRARY)
+    for (cmTargets::iterator l = this->Targets.begin();
+         l != this->Targets.end(); l++)
       {
-      continue;
+      if (l->second.GetType() == cmState::INTERFACE_LIBRARY)
+        {
+        continue;
+        }
+      // Erase any cached link information that might have been comptued
+      // on-demand during the configuration.  This ensures that build
+      // system generation uses up-to-date information even if other cache
+      // invalidation code in this source file is buggy.
+
+      l->second.AnalyzeLibDependenciesForVS6(*this);
       }
-    l->second.FinishConfigure();
     }
+#endif
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0c0cf8e..c887fc8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -315,23 +315,6 @@ cmListFileBacktrace const* cmTarget::GetUtilityBacktrace(
 }
 
 //----------------------------------------------------------------------------
-void cmTarget::FinishConfigure()
-{
-  // Erase any cached link information that might have been comptued
-  // on-demand during the configuration.  This ensures that build
-  // system generation uses up-to-date information even if other cache
-  // invalidation code in this source file is buggy.
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-  // Do old-style link dependency analysis only for CM_USE_OLD_VS6.
-  if(this->Makefile->GetGlobalGenerator()->IsForVS6())
-    {
-    this->AnalyzeLibDependenciesForVS6(*this->Makefile);
-    }
-#endif
-}
-
-//----------------------------------------------------------------------------
 cmListFileBacktrace const& cmTarget::GetBacktrace() const
 {
   return this->Backtrace;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 7e7e34a..17a1d4d 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -176,9 +176,6 @@ public:
   std::set<std::string>const& GetUtilities() const { return this->Utilities; }
   cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
 
-  /** Finalize the target at the end of the Configure step.  */
-  void FinishConfigure();
-
   ///! Set/Get a property of this target file
   void SetProperty(const std::string& prop, const char *value);
   void AppendProperty(const std::string&  prop, const char* value,
@@ -250,10 +247,11 @@ public:
   cmStringRange GetLinkImplementationEntries() const;
   cmBacktraceRange GetLinkImplementationBacktraces() const;
 
-
 #if defined(_WIN32) && !defined(__CYGWIN__)
   const LinkLibraryVectorType &GetLinkLibrariesForVS6() const {
   return this->LinkLibrariesForVS6;}
+
+  void AnalyzeLibDependenciesForVS6( const cmMakefile& mf );
 #endif
 
   struct StrictTargetComparison {
@@ -312,8 +310,6 @@ private:
   void GatherDependenciesForVS6( const cmMakefile& mf,
                                  const LibraryID& lib,
                                  DependencyMap& dep_map);
-
-  void AnalyzeLibDependenciesForVS6( const cmMakefile& mf );
 #endif
 
   const char* GetSuffixVariableInternal(bool implib) const;

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list