[Cmake-commits] CMake branch, next, updated. v3.3.0-rc1-397-gb69e00e

Stephen Kelly steveire at gmail.com
Tue Jun 9 18:42:43 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  b69e00ef11fcb1f5be98c89521c5b68606dd6ccc (commit)
       via  b2b45dbc92f9035986a0243099b4b4158873d6eb (commit)
      from  ce04885e702fc43249723e4ddccf7754309b1308 (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=b69e00ef11fcb1f5be98c89521c5b68606dd6ccc
commit b69e00ef11fcb1f5be98c89521c5b68606dd6ccc
Merge: ce04885 b2b45db
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jun 9 18:42:42 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 9 18:42:42 2015 -0400

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

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

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b2b45dbc92f9035986a0243099b4b4158873d6eb
commit b2b45dbc92f9035986a0243099b4b4158873d6eb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jun 10 00:41:56 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jun 10 00:42:15 2015 +0200

    Revert topic.

diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index a31e832..e374387 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -313,7 +313,7 @@ void cmExtraCodeBlocksGenerator
         "      "<<virtualFolders<<"\n"
         "      <Build>\n";
 
-  this->AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str());
+  this->AppendTarget(fout, "all", 0, make.c_str(), mf, compiler.c_str());
 
   // add all executable and library targets and some of the GLOBAL
   // and UTILITY targets
@@ -335,7 +335,7 @@ void cmExtraCodeBlocksGenerator
                      makefile->GetHomeOutputDirectory())==0)
             {
             this->AppendTarget(fout, ti->first, 0,
-                               make.c_str(), *lg, compiler.c_str());
+                               make.c_str(), makefile, compiler.c_str());
             }
           }
           break;
@@ -351,7 +351,7 @@ void cmExtraCodeBlocksGenerator
             }
 
           this->AppendTarget(fout, ti->first, 0,
-                                 make.c_str(), *lg, compiler.c_str());
+                                 make.c_str(), makefile, compiler.c_str());
           break;
         case cmTarget::EXECUTABLE:
         case cmTarget::STATIC_LIBRARY:
@@ -360,11 +360,11 @@ void cmExtraCodeBlocksGenerator
         case cmTarget::OBJECT_LIBRARY:
           {
           this->AppendTarget(fout, ti->first, &ti->second,
-                             make.c_str(), *lg, compiler.c_str());
+                             make.c_str(), makefile, compiler.c_str());
           std::string fastTarget = ti->first;
           fastTarget += "/fast";
           this->AppendTarget(fout, fastTarget, &ti->second,
-                             make.c_str(), *lg, compiler.c_str());
+                             make.c_str(), makefile, compiler.c_str());
           }
           break;
         default:
@@ -519,16 +519,14 @@ void cmExtraCodeBlocksGenerator
 
 // Write a dummy file for OBJECT libraries, so C::B can reference some file
 std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
