[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-493-gc8b072e

Stephen Kelly steveire at gmail.com
Mon Oct 12 15:49: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  c8b072eff94c5cc168996a318d329fd9129476d7 (commit)
       via  05e3076bf14fde75c27324d6979cde3dfb7f792c (commit)
       via  04f953f3f96def0a62979668c1e7e61f9be22be4 (commit)
      from  c75a21e18747dd824d0d5303b0e8c75ad09dd631 (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=c8b072eff94c5cc168996a318d329fd9129476d7
commit c8b072eff94c5cc168996a318d329fd9129476d7
Merge: c75a21e 05e3076
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 12 15:49:42 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 12 15:49:42 2015 -0400

    Merge topic 'genex-generator-objects' into next
    
    05e3076b cmLocalGenerator: Store cmGeneratorTargets.
    04f953f3 cmMakefile: Store container of cmExportBuildFileGenerators.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05e3076bf14fde75c27324d6979cde3dfb7f792c
commit 05e3076bf14fde75c27324d6979cde3dfb7f792c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Sep 16 05:21:07 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 12 21:49:24 2015 +0200

    cmLocalGenerator: Store cmGeneratorTargets.
    
    Relieve cmMakefile of this responsibility.

diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 7f02afe..618f09f 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -43,7 +43,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
 {
   std::string const& argv0 = this->CC.GetCommandLines()[c][0];
   cmGeneratorTarget* target =
-      this->LG->GetMakefile()->FindGeneratorTargetToUse(argv0);
+      this->LG->FindGeneratorTargetToUse(argv0);
   if(target && target->GetType() == cmTarget::EXECUTABLE &&
      (target->Target->IsImported()
       || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 560cfc5..6c3cccd 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -42,7 +42,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
         tei = targets.begin();
       tei != targets.end(); ++tei)
     {
-    cmGeneratorTarget *te = this->LG->GetMakefile()
+    cmGeneratorTarget *te = this->LG
                                 ->FindGeneratorTargetToUse(*tei);
     expectedTargets += sep + this->Namespace + te->Target->GetExportName();
     sep = " ";
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index fdfa35e..b7aeb02 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -965,8 +965,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
        it != this->GlobalGenerator->GetLocalGenerators().end();
        ++it)
     {
-    cmGeneratorTargetsType targets = (*it)->GetMakefile()
-                                        ->GetGeneratorTargets();
+    cmGeneratorTargetsType targets = (*it)->GetGeneratorTargets();
     for (cmGeneratorTargetsType::iterator l = targets.begin();
          l != targets.end(); ++l)
       {
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 2797d10..fe83b08 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1275,7 +1275,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
 
     std::string tgtName = parameters.front();
     cmGeneratorTarget* gt =
-                context->LG->GetMakefile()->FindGeneratorTargetToUse(tgtName);
+                context->LG->FindGeneratorTargetToUse(tgtName);
     if (!gt)
       {
       std::ostringstream e;
@@ -1739,7 +1739,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
       return std::string();
       }
     cmGeneratorTarget* target =
-        context->LG->GetMakefile()->FindGeneratorTargetToUse(name);
+        context->LG->FindGeneratorTargetToUse(name);
     if(!target)
       {
       ::reportError(context, content->GetOriginalExpression(),
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6033efe..6bebc2b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2305,7 +2305,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
 
   // Check for a target with this name.
   if(cmGeneratorTarget* t
-                    = this->Makefile->FindGeneratorTargetToUse(util))
+                    = this->GeneratorTarget->
+                    GetLocalGenerator()->FindGeneratorTargetToUse(util))
     {
     // If we find the target and the dep was given as a full path,
     // then make sure it was not a full path to something else, and
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a61515a..8f5e84a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1568,7 +1568,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
     this->GeneratorTargets[*j] = gt;
     generatorTargets[*j] = gt;
     }
-  mf->SetGeneratorTargets(generatorTargets);
+  lg->SetGeneratorTargets(generatorTargets);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 87cf58f..45a1509 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -287,7 +287,7 @@ void cmGlobalGhsMultiGenerator::Generate()
       {
       cmLocalGhsMultiGenerator *lg =
         static_cast<cmLocalGhsMultiGenerator *>(this->LocalGenerators[i]);
-      cmGeneratorTargetsType tgts = lg->GetMakefile()->GetGeneratorTargets();
+      cmGeneratorTargetsType tgts = lg->GetGeneratorTargets();
       this->UpdateBuildFiles(&tgts);
       }
     }
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index f955ef7..ed36634 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -68,8 +68,7 @@ void cmGlobalKdevelopGenerator::Generate()
     for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin();
          lg!=lgs.end(); lg++)
       {
-      cmMakefile* makefile=(*lg)->GetMakefile();
-      cmGeneratorTargetsType const& targets = makefile->GetGeneratorTargets();
+      cmGeneratorTargetsType const& targets = (*lg)->GetGeneratorTargets();
       for (cmGeneratorTargetsType::const_iterator ti = targets.begin();
            ti != targets.end(); ti++)
         {
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 218e702..f9740e5 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -461,7 +461,7 @@ cmGlobalUnixMakefileGenerator3
   // The directory-level rule should depend on the target-level rules
   // for all targets in the directory.
   std::vector<std::string> depends;
-  cmGeneratorTargetsType targets = lg->GetMakefile()->GetGeneratorTargets();
+  cmGeneratorTargetsType targets = lg->GetGeneratorTargets();
   for(cmGeneratorTargetsType::iterator l = targets.begin();
       l != targets.end(); ++l)
     {
@@ -627,7 +627,7 @@ cmGlobalUnixMakefileGenerator3
     lg = static_cast<cmLocalUnixMakefileGenerator3 *>
       (this->LocalGenerators[i]);
     // for each target Generate the rule files for each target.
-    cmGeneratorTargetsType targets = lg->GetMakefile()->GetGeneratorTargets();
+    cmGeneratorTargetsType targets = lg->GetGeneratorTargets();
     for(cmGeneratorTargetsType::iterator t = targets.begin();
         t != targets.end(); ++t)
       {
@@ -728,7 +728,7 @@ cmGlobalUnixMakefileGenerator3
   depends.push_back("cmake_check_build_system");
 
   // for each target Generate the rule files for each target.
-  cmGeneratorTargetsType targets = lg->GetMakefile()->GetGeneratorTargets();
+  cmGeneratorTargetsType targets = lg->GetGeneratorTargets();
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 6a25ed0..cb30c4e 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -108,7 +108,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
           i != gen.end(); ++i)
         {
         cmGeneratorTargetsType targets =
-            (*i)->GetMakefile()->GetGeneratorTargets();
+            (*i)->GetGeneratorTargets();
         for(cmGeneratorTargetsType::iterator t = targets.begin();
             t != targets.end(); ++t)
           {
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f19d551..3691b41 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -132,7 +132,7 @@ void cmLocalGenerator::TraceDependencies()
     this->GlobalGenerator->CreateEvaluationSourceFiles(*ci);
     }
   // Generate the rule files for each target.
-  cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets();
+  cmGeneratorTargetsType targets = this->GetGeneratorTargets();
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
@@ -448,6 +448,13 @@ void cmLocalGenerator::GenerateInstallRules()
     }
 }
 
+
+void cmLocalGenerator::AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
+{
+  this->GeneratorTargets[t] = gt;
+  this->GetGlobalGenerator()->AddGeneratorTarget(t, gt);
+}
+
 //----------------------------------------------------------------------------
 void cmLocalGenerator::ComputeTargetManifest()
 {
@@ -460,7 +467,7 @@ void cmLocalGenerator::ComputeTargetManifest()
     }
 
   // Add our targets to the manifest for each configuration.
-  cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets();
+  cmGeneratorTargetsType targets = this->GetGeneratorTargets();
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
@@ -1767,6 +1774,17 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
 }
 
 //----------------------------------------------------------------------------
+cmGeneratorTarget*
+cmLocalGenerator::FindGeneratorTargetToUse(const std::string& name) const
+{
+  if (cmTarget *t = this->Makefile->FindTargetToUse(name))
+    {
+    return this->GetGlobalGenerator()->GetGeneratorTarget(t);
+    }
+  return 0;
+}
+
+//----------------------------------------------------------------------------
 bool cmLocalGenerator::GetRealDependency(const std::string& inName,
                                          const std::string& config,
                                          std::string& dep)
@@ -1792,7 +1810,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
 
   // Look for a CMake target with the given name.
   if(cmGeneratorTarget* target =
-     this->Makefile->FindGeneratorTargetToUse(name))
+     this->FindGeneratorTargetToUse(name))
     {
     // make sure it is not just a coincidence that the target name
     // found is part of the inName
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 758709a..97e3f88 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -112,6 +112,19 @@ public:
                               bool forResponseFile = false,
                               const std::string& config = "");
 
+  const cmGeneratorTargetsType &GetGeneratorTargets() const
+    {
+      return this->GeneratorTargets;
+    }
+
+  void SetGeneratorTargets(const cmGeneratorTargetsType &targets)
+    {
+      this->GeneratorTargets = targets;
+    }
+  void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt);
+
+  cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
+
   /**
    * Encode a list of preprocessor definitions for the compiler
    * command line.
@@ -354,6 +367,7 @@ protected:
   std::set<std::string> ObjectMaxPathViolations;
 
   std::set<cmTarget const*> WarnCMP0063;
+  cmGeneratorTargetsType GeneratorTargets;
 
   bool EmitUniversalBinaryFlags;
 
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index bac989f..721f239 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -26,7 +26,7 @@ cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator() {}
 
 void cmLocalGhsMultiGenerator::Generate()
 {
-  cmGeneratorTargetsType tgts = this->GetMakefile()->GetGeneratorTargets();
+  cmGeneratorTargetsType tgts = this->GetGeneratorTargets();
 
   for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end();
        ++l)
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 6319f0e..8d71469 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -73,7 +73,7 @@ void cmLocalNinjaGenerator::Generate()
       }
     }
 
-  cmGeneratorTargetsType targets = this->GetMakefile()->GetGeneratorTargets();
+  cmGeneratorTargetsType targets = this->GetGeneratorTargets();
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index bf5afc1..91c7acd 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -113,7 +113,7 @@ void cmLocalUnixMakefileGenerator3::Generate()
     this->Makefile->IsOn("CMAKE_SKIP_ASSEMBLY_SOURCE_RULES");
 
   // Generate the rule files for each target.
-  cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets();
+  cmGeneratorTargetsType targets = this->GetGeneratorTargets();
   cmGlobalUnixMakefileGenerator3* gg =
     static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
   for(cmGeneratorTargetsType::iterator t = targets.begin();
@@ -175,7 +175,7 @@ void cmLocalUnixMakefileGenerator3::
 GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
 {
   std::set<std::string> emitted;
-  cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets();
+  cmGeneratorTargetsType targets = this->GetGeneratorTargets();
   for(cmGeneratorTargetsType::iterator ti = targets.begin();
       ti != targets.end(); ++ti)
     {
@@ -418,7 +418,7 @@ void cmLocalUnixMakefileGenerator3
 
   // for each target we just provide a rule to cd up to the top and do a make
   // on the target
-  cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets();
+  cmGeneratorTargetsType targets = this->GetGeneratorTargets();
   std::string localName;
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7d49661..61832ba 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1800,12 +1800,6 @@ const char* cmMakefile::GetCurrentBinaryDirectory() const
   return this->StateSnapshot.GetDirectory().GetCurrentBinary();
 }
 
-void cmMakefile::AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
-{
-  this->GeneratorTargets[t] = gt;
-  this->GetGlobalGenerator()->AddGeneratorTarget(t, gt);
-}
-
 //----------------------------------------------------------------------------
 void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
                                        bool before)
@@ -4309,17 +4303,6 @@ bool cmMakefile::IsAlias(const std::string& name) const
 }
 
 //----------------------------------------------------------------------------
-cmGeneratorTarget*
-cmMakefile::FindGeneratorTargetToUse(const std::string& name) const
-{
-  if (cmTarget *t = this->FindTargetToUse(name))
-    {
-    return this->GetGlobalGenerator()->GetGeneratorTarget(t);
-    }
-  return 0;
-}
-
-//----------------------------------------------------------------------------
 bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
                                    bool isCustom) const
 {
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index c55ee39..8f865a0 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -17,7 +17,6 @@
 #include "cmSystemTools.h"
 #include "cmTarget.h"
 #include "cmNewLineStyle.h"
-#include "cmGeneratorTarget.h"
 #include "cmExpandedCommandArgument.h"
 #include "cmake.h"
 #include "cmState.h"
@@ -393,17 +392,6 @@ public:
       return this->ImportedTargetsOwned;
     }
 
-  const cmGeneratorTargetsType &GetGeneratorTargets() const
-    {
-      return this->GeneratorTargets;
-    }
-
-  void SetGeneratorTargets(const cmGeneratorTargetsType &targets)
-    {
-      this->GeneratorTargets = targets;
-    }
-  void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt);
-
   cmTarget* FindTarget(const std::string& name,
                        bool excludeAliases = false) const;
 
@@ -412,7 +400,6 @@ public:
   cmTarget* FindTargetToUse(const std::string& name,
                             bool excludeAliases = false) const;
   bool IsAlias(const std::string& name) const;
-  cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
 
   /**
    * Mark include directories as system directories.
@@ -815,7 +802,6 @@ protected:
   typedef std::map<std::string, cmTarget*> TargetMap;
 #endif
   TargetMap AliasTargets;
-  cmGeneratorTargetsType GeneratorTargets;
   std::vector<cmSourceFile*> SourceFiles;
 
   // Tests
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 6e3f65f..f9875b3 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -886,7 +886,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
                                 commandLines, false, autogenComment.c_str());
 
     cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
-    makefile->AddGeneratorTarget(autogenTarget, gt);
+    lg->AddGeneratorTarget(autogenTarget, gt);
 
     // Set target folder
     const char* autogenFolder = makefile->GetState()
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 7dec50b..85fb405 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -89,7 +89,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
   // be translated.
   std::string exe = command[0];
   cmGeneratorTarget* target =
-      this->LG->GetMakefile()->FindGeneratorTargetToUse(exe);
+      this->LG->FindGeneratorTargetToUse(exe);
   if(target && target->GetType() == cmTarget::EXECUTABLE)
     {
     // Use the target file on disk.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=04f953f3f96def0a62979668c1e7e61f9be22be4
commit 04f953f3f96def0a62979668c1e7e61f9be22be4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Sep 16 22:08:22 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 12 21:49:24 2015 +0200

    cmMakefile: Store container of cmExportBuildFileGenerators.
    
    Set a cmLocalGenerator on each instance at compute time.  That will
    soon be needed to access cmGeneratorTarget instances.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 400fa17..560cfc5 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -18,13 +18,18 @@
 
 //----------------------------------------------------------------------------
 cmExportBuildFileGenerator::cmExportBuildFileGenerator()
-  : Backtrace()
 {
-  this->Makefile = 0;
+  this->LG = 0;
   this->ExportSet = 0;
 }
 
 //----------------------------------------------------------------------------
+void cmExportBuildFileGenerator::Compute(cmLocalGenerator* lg)
+{
+  this->LG = lg;
+}
+
+//----------------------------------------------------------------------------
 bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
 {
   std::vector<cmGeneratorTarget*> allTargets;
@@ -37,7 +42,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
         tei = targets.begin();
       tei != targets.end(); ++tei)
     {
-    cmGeneratorTarget *te = this->Makefile
+    cmGeneratorTarget *te = this->LG->GetMakefile()
                                 ->FindGeneratorTargetToUse(*tei);
     expectedTargets += sep + this->Namespace + te->Target->GetExportName();
     sep = " ";
@@ -49,8 +54,9 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
       {
       std::ostringstream e;
       e << "given target \"" << te->GetName() << "\" more than once.";
-      this->Makefile->GetCMakeInstance()
-          ->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace);
+      this->LG->GetGlobalGenerator()->GetCMakeInstance()
+          ->IssueMessage(cmake::FATAL_ERROR, e.str(),
+                         this->LG->GetMakefile()->GetBacktrace());
       return false;
       }
     if (te->GetType() == cmTarget::INTERFACE_LIBRARY)
@@ -328,8 +334,9 @@ cmExportBuildFileGenerator
   e << "If the required target is not easy to reference in this call, "
     << "consider using the APPEND option with multiple separate calls.";
 
-  this->Makefile->GetCMakeInstance()
-      ->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace);
+  this->LG->GetGlobalGenerator()->GetCMakeInstance()
+      ->IssueMessage(cmake::FATAL_ERROR, e.str(),
+                     this->LG->GetMakefile()->GetBacktrace());
 }
 
 std::string
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index ff3d2e1..16695f1 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -43,10 +43,7 @@ public:
   /** Set whether to append generated code to the output file.  */
   void SetAppendMode(bool append) { this->AppendMode = append; }
 
-  void SetMakefile(cmMakefile *mf) {
-    this->Makefile = mf;
-    this->Backtrace = this->Makefile->GetBacktrace();
-  }
+  void Compute(cmLocalGenerator* lg);
 
 protected:
   // Implement virtual methods from the superclass.
@@ -80,8 +77,7 @@ protected:
   std::vector<std::string> Targets;
   cmExportSet *ExportSet;
   std::vector<cmGeneratorTarget*> Exports;
-  cmMakefile* Makefile;
-  cmListFileBacktrace Backtrace;
+  cmLocalGenerator* LG;
 };
 
 #endif
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 6a1d7f3..c2d9cc4 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -221,7 +221,7 @@ bool cmExportCommand
     {
     ebfg->SetTargets(targets);
     }
-  ebfg->SetMakefile(this->Makefile);
+  this->Makefile->AddExportBuildFileGenerator(ebfg);
   ebfg->SetExportOld(this->ExportOld.IsEnabled());
 
   // Compute the set of configurations exported.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6750611..a61515a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1226,6 +1226,20 @@ bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const
   return false;
 }
 
+void cmGlobalGenerator::ComputeBuildFileGenerators()
+{
+  for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+    {
+    std::vector<cmExportBuildFileGenerator*> gens =
+        this->Makefiles[i]->GetExportBuildFileGenerators();
+    for (std::vector<cmExportBuildFileGenerator*>::const_iterator it =
+         gens.begin(); it != gens.end(); ++it)
+      {
+      (*it)->Compute(this->LocalGenerators[i]);
+      }
+    }
+}
+
 bool cmGlobalGenerator::Compute()
 {
   // Some generators track files replaced during the Generate.
@@ -1255,6 +1269,8 @@ bool cmGlobalGenerator::Compute()
       this->CreateQtAutoGeneratorsTargets();
 #endif
 
+  this->ComputeBuildFileGenerators();
+
   unsigned int i;
 
   // Add generator specific helper commands
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 55e3766..294fca9 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -364,6 +364,8 @@ public:
 
   bool GetConfigureDoneCMP0026() const { return this->ConfigureDoneCMP0026; }
 
+  void ComputeBuildFileGenerators();
+
   std::string MakeSilentFlag;
 protected:
   typedef std::vector<cmLocalGenerator*> GeneratorVector;
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index 8890e2b..97d4d56 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -126,6 +126,7 @@ bool cmIncludeCommand
         }
       }
     gg->CreateGenerationObjects();
+    gg->ComputeBuildFileGenerators();
     gg->GenerateImportFile(fname_abs);
     }
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 73d3522..7d49661 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -702,6 +702,17 @@ cmMakefile::GetEvaluationFiles() const
   return this->EvaluationFiles;
 }
 
