[Cmake-commits] CMake branch, next, updated. v3.4.0-rc2-1050-g4f9e8fe

Stephen Kelly steveire at gmail.com
Mon Oct 26 18:22:21 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  4f9e8feff6fdfe494c2593f9a134b9bdf95482c6 (commit)
       via  f612829d6646566c22e52801dcef139eaf93138c (commit)
       via  a8c067ddda62aa792afdd3cad96c7b5e91782044 (commit)
       via  f2071631488fbc22d309bef66e839f21bfa996a2 (commit)
       via  cc35daad41c2dca7625f0cb509083eaf18df1d2a (commit)
      from  e7e0c3d2bf5acdfe910f88f82649e9ee77eeb51f (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=4f9e8feff6fdfe494c2593f9a134b9bdf95482c6
commit 4f9e8feff6fdfe494c2593f9a134b9bdf95482c6
Merge: e7e0c3d f612829
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 26 18:22:20 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 26 18:22:20 2015 -0400

    Merge topic 'use-generator-target' into next
    
    f612829d cmGlobalGenerator: Remove map from cmTarget to cmGeneratorTarget
    a8c067dd cmLocalGenerator: Port Find method away from GetGeneratorTarget
    f2071631 VS6: Port to FindGeneratorTarget
    cc35daad cmake: Port find_package mode away from GetGeneratorTarget


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f612829d6646566c22e52801dcef139eaf93138c
commit f612829d6646566c22e52801dcef139eaf93138c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:22:42 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 26 23:19:50 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 c205d1a..9f36b54 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=a8c067ddda62aa792afdd3cad96c7b5e91782044
commit a8c067ddda62aa792afdd3cad96c7b5e91782044
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:14:44 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 26 23:19:50 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=f2071631488fbc22d309bef66e839f21bfa996a2
commit f2071631488fbc22d309bef66e839f21bfa996a2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:19:38 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 26 23:19:49 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=cc35daad41c2dca7625f0cb509083eaf18df1d2a
commit cc35daad41c2dca7625f0cb509083eaf18df1d2a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 14:17:56 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 26 23:19:38 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;

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

Summary of changes:
 Source/cmGlobalGenerator.cxx              |   59 ++++++++++++++---------------
 Source/cmGlobalGenerator.h                |   18 ++-------
 Source/cmGlobalVisualStudio8Generator.cxx |    1 -
 Source/cmGlobalVisualStudioGenerator.cxx  |    1 -
 Source/cmGlobalXCodeGenerator.cxx         |    2 -
 Source/cmLocalGenerator.cxx               |   23 +++++++++--
 Source/cmLocalGenerator.h                 |    7 ++++
 Source/cmLocalVisualStudio6Generator.cxx  |    9 ++---
 Source/cmQtAutoGeneratorInitializer.cxx   |    1 -
 Source/cmake.cxx                          |   11 ++++--
 10 files changed, 69 insertions(+), 63 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list