[Cmake-commits] CMake branch, next, updated. v2.8.12-4948-g8f104e3

Stephen Kelly steveire at gmail.com
Tue Nov 5 14:18:48 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  8f104e34b97e60d5ba78954877096b02f7b53e97 (commit)
       via  944277d09ebdf59f2ea32931516af568e897bcd5 (commit)
       via  d2f4b1e3cf934eab02282ee312408601d6756a31 (commit)
       via  45735f38275ad4d13e801ba41e7565bcfd5a0f0a (commit)
       via  20a234d1b8d41852bdf401ee6484b1d0e877c7c4 (commit)
      from  934a684121675696f9371a2ddfa3ed1ca20ca0d4 (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=8f104e34b97e60d5ba78954877096b02f7b53e97
commit 8f104e34b97e60d5ba78954877096b02f7b53e97
Merge: 934a684 944277d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 5 14:18:46 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 5 14:18:46 2013 -0500

    Merge topic 'refactor-autogen-setup' into next
    
    944277d cmAutogen: Gather tool arguments after creating generator targets.
    d2f4b1e cmAutogen: Rename method to InitializeAutogenTarget
    45735f3 cmAutogen: Move autogen target creation to InitializeMocSourceFile.
    20a234d cmAutogen: Extract some helper methods for autogen targets.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=944277d09ebdf59f2ea32931516af568e897bcd5
commit 944277d09ebdf59f2ea32931516af568e897bcd5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 4 10:34:54 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 5 20:17:34 2013 +0100

    cmAutogen: Gather tool arguments after creating generator targets.
    
    This change causes the GetLinkInterfaceDependentStringProperty method,
    called in SetupAutoGenerateTarget, after the creation of generator
    targets. In CMake 4.0, the GetLinkInterfaceDependentStringProperty
    will move to the cmGeneratorTarget class, and this patch is a necessary
    prerequisite to that.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b6f491a..e1842f7 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1105,9 +1105,12 @@ void cmGlobalGenerator::Generate()
 
   this->FinalizeTargetCompileDefinitions();
 
+#ifdef CMAKE_BUILD_WITH_CMAKE
   // 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);
+#endif
 
   // For each existing cmLocalGenerator
   unsigned int i;
@@ -1141,6 +1144,14 @@ void cmGlobalGenerator::Generate()
   // Create per-target generator information.
   this->CreateGeneratorTargets();
 
+#ifdef CMAKE_BUILD_WITH_CMAKE
+  for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
+       ++it)
+    {
+    it->first.SetupAutoGenerateTarget(it->second);
+    }
+#endif
+
   // 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)
@@ -1266,11 +1277,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 =
@@ -1299,11 +1308,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 92c3096..b9f4bd0 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

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2f4b1e3cf934eab02282ee312408601d6756a31
commit d2f4b1e3cf934eab02282ee312408601d6756a31
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 4 10:32:27 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 5 20:17:34 2013 +0100

    cmAutogen: Rename method to InitializeAutogenTarget
    
    This reflects better what it is doing.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ea17afa..b6f491a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1291,7 +1291,7 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
             && !target.IsImported())
           {
           cmQtAutoGenerators autogen;
-          if(autogen.InitializeMocSourceFile(&target))
+          if(autogen.InitializeAutogenTarget(&target))
             {
             autogens.push_back(std::make_pair(autogen, &target));
             }
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index e07f7b4..36cb368 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -156,7 +156,7 @@ static std::string getAutogenTargetDir(cmTarget *target)
   return targetDir;
 }
 
-bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target)
+bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
 {
   cmMakefile* makefile = target->GetMakefile();
   // don't do anything if there is no Qt4 or Qt5Core (which contains moc):
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 696abc8..116f174 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -23,7 +23,7 @@ public:
   cmQtAutoGenerators();
   bool Run(const char* targetDirectory, const char *config);
 
-  bool InitializeMocSourceFile(cmTarget* target);
+  bool InitializeAutogenTarget(cmTarget* target);
   void SetupAutoGenerateTarget(cmTarget* target);
 
 private:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=45735f38275ad4d13e801ba41e7565bcfd5a0f0a
commit 45735f38275ad4d13e801ba41e7565bcfd5a0f0a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 4 10:29:21 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 5 20:17:32 2013 +0100

    cmAutogen: Move autogen target creation to InitializeMocSourceFile.
    
    The SetupAutoGenerateTarget method will soon be invoked at a later
    time in a followup commit. We need to ensure that we create the
    utility autogen target early.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index dcd0300..e07f7b4 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -185,75 +185,9 @@ bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target)
 
     target->AddSourceFile(mocCppSource);
     }
-  return true;
-}
-
-static void GetCompileDefinitionsAndDirectories(cmTarget *target,
-                                                const char * config,
-                                                std::string &incs,
-                                                std::string &defs)
-{
-  cmMakefile* makefile = target->GetMakefile();
-  cmLocalGenerator* localGen = makefile->GetLocalGenerator();
-  std::vector<std::string> includeDirs;
-  cmGeneratorTarget gtgt(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);
-  const char* sep = "";
-  incs = "";
-  for(std::vector<std::string>::const_iterator incDirIt = includeDirs.begin();
-      incDirIt != includeDirs.end();
-      ++incDirIt)
-    {
-    incs += sep;
-    sep = ";";
-    incs += *incDirIt;
-    }
-
-  std::set<std::string> defines;
-  localGen->AddCompileDefinitions(defines, target, config);
-
-  sep = "";
-  for(std::set<std::string>::const_iterator defIt = defines.begin();
-      defIt != defines.end();
-      ++defIt)
-    {
-    defs += sep;
-    sep = ";";
-    defs += *defIt;
-    }
-}
-
-void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
-{
-  cmMakefile* makefile = target->GetMakefile();
-  const char* targetName = target->GetName();
-
-  // forget the variables added here afterwards again:
-  cmMakefile::ScopePushPop varScope(makefile);
-  static_cast<void>(varScope);
-
-  const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
-  if (!qtVersion)
-    {
-    qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
-    }
-  if (const char *targetQtVersion =
-      target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0))
-    {
-    qtVersion = targetQtVersion;
-    }
-  if (qtVersion)
-    {
-    makefile->AddDefinition("_target_qt_version", qtVersion);
-    }
   // create a custom target for running generators at buildtime:
   std::string autogenTargetName = getAutogenTargetName(target);
 
-  makefile->AddDefinition("_moc_target_name",
-          cmLocalGenerator::EscapeForCMake(autogenTargetName.c_str()).c_str());
-
   std::string targetDir = getAutogenTargetDir(target);
 
   cmCustomCommandLine currentLine;
@@ -296,7 +230,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     tools += " and " + toolNames[0];
     }
   std::string autogenComment = "Automatic " + tools + " for target ";
-  autogenComment += targetName;
+  autogenComment += target->GetName();
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
   bool usePRE_BUILD = false;
@@ -353,6 +287,77 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     target->AddUtility(autogenTargetName.c_str());
     }
 