+std::vector<cmExportBuildFileGenerator*>
+cmMakefile::GetExportBuildFileGenerators() const
+{
+  return this->ExportBuildFileGenerators;
+}
+
+void cmMakefile::AddExportBuildFileGenerator(cmExportBuildFileGenerator* gen)
+{
+  this->ExportBuildFileGenerators.push_back(gen);
+}
+
 namespace
 {
   struct file_not_persistent
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 0a8dcd5..c55ee39 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -51,6 +51,7 @@ class cmake;
 class cmMakefileCall;
 class cmCMakePolicyCommand;
 class cmGeneratorExpressionEvaluationFile;
+class cmExportBuildFileGenerator;
 
 /** \class cmMakefile
  * \brief Process the input CMakeLists.txt file.
@@ -789,6 +790,10 @@ public:
                   bool inputIsContent);
   std::vector<cmGeneratorExpressionEvaluationFile*> GetEvaluationFiles() const;
 
+  std::vector<cmExportBuildFileGenerator*>
+  GetExportBuildFileGenerators() const;
+  void AddExportBuildFileGenerator(cmExportBuildFileGenerator* gen);
+
 protected:
   // add link libraries and directories to the target
   void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
@@ -882,6 +887,7 @@ private:
   mutable cmsys::RegularExpression cmNamedCurly;
 
   std::vector<cmMakefile*> UnConfiguredDirectories;
+  std::vector<cmExportBuildFileGenerator*> ExportBuildFileGenerators;
 
   std::vector<cmGeneratorExpressionEvaluationFile*> EvaluationFiles;
 
diff --git a/bootstrap b/bootstrap
index ca86528..54f7ca6 100755
--- a/bootstrap
+++ b/bootstrap
@@ -261,6 +261,7 @@ CMAKE_CXX_SOURCES="\
   cmPropertyDefinitionMap \
   cmMakeDepend \
   cmMakefile \
+  cmExportBuildFileGenerator \
   cmExportFileGenerator \
   cmExportInstallFileGenerator \
   cmExportTryCompileFileGenerator \

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list