[Cmake-commits] CMake branch, next, updated. v2.8.12-4855-g04db04c

Stephen Kelly steveire at gmail.com
Mon Nov 4 09:24:01 EST 2013


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  04db04c7d3d15e8b9947ade652162194b880d9c6 (commit)
       via  e8a45a373fa5f43d024059754734a0dff0f58a4e (commit)
       via  63a20858d35a80cbcd1ba724e160c0d65f4f897a (commit)
      from  f1d21213598075eba43895bd6952afc20bc8ed4b (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=04db04c7d3d15e8b9947ade652162194b880d9c6
commit 04db04c7d3d15e8b9947ade652162194b880d9c6
Merge: f1d2121 e8a45a3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 4 09:23:50 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 4 09:23:50 2013 -0500

    Merge topic 'fix-autogen-definitions' into next
    
    e8a45a3 Extract FinalizeTargetCompileDefinitions from cmGeneratorTarget.
    63a2085 cmQtAutogen: Gather tool arguments after creating generator targets.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e8a45a373fa5f43d024059754734a0dff0f58a4e
commit e8a45a373fa5f43d024059754734a0dff0f58a4e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 4 10:51:37 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 4 15:23:11 2013 +0100

    Extract FinalizeTargetCompileDefinitions from cmGeneratorTarget.
    
    Call the method early in the generate step.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 7d99abe..ead3508 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1095,6 +1095,8 @@ void cmGlobalGenerator::Generate()
     return;
     }
 
+  this->FinalizeTargetCompileDefinitions();
+
   // Iterate through all targets and set up automoc for those which have
   // the AUTOMOC, AUTOUIC or AUTORCC property set
   AutogensType autogens;
@@ -1300,13 +1302,11 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets()
+void cmGlobalGenerator::FinalizeTargetCompileDefinitions()
 {
   // Construct per-target generator information.
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
-    cmGeneratorTargetsType generatorTargets;
-
     cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
 
     const std::vector<cmValueWithOrigin> noconfig_compile_definitions =
@@ -1321,7 +1321,6 @@ void cmGlobalGenerator::CreateGeneratorTargets()
       {
       cmTarget* t = &ti->second;
 
-      {
       for (std::vector<cmValueWithOrigin>::const_iterator it
                                       = noconfig_compile_definitions.begin();
           it != noconfig_compile_definitions.end(); ++it)
@@ -1338,7 +1337,24 @@ void cmGlobalGenerator::CreateGeneratorTargets()
                           mf->GetProperty(defPropName.c_str()));
         }
       }
+    }
+}
+
+//----------------------------------------------------------------------------
+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;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index d08ae2a..2e20a4d 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -414,6 +414,7 @@ private:
   // Per-target generator information.
   cmGeneratorTargetsType GeneratorTargets;
   void CreateGeneratorTargets();
+  void FinalizeTargetCompileDefinitions();
   void ComputeGeneratorTargetObjects();
   void ClearGeneratorTargets();
   virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63a20858d35a80cbcd1ba724e160c0d65f4f897a
commit 63a20858d35a80cbcd1ba724e160c0d65f4f897a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 4 10:34:54 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 4 15:23:11 2013 +0100

    cmQtAutogen: Gather tool arguments after creating generator targets.
    
    One of the side-effects in cmGlobalGenerator::CreateGeneratorTargets
    is that compile definitions from the makefile are appended to the
    target. Compile definitions are read from the target directly for
    generating the buildsystem, and generating the Autogen info too
    early caused incomplete compile definitions to be used (#14535).
    
    The compile definitions related code will be moved out of
    CreateGeneratorTargets in a followup commit. However this change
    also has the independent benefit that it causes the
    GetLinkInterfaceDependentStringProperty method to be called in
    SetupAutoGenerateTarget, after the creation of generator targets. In
    CMake 4.0, the GetLinkInterfaceDependentStringProperty will move to
    the cmGeneratorTarget class, and this is a necessary prerequisite to
    that.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index eac54c3..7d99abe 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1097,7 +1097,8 @@ void cmGlobalGenerator::Generate()
 
   // Iterate through all targets and set up automoc for those which have
   // the AUTOMOC, AUTOUIC or AUTORCC property set
-  this->CreateQtAutoGeneratorsTargets();
+  AutogensType autogens;
+  this->CreateQtAutoGeneratorsTargets(autogens);
 
   // For each existing cmLocalGenerator
   unsigned int i;
@@ -1131,6 +1132,12 @@ void cmGlobalGenerator::Generate()
   // Create per-target generator information.
   this->CreateGeneratorTargets();
 
+  for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
+       ++it)
+    {
+    it->first.SetupAutoGenerateTarget(it->second);
+    }
+
   // Trace the dependencies, after that no custom commands should be added
   // because their dependencies might not be handled correctly
   for (i = 0; i < this->LocalGenerators.size(); ++i)
@@ -1256,11 +1263,9 @@ bool cmGlobalGenerator::CheckTargets()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
+void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
-  typedef std::vector<std::pair<cmQtAutoGenerators, cmTarget*> > Autogens;
-  Autogens autogens;
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
     cmTargets& targets =
@@ -1289,11 +1294,8 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
         }
       }
     }
-  for (Autogens::iterator it = autogens.begin(); it != autogens.end();
-       ++it)
-    {
-    it->first.SetupAutoGenerateTarget(it->second);
-    }
+#else
+  (void)autogens;
 #endif
 }
 
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 4d6e10f..d08ae2a 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -32,6 +32,7 @@ class cmTarget;
 class cmInstallTargetGenerator;
 class cmInstallFilesGenerator;
 class cmExportBuildFileGenerator;
+class cmQtAutoGenerators;
 
 /** \class cmGlobalGenerator
  * \brief Responable for overseeing the generation process for the entire tree
@@ -323,7 +324,8 @@ protected:
   virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
 
   bool CheckTargets();
-  void CreateQtAutoGeneratorsTargets();
+  typedef std::vector<std::pair<cmQtAutoGenerators, cmTarget*> > AutogensType;
+  void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
 
 
   // Fill the ProjectMap, this must be called after LocalGenerators
diff --git a/Tests/QtAutogen/foo.h b/Tests/QtAutogen/foo.h
index 32d4c8d..f23ec07 100644
--- a/Tests/QtAutogen/foo.h
+++ b/Tests/QtAutogen/foo.h
@@ -16,7 +16,10 @@
 
 #include <QObject>
 
-class Foo : public QObject
+class Foo
+#ifdef FOO
+          : public QObject
+#endif
 {
   Q_OBJECT
   public:

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list