+  return true;
+}
+
+static void GetCompileDefinitionsAndDirectories(cmTarget *target,
+                                                const char * config,
+                                                std::string &incs,
+                                                std::string &defs)
+{
+  cmMakefile* makefile = target->GetMakefile();
+  cmLocalGenerator* localGen = makefile->GetLocalGenerator();
+  std::vector<std::string> includeDirs;
+  cmGeneratorTarget gtgt(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);
+  const char* sep = "";
+  incs = "";
+  for(std::vector<std::string>::const_iterator incDirIt = includeDirs.begin();
+      incDirIt != includeDirs.end();
+      ++incDirIt)
+    {
+    incs += sep;
+    sep = ";";
+    incs += *incDirIt;
+    }
+
+  std::set<std::string> defines;
+  localGen->AddCompileDefinitions(defines, target, config);
+
+  sep = "";
+  for(std::set<std::string>::const_iterator defIt = defines.begin();
+      defIt != defines.end();
+      ++defIt)
+    {
+    defs += sep;
+    sep = ";";
+    defs += *defIt;
+    }
+}
+
+void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
+{
+  cmMakefile* makefile = target->GetMakefile();
+
+  // forget the variables added here afterwards again:
+  cmMakefile::ScopePushPop varScope(makefile);
+  static_cast<void>(varScope);
+
+  // create a custom target for running generators at buildtime:
+  std::string autogenTargetName = getAutogenTargetName(target);
+
+  makefile->AddDefinition("_moc_target_name",
+          cmLocalGenerator::EscapeForCMake(autogenTargetName.c_str()).c_str());
+
+  std::string targetDir = getAutogenTargetDir(target);
+
+  const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
+  if (!qtVersion)
+    {
+    qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
+    }
+  if (const char *targetQtVersion =
+      target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0))
+    {
+    qtVersion = targetQtVersion;
+    }
+  if (qtVersion)
+    {
+    makefile->AddDefinition("_target_qt_version", qtVersion);
+    }
+
   std::map<std::string, std::string> configIncludes;
   std::map<std::string, std::string> configDefines;
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20a234d1b8d41852bdf401ee6484b1d0e877c7c4
commit 20a234d1b8d41852bdf401ee6484b1d0e877c7c4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 4 10:25:08 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 5 20:17:30 2013 +0100

    cmAutogen: Extract some helper methods for autogen targets.
    
    These snippets will soon be needed from multiple methods.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 5f7a26f..dcd0300 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -138,6 +138,24 @@ cmQtAutoGenerators::cmQtAutoGenerators()
     }
 }
 
+static std::string getAutogenTargetName(cmTarget *target)
+{
+  std::string autogenTargetName = target->GetName();
+  autogenTargetName += "_automoc";
+  return autogenTargetName;
+}
+
+static std::string getAutogenTargetDir(cmTarget *target)
+{
+  cmMakefile* makefile = target->GetMakefile();
+  std::string targetDir = makefile->GetCurrentOutputDirectory();
+  targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
+  targetDir += "/";
+  targetDir += getAutogenTargetName(target);
+  targetDir += ".dir/";
+  return targetDir;
+}
+
 bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target)
 {
   cmMakefile* makefile = target->GetMakefile();
@@ -154,8 +172,7 @@ bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target)
 
   if (target->GetPropertyAsBool("AUTOMOC"))
     {
-    std::string automocTargetName = target->GetName();
-    automocTargetName += "_automoc";
+    std::string automocTargetName = getAutogenTargetName(target);
     std::string mocCppFile = makefile->GetCurrentOutputDirectory();
     mocCppFile += "/";
     mocCppFile += automocTargetName;
@@ -232,17 +249,12 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     makefile->AddDefinition("_target_qt_version", qtVersion);
     }
   // create a custom target for running generators at buildtime:
-  std::string autogenTargetName = targetName;
-  autogenTargetName += "_automoc";
+  std::string autogenTargetName = getAutogenTargetName(target);
 
   makefile->AddDefinition("_moc_target_name",
           cmLocalGenerator::EscapeForCMake(autogenTargetName.c_str()).c_str());
 
-  std::string targetDir = makefile->GetCurrentOutputDirectory();
-  targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
-  targetDir += "/";
-  targetDir += autogenTargetName;
-  targetDir += ".dir/";
+  std::string targetDir = getAutogenTargetDir(target);
 
   cmCustomCommandLine currentLine;
   currentLine.push_back(makefile->GetSafeDefinition("CMAKE_COMMAND"));

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

Summary of changes:
 Source/cmGlobalGenerator.cxx |   24 +++++++++++++++---------
 Source/cmGlobalGenerator.h   |    4 +++-
 2 files changed, 18 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list