[Cmake-commits] CMake branch, next, updated. v2.8.12.1-7031-g121302e

Stephen Kelly steveire at gmail.com
Sat Jan 11 08:19:26 EST 2014


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  121302e0ca5e4c6de6a40686a5a46b9189f88e49 (commit)
       via  fd8572177ba7f338072ba04e0e8488847e9e6ba3 (commit)
      from  971791f4a36fb419a545d9f0bc0a5ac02d54b44b (commit)

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

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=121302e0ca5e4c6de6a40686a5a46b9189f88e49
commit 121302e0ca5e4c6de6a40686a5a46b9189f88e49
Merge: 971791f fd85721
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 11 08:19:25 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Jan 11 08:19:25 2014 -0500

    Merge topic 'fix-find-package-mode' into next
    
    fd85721 Fix find-package mode.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd8572177ba7f338072ba04e0e8488847e9e6ba3
commit fd8572177ba7f338072ba04e0e8488847e9e6ba3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 11 14:17:03 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jan 11 14:18:51 2014 +0100

    Fix find-package mode.
    
    Create cmGeneratorTargets before generating generate-time information.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f883fbe..5a6b9b0 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1375,35 +1375,37 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
 }
 
 //----------------------------------------------------------------------------
+void cmGlobalGenerator::CreateGeneratorTargets(cmMakefile *mf)
+{
+  cmGeneratorTargetsType generatorTargets;
+  cmTargets& targets = mf->GetTargets();
+  for(cmTargets::iterator ti = targets.begin();
+      ti != targets.end(); ++ti)
+    {
+    cmTarget* t = &ti->second;
+    cmGeneratorTarget* gt = new cmGeneratorTarget(t);
+    this->GeneratorTargets[t] = gt;
+    generatorTargets[t] = gt;
+    }
+
+  for(std::vector<cmTarget*>::const_iterator
+        j = mf->GetOwnedImportedTargets().begin();
+      j != mf->GetOwnedImportedTargets().end(); ++j)
+    {
+    cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
+    this->GeneratorTargets[*j] = gt;
+    generatorTargets[*j] = gt;
+    }
+  mf->SetGeneratorTargets(generatorTargets);
+}
+
+//----------------------------------------------------------------------------
 void cmGlobalGenerator::CreateGeneratorTargets()
 {
   // Construct per-target generator information.
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
-    cmGeneratorTargetsType generatorTargets;
-
-    cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
-
-    cmTargets& targets = mf->GetTargets();
-    for(cmTargets::iterator ti = targets.begin();
-        ti != targets.end(); ++ti)
-      {
-      cmTarget* t = &ti->second;
-      cmGeneratorTarget* gt = new cmGeneratorTarget(t);
-      this->GeneratorTargets[t] = gt;
-      generatorTargets[t] = gt;
-      }
-
-    for(std::vector<cmTarget*>::const_iterator
-          j = mf->GetOwnedImportedTargets().begin();
-        j != mf->GetOwnedImportedTargets().end(); ++j)
-      {
-      cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
-      this->GeneratorTargets[*j] = gt;
-      generatorTargets[*j] = gt;
-      }
-
-    mf->SetGeneratorTargets(generatorTargets);
+    this->CreateGeneratorTargets(this->LocalGenerators[i]->GetMakefile());
     }
 }
 
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index fc5cab9..bbfe442 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -432,6 +432,8 @@ private:
 
   // Per-target generator information.
   cmGeneratorTargetsType GeneratorTargets;
+  friend class cmake;
+  void CreateGeneratorTargets(cmMakefile* mf);
   void CreateGeneratorTargets();
   void ComputeGeneratorTargetObjects();
   virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 1dd8a66..cf4b9c3 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -593,9 +593,10 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
     std::string linkPath;
     std::string flags;
     std::string linkFlags;
-    cmGeneratorTarget gtgt(tgt);
+    gg->CreateGeneratorTargets(mf);
+    cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
     lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
-                       &gtgt);
+                       gtgt);
     linkLibs = frameworkPath + linkPath + linkLibs;
 
     printf("%s\n", linkLibs.c_str() );

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

Summary of changes:
 Source/cmGlobalGenerator.cxx |   50 +++++++++++++++++++++--------------------
 Source/cmGlobalGenerator.h   |    2 +
 Source/cmake.cxx             |    5 ++-
 3 files changed, 31 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list