-                                        cmLocalGenerator* lg,
-                                        cmTarget* target) const
+                                        cmMakefile* mf, cmTarget* target) const
 {
-  cmMakefile *mf = lg->GetMakefile();
   // this file doesn't seem to be used by C::B in custom makefile mode,
   // but we generate a unique file for each OBJECT library so in case
   // C::B uses it in some way, the targets don't interfere with each other.
   std::string filename = mf->GetCurrentBinaryDirectory();
   filename += "/";
-  filename += lg->GetTargetDirectory(*target);
+  filename += mf->GetLocalGenerator()->GetTargetDirectory(*target);
   filename += "/";
   filename += target->GetName();
   filename += ".objlib";
@@ -549,10 +547,9 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
                                               const std::string& targetName,
                                               cmTarget* target,
                                               const char* make,
-                                              const cmLocalGenerator* lg,
+                                              const cmMakefile* makefile,
                                               const char* compiler)
 {
-  cmMakefile const* makefile = lg->GetMakefile();
   std::string makefileName = makefile->GetCurrentBinaryDirectory();
   makefileName += "/Makefile";
 
@@ -586,7 +583,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
     std::string location;
     if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
       {
-      location = this->CreateDummyTargetFile(const_cast<cmLocalGenerator*>(lg),
+      location = this->CreateDummyTargetFile(const_cast<cmMakefile*>(makefile),
                                              target);
       }
     else
@@ -621,7 +618,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
     std::set<std::string> uniqIncludeDirs;
 
     std::vector<std::string> includes;
-    lg->GetIncludeDirectories(includes, gtgt, "C", buildType);
+    target->GetMakefile()->GetLocalGenerator()->
+      GetIncludeDirectories(includes, gtgt, "C", buildType);
 
     uniqIncludeDirs.insert(includes.begin(), includes.end());
 
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index e5ede9a..97da1b8 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -48,8 +48,7 @@ private:
 
   void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
                                 const std::string& filename);
-  std::string CreateDummyTargetFile(cmLocalGenerator* lg,
-                                    cmTarget* target) const;
+  std::string CreateDummyTargetFile(cmMakefile* mf, cmTarget* target) const;
 
   std::string GetCBCompilerId(const cmMakefile* mf);
   int GetCBTargetType(cmTarget* target);
@@ -59,7 +58,7 @@ private:
                     const std::string& targetName,
                     cmTarget* target,
                     const char* make,
-                    const cmLocalGenerator* lg,
+                    const cmMakefile* makefile,
                     const char* compiler);
 
 };
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 7aeb613..67d0d54 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -220,20 +220,14 @@ struct TagVisitor
 };
 
 //----------------------------------------------------------------------------
-cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
-  : Target(t),
+cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t),
   SourceFileFlagsConstructed(false)
 {
   this->Makefile = this->Target->GetMakefile();
-  this->LocalGenerator = lg;
+  this->LocalGenerator = this->Makefile->GetLocalGenerator();
   this->GlobalGenerator = this->Makefile->GetGlobalGenerator();
 }
 
-cmLocalGenerator* cmGeneratorTarget::GetLocalGenerator() const
-{
-  return this->LocalGenerator;
-}
-
 //----------------------------------------------------------------------------
 int cmGeneratorTarget::GetType() const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 675ee9f..a8edcb8 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -24,9 +24,7 @@ class cmTarget;
 class cmGeneratorTarget
 {
 public:
-  cmGeneratorTarget(cmTarget*, cmLocalGenerator* lg);
-
-  cmLocalGenerator* GetLocalGenerator() const;
+  cmGeneratorTarget(cmTarget*);
 
   int GetType() const;
   std::string GetName() const;
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index a0ea079..01e2011 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -21,23 +21,23 @@
 
 std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
 
-cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target)
-  : Target(target->Target)
+cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget *target)
+  : Target(target)
   , LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
-                     target->GetLocalGenerator()))
-  , Makefile(target->Target->GetMakefile())
-  , TargetGroup(DetermineIfTargetGroup(target->Target))
+                     target->GetMakefile()->GetLocalGenerator()))
+  , Makefile(target->GetMakefile())
+  , TargetGroup(DetermineIfTargetGroup(target))
   , DynamicDownload(false)
 {
-  this->RelBuildFilePath = this->GetRelBuildFilePath(target->Target);
+  this->RelBuildFilePath = this->GetRelBuildFilePath(target);
 
   this->RelOutputFileName =
     this->RelBuildFilePath + this->Target->GetName() + ".a";
 
   this->RelBuildFileName = this->RelBuildFilePath;
-  this->RelBuildFileName += this->GetBuildFileName(target->Target);
+  this->RelBuildFileName += this->GetBuildFileName(target);
 
-  std::string absPathToRoot = this->GetAbsPathToRoot(target->Target);
+  std::string absPathToRoot = this->GetAbsPathToRoot(target);
   absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
   this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
   this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
@@ -373,6 +373,7 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
     cmTarget *tg(GetGlobalGenerator()->FindTarget(libName));
     if (NULL != tg)
       {
+      cmGhsMultiTargetGenerator gmtg(tg);
       libName = tg->GetName() + ".a";
       }
     *this->GetFolderBuildStreams() << "    -l\"" << libName << "\""
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index fc9532a..8e81db8 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -27,7 +27,7 @@ class cmCustomCommand;
 class cmGhsMultiTargetGenerator
 {
 public:
-  cmGhsMultiTargetGenerator(cmGeneratorTarget* target);
+  cmGhsMultiTargetGenerator(cmTarget *target);
 
   virtual ~cmGhsMultiTargetGenerator();
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 5d22cd7..bd949bb 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1451,16 +1451,15 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
+void cmGlobalGenerator::CreateGeneratorTargets(cmMakefile *mf)
 {
   cmGeneratorTargetsType generatorTargets;
-  cmMakefile* mf = lg->GetMakefile();
   cmTargets& targets = mf->GetTargets();
   for(cmTargets::iterator ti = targets.begin();
       ti != targets.end(); ++ti)
     {
     cmTarget* t = &ti->second;
-    cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
+    cmGeneratorTarget* gt = new cmGeneratorTarget(t);
     this->ComputeTargetObjectDirectory(gt);
     this->GeneratorTargets[t] = gt;
     generatorTargets[t] = gt;
@@ -1470,7 +1469,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
         j = mf->GetOwnedImportedTargets().begin();
       j != mf->GetOwnedImportedTargets().end(); ++j)
     {
-    cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
+    cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
     this->GeneratorTargets[*j] = gt;
     generatorTargets[*j] = gt;
     }
@@ -1483,7 +1482,7 @@ void cmGlobalGenerator::CreateGeneratorTargets()
   // Construct per-target generator information.
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
-    this->CreateGeneratorTargets(this->LocalGenerators[i]);
+    this->CreateGeneratorTargets(this->LocalGenerators[i]->GetMakefile());
     }
 }
 
@@ -1955,10 +1954,10 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
 }
 
 bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
-                                   cmGeneratorTarget* target) const
+                                   cmTarget const& target) const
 {
-  if(target->GetType() == cmTarget::INTERFACE_LIBRARY
-      || target->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+  if(target.GetType() == cmTarget::INTERFACE_LIBRARY
+      || target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
     {
     // This target is excluded from its directory.
     return true;
@@ -1967,7 +1966,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
     {
     // This target is included in its directory.  Check whether the
     // directory is excluded.
-    return this->IsExcluded(root, target->GetLocalGenerator());
+    return this->IsExcluded(root, target.GetMakefile()->GetLocalGenerator());
     }
 }
 
@@ -2028,11 +2027,9 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
       {
       cmTarget const& target = t->second;
 
-      cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
-
       // Consider the directory containing the target and all its
       // parents until something excludes the target.
-      for(cmLocalGenerator* clg = lg; clg && !this->IsExcluded(clg, gt);
+      for(cmLocalGenerator* clg = lg; clg && !this->IsExcluded(clg, target);
           clg = clg->GetParent())
         {
         // This local generator includes the target.
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 8c092c0..f02df90 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -390,7 +390,7 @@ protected:
   void FillProjectMap();
   void CheckLocalGenerators();
   bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
-  bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
+  bool IsExcluded(cmLocalGenerator* root, cmTarget const& target) const;
   void FillLocalGeneratorToTargetMap();
   void CreateDefaultGlobalTargets(cmTargets* targets);
   cmTarget CreateGlobalTarget(const std::string& name, const char* message,
@@ -483,7 +483,7 @@ private:
   // Per-target generator information.
   cmGeneratorTargetsType GeneratorTargets;
   friend class cmake;
-  void CreateGeneratorTargets(cmLocalGenerator* lg);
+  void CreateGeneratorTargets(cmMakefile* mf);
   void CreateGeneratorTargets();
 
   void ClearGeneratorMembers();
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 0d3177c..ffd1cdc 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -289,7 +289,7 @@ public:
   const std::vector<cmLocalGenerator*>& GetLocalGenerators() const {
     return LocalGenerators; }
 
-  bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) {
+  bool IsExcluded(cmLocalGenerator* root, cmTarget& target) {
     return cmGlobalGenerator::IsExcluded(root, target); }
 
   int GetRuleCmdLength(const std::string& name) {
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 6c34436..4fe52dd 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -529,7 +529,7 @@ cmGlobalUnixMakefileGenerator3
                        cmLocalUnixMakefileGenerator3* lg)
 {
   // Only subdirectories need these rules.
-  if(lg->GetMakefile()->IsRootMakefile())
+  if(lg->IsRootMakefile())
     {
     return;
     }
@@ -809,7 +809,7 @@ cmGlobalUnixMakefileGenerator3
                         localName, depends, commands, true);
 
       // add the all/all dependency
-      if(!this->IsExcluded(this->LocalGenerators[0], gtarget))
+      if(!this->IsExcluded(this->LocalGenerators[0], *gtarget->Target))
         {
         depends.clear();
         depends.push_back(localName);
@@ -877,7 +877,7 @@ cmGlobalUnixMakefileGenerator3
                           "Pre-install relink rule for target.",
                           localName, depends, commands, true);
 
-        if(!this->IsExcluded(this->LocalGenerators[0], gtarget))
+        if(!this->IsExcluded(this->LocalGenerators[0], *gtarget->Target))
           {
           depends.clear();
           depends.push_back(localName);
@@ -1034,7 +1034,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
       static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
     // for the passed in makefile or if this is the top Makefile wripte out
     // the targets
-    if (lg2 == lg || lg->GetMakefile()->IsRootMakefile())
+    if (lg2 == lg || lg->IsRootMakefile())
       {
       // for each target Generate the rule files for each target.
       cmTargets& targets = lg2->GetMakefile()->GetTargets();
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2587764..5ed53d0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -68,6 +68,11 @@ cmLocalGenerator::~cmLocalGenerator()
   delete this->Makefile;
 }
 
+bool cmLocalGenerator::IsRootMakefile() const
+{
+  return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
+}
+
 //----------------------------------------------------------------------------
 void cmLocalGenerator::ComputeObjectMaxPath()
 {
@@ -1330,7 +1335,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
                                              const std::string& lang,
                                              const std::string& config,
                                              bool stripImplicitInclDirs
-                                            ) const
+                                            )
 {
   // Need to decide whether to automatically include the source and
   // binary directories at the beginning of the include path.
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 9b1dfaf..efdd487 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -39,6 +39,9 @@ public:
                    cmState::Snapshot snapshot);
   virtual ~cmLocalGenerator();
 
+  /// @return whether we are processing the top CMakeLists.txt file.
+  bool IsRootMakefile() const;
+
   /**
    * Generate the makefile for this directory.
    */
@@ -185,7 +188,7 @@ public:
                              cmGeneratorTarget* target,
                              const std::string& lang = "C",
                              const std::string& config = "",
-                             bool stripImplicitInclDirs = true) const;
+                             bool stripImplicitInclDirs = true);
   void AddCompileOptions(std::string& flags, cmTarget* target,
                          const std::string& lang, const std::string& config);
   void AddCompileDefinitions(std::set<std::string>& defines,
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 8e498dd..870b9b9 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -37,7 +37,7 @@ void cmLocalGhsMultiGenerator::Generate()
       {
       continue;
       }
-    cmGhsMultiTargetGenerator tg(l->second);
+    cmGhsMultiTargetGenerator tg(l->second->Target);
     tg.Generate();
     }
 }
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index aac85f9..427ae10 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -58,7 +58,7 @@ void cmLocalNinjaGenerator::Generate()
 #endif
 
   // We do that only once for the top CMakeLists.txt file.
-  if(this->Makefile->IsRootMakefile())
+  if(this->IsRootMakefile())
     {
     this->WriteBuildFileTop();
 
@@ -91,7 +91,7 @@ void cmLocalNinjaGenerator::Generate()
       // Add the target to "all" if required.
       if (!this->GetGlobalNinjaGenerator()->IsExcluded(
             this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0],
-            t->second))
+            *t->second->Target))
         this->GetGlobalNinjaGenerator()->AddDependencyToAll(t->second->Target);
       delete tg;
       }
@@ -298,7 +298,7 @@ void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os)
     << "# Write statements declared in CMakeLists.txt:" << std::endl
     << "# "
     << this->Makefile->GetDefinition("CMAKE_CURRENT_LIST_FILE") << std::endl;
-  if(this->Makefile->IsRootMakefile())
+  if(this->IsRootMakefile())
     os << "# Which is the root file." << std::endl;
   cmGlobalNinjaGenerator::WriteDivider(os);
   os << std::endl;
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 78fe19d..dcb3016 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -147,6 +147,9 @@ public:
   void AddImplicitDepends(cmTarget const& tgt, const std::string& lang,
                           const char* obj, const char* src);
 
+  void AppendGlobalTargetDepends(std::vector<std::string>& depends,
+                                 cmTarget& target);
+
   // write the target rules for the local Makefile into the stream
   void WriteLocalAllRules(std::ostream& ruleFileStream);
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index cb9611a..63dbe27 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -105,7 +105,7 @@ public:
     ++it;
     if(it == this->VarStack.rend())
       {
-      cmLocalGenerator* plg = mf->LocalGenerator->GetParent();
+      cmLocalGenerator* plg = mf->GetLocalGenerator()->GetParent();
       if(!plg)
         {
         return false;
@@ -1608,11 +1608,6 @@ void cmMakefile::PopMacroScope(bool reportError)
   this->PopFunctionBlockerBarrier(reportError);
 }
 
-bool cmMakefile::IsRootMakefile() const
-{
-  return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
-}
-
 //----------------------------------------------------------------------------
 class cmMakefileCurrent
 {
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index b551c55..86bde0c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -79,9 +79,6 @@ public:
    */
   ~cmMakefile();
 
-  /// @return whether we are processing the top CMakeLists.txt file.
-  bool IsRootMakefile() const;
-
   bool ReadListFile(const char* listfile);
 
   bool ReadDependentFile(const char* listfile, bool noPolicyScope = true);
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 416063f..37b297e 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -22,7 +22,7 @@
 //----------------------------------------------------------------------------
 cmMakefileExecutableTargetGenerator
 ::cmMakefileExecutableTargetGenerator(cmGeneratorTarget* target):
-  cmMakefileTargetGenerator(target)
+  cmMakefileTargetGenerator(target->Target)
 {
   this->CustomCommandDriver = OnDepends;
   this->Target->GetExecutableNames(
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 660027c..450f573 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -22,7 +22,7 @@
 //----------------------------------------------------------------------------
 cmMakefileLibraryTargetGenerator
 ::cmMakefileLibraryTargetGenerator(cmGeneratorTarget* target):
-  cmMakefileTargetGenerator(target)
+  cmMakefileTargetGenerator(target->Target)
 {
   this->CustomCommandDriver = OnDepends;
   if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index dd60a1f..923aa7b 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -32,7 +32,7 @@
 
 #include <ctype.h>
 
-cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
+cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
   : OSXBundleGenerator(0)
   , MacOSXContentGenerator(0)
 {
@@ -41,15 +41,16 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
   this->FlagFileStream = 0;
   this->CustomCommandDriver = OnBuild;
   this->FortranModuleDirectoryComputed = false;
-  this->Target = target->Target;
+  this->Target = target;
   this->Makefile = this->Target->GetMakefile();
   this->LocalGenerator =
-    static_cast<cmLocalUnixMakefileGenerator3*>(target->GetLocalGenerator());
+    static_cast<cmLocalUnixMakefileGenerator3*>(
+      this->Makefile->GetLocalGenerator());
   this->ConfigName = this->LocalGenerator->ConfigurationName.c_str();
   this->GlobalGenerator =
     static_cast<cmGlobalUnixMakefileGenerator3*>(
       this->LocalGenerator->GetGlobalGenerator());
-  this->GeneratorTarget = target;
+  this->GeneratorTarget = this->GlobalGenerator->GetGeneratorTarget(target);
   cmake* cm = this->GlobalGenerator->GetCMakeInstance();
   this->NoRuleMessages = false;
   if(const char* ruleStatus = cm->GetState()
@@ -1154,10 +1155,8 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
                 && linkee->GetType() != cmTarget::INTERFACE_LIBRARY
                 && emitted.insert(linkee).second)
         {
-        cmGeneratorTarget* gt =
-            this->GlobalGenerator->GetGeneratorTarget(linkee);
-        cmLocalGenerator* lg = gt->GetLocalGenerator();
         cmMakefile* mf = linkee->GetMakefile();
+        cmLocalGenerator* lg = mf->GetLocalGenerator();
         std::string di = mf->GetCurrentBinaryDirectory();
         di += "/";
         di += lg->GetTargetDirectory(*linkee);
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 9182236..2e1b052 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -34,7 +34,7 @@ class cmMakefileTargetGenerator
 {
 public:
   // constructor to set the ivars
-  cmMakefileTargetGenerator(cmGeneratorTarget* target);
+  cmMakefileTargetGenerator(cmTarget* target);
   virtual ~cmMakefileTargetGenerator();
 
   // construct using this factory call
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index 303ca63..25d929c 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -21,7 +21,7 @@
 //----------------------------------------------------------------------------
 cmMakefileUtilityTargetGenerator
 ::cmMakefileUtilityTargetGenerator(cmGeneratorTarget* target):
-  cmMakefileTargetGenerator(target)
+  cmMakefileTargetGenerator(target->Target)
 {
   this->CustomCommandDriver = OnUtility;
   this->OSXBundleGenerator = new cmOSXBundleGenerator(target,
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 2fe53bf..bbf03ff 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -32,7 +32,7 @@
 
 cmNinjaNormalTargetGenerator::
 cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
-  : cmNinjaTargetGenerator(target)
+  : cmNinjaTargetGenerator(target->Target)
   , TargetNameOut()
   , TargetNameSO()
   , TargetNameReal()
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index fcf4a62..b2aef68 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -56,18 +56,19 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
     }
 }
 
-cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
+cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmTarget* target)
   :
     MacOSXContentGenerator(0),
     OSXBundleGenerator(0),
     MacContentFolders(),
-    Target(target->Target),
-    Makefile(target->Makefile),
+    Target(target),
+    Makefile(target->GetMakefile()),
     LocalGenerator(
-      static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator())),
+      static_cast<cmLocalNinjaGenerator*>(Makefile->GetLocalGenerator())),
     Objects()
 {
-  this->GeneratorTarget = target;
+  this->GeneratorTarget =
+    this->GetGlobalGenerator()->GetGeneratorTarget(target);
   MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
 }
 
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index fc361b2..4e7d8b3 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -33,7 +33,7 @@ public:
   static cmNinjaTargetGenerator* New(cmGeneratorTarget* target);
 
   /// Build a NinjaTargetGenerator.
-  cmNinjaTargetGenerator(cmGeneratorTarget* target);
+  cmNinjaTargetGenerator(cmTarget* target);
 
   /// Destructor.
   virtual ~cmNinjaTargetGenerator();
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index c3bf011..42d6b46 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -21,7 +21,7 @@
 
 cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
     cmGeneratorTarget *target)
-  : cmNinjaTargetGenerator(target) {}
+  : cmNinjaTargetGenerator(target->Target) {}
 
 cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator() {}
 
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 3bc0eb7..a8eef82 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -22,7 +22,7 @@ cmOSXBundleGenerator(cmGeneratorTarget* target,
                      const std::string& configName)
  : GT(target)
  , Makefile(target->Target->GetMakefile())
- , LocalGenerator(target->GetLocalGenerator())
+ , LocalGenerator(Makefile->GetLocalGenerator())
  , ConfigName(configName)
  , MacContentFolders(0)
 {
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 2e17a7d..176cb0d 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -53,7 +53,7 @@ bool cmProjectCommand
   // CMAKE_PROJECT_NAME will match PROJECT_NAME, and cmake --build
   // will work.
   if(!this->Makefile->GetDefinition("CMAKE_PROJECT_NAME")
-     || (this->Makefile->IsRootMakefile()))
+     || (this->Makefile->GetLocalGenerator()->IsRootMakefile()))
     {
     this->Makefile->AddDefinition("CMAKE_PROJECT_NAME", args[0].c_str());
     this->Makefile->AddCacheDefinition
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 3d6ef57..ef32c75 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -368,7 +368,8 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
   bool usePRE_BUILD = false;
-  cmGlobalGenerator* gg = makefile->GetGlobalGenerator();
+  cmLocalGenerator* localGen = makefile->GetLocalGenerator();
+  cmGlobalGenerator* gg = localGen->GetGlobalGenerator();
   if(gg->GetName().find("Visual Studio") != std::string::npos)
     {
     cmGlobalVisualStudioGenerator* vsgg =
@@ -521,10 +522,10 @@ static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
                                                 std::string &defs)
 {
   cmMakefile* makefile = target->GetMakefile();
-  cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator();
+  cmLocalGenerator* localGen = makefile->GetLocalGenerator();
   std::vector<std::string> includeDirs;
-  cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target);
-  cmLocalGenerator *localGen = gtgt->GetLocalGenerator();
+  cmGeneratorTarget *gtgt = localGen->GetGlobalGenerator()
+                                    ->GetGeneratorTarget(target);
   // Get the include dirs for this target, without stripping the implicit
   // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
   localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 12a1e42..9b78df3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -176,7 +176,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
   this->Makefile->GetConfigurations(this->Configurations);
   this->LocalGenerator =
     (cmLocalVisualStudio7Generator*)
-    this->GeneratorTarget->GetLocalGenerator();
+    this->Makefile->GetLocalGenerator();
   this->Name = this->Target->GetName();
   this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
   this->Platform = gg->GetPlatformName();
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 6ff388d..eeb6575 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -482,7 +482,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
     std::string linkPath;
     std::string flags;
     std::string linkFlags;
-    gg->CreateGeneratorTargets(lg.get());
+    gg->CreateGeneratorTargets(mf);
     cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
     lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
                        gtgt, false);

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

Summary of changes:
 Source/cmExtraCodeBlocksGenerator.cxx          |   24 +++++++++++-------------
 Source/cmExtraCodeBlocksGenerator.h            |    5 ++---
 Source/cmGeneratorTarget.cxx                   |   10 ++--------
 Source/cmGeneratorTarget.h                     |    4 +---
 Source/cmGhsMultiTargetGenerator.cxx           |   17 +++++++++--------
 Source/cmGhsMultiTargetGenerator.h             |    2 +-
 Source/cmGlobalGenerator.cxx                   |   21 +++++++++------------
 Source/cmGlobalGenerator.h                     |    4 ++--
 Source/cmGlobalNinjaGenerator.h                |    2 +-
 Source/cmGlobalUnixMakefileGenerator3.cxx      |    8 ++++----
 Source/cmLocalGenerator.cxx                    |    7 ++++++-
 Source/cmLocalGenerator.h                      |    5 ++++-
 Source/cmLocalGhsMultiGenerator.cxx            |    2 +-
 Source/cmLocalNinjaGenerator.cxx               |    6 +++---
 Source/cmLocalUnixMakefileGenerator3.h         |    3 +++
 Source/cmMakefile.cxx                          |    7 +------
 Source/cmMakefile.h                            |    3 ---
 Source/cmMakefileExecutableTargetGenerator.cxx |    2 +-
 Source/cmMakefileLibraryTargetGenerator.cxx    |    2 +-
 Source/cmMakefileTargetGenerator.cxx           |   13 ++++++-------
 Source/cmMakefileTargetGenerator.h             |    2 +-
 Source/cmMakefileUtilityTargetGenerator.cxx    |    2 +-
 Source/cmNinjaNormalTargetGenerator.cxx        |    2 +-
 Source/cmNinjaTargetGenerator.cxx              |   11 ++++++-----
 Source/cmNinjaTargetGenerator.h                |    2 +-
 Source/cmNinjaUtilityTargetGenerator.cxx       |    2 +-
 Source/cmOSXBundleGenerator.cxx                |    2 +-
 Source/cmProjectCommand.cxx                    |    2 +-
 Source/cmQtAutoGenerators.cxx                  |    9 +++++----
 Source/cmVisualStudio10TargetGenerator.cxx     |    2 +-
 Source/cmake.cxx                               |    2 +-
 31 files changed, 88 insertions(+), 97 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list