[Cmake-commits] CMake branch, next, updated. v3.3.2-1455-g963efb9

Stephen Kelly steveire at gmail.com
Mon Oct 5 13:22:21 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  963efb9ec9970f7107face767083dc90adcec60c (commit)
       via  a2b981ed9bedfddd39186d13832cbfc4534617c9 (commit)
       via  f7738fd122ac38fb3785e6366193fe5095b23b88 (commit)
       via  b2054e1661e5c607cf25e1ac127982f58e29dd44 (commit)
       via  1e757c318b38566aea1c9312a6fb5a3accd3966b (commit)
       via  5fb730174dc5e0c07dfc7aec27e3d6e60c79e3d3 (commit)
       via  86f7fc5d55da5cf569c516f2d1fb8b69603c1be2 (commit)
       via  2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07 (commit)
       via  59b91107d16c2f2ba68791ae67c53bdcc0d32e05 (commit)
       via  7254f6452596f438f0607ece559be7ad556b190a (commit)
       via  975b753997849507684da7d529d1bbe0ffd3ade9 (commit)
       via  f75ec6044c593d0ff042e13b940d2c674910b683 (commit)
       via  f3158e45b8fde882603e1d9b2262a5c64e25c1ee (commit)
       via  493b17f8c7fb171fd7ca36cc0b29257939609298 (commit)
      from  a6f88ed63fd27070a98b52582ab582374824bf30 (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=963efb9ec9970f7107face767083dc90adcec60c
commit 963efb9ec9970f7107face767083dc90adcec60c
Merge: a6f88ed a2b981e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 13:22:20 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 5 13:22:20 2015 -0400

    Merge topic 'refactor-qt-autogen' into next
    
    a2b981ed QtAutogen: Port API to cmGeneratorTarget.
    f7738fd1 cmLocalGenerator: Constify target in API.
    b2054e16 QtAutogen: Port global generator to cmGeneratorTarget.
    1e757c31 QtAutogen: Use a target type between loops.
    5fb73017 QtAutogen: Make some private statics file static.
    86f7fc5d QtAutogen: Move SetupAutoRccTarget method.
    2aa3f500 QtAutogen: Move MergeRccOptions method.
    59b91107 QtAutogen: Move GetRccExecutable method.
    7254f645 QtAutogen: Move SetupAutoUicTarget method.
    975b7539 QtAutogen: Move GetUicOpts method.
    f75ec604 QtAutogen: Move SetupAutoMocTarget method.
    f3158e45 QtAutogen: Move GetCompileDefinitionsAndDirectories method.
    493b17f8 QtAutogen: Move SetupSourceFiles method.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2b981ed9bedfddd39186d13832cbfc4534617c9
commit a2b981ed9bedfddd39186d13832cbfc4534617c9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 19:21:30 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 19:22:02 2015 +0200

    QtAutogen: Port API to cmGeneratorTarget.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 21ada71..309884f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1267,7 +1267,7 @@ bool cmGlobalGenerator::Compute()
   for (std::vector<cmGeneratorTarget const*>::iterator it =
        autogenTargets.begin(); it != autogenTargets.end(); ++it)
     {
-    cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget((*it)->Target);
+    cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(*it);
     }
 #endif
 
@@ -1451,15 +1451,14 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
 
       cmGeneratorTarget* gt = this->GetGeneratorTarget(&ti->second);
 
-      cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt->Target);
+      cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt);
       filteredTargets.push_back(gt);
       }
     for(std::vector<cmGeneratorTarget*>::iterator ti = filteredTargets.begin();
         ti != filteredTargets.end(); ++ti)
       {
-      cmTarget* target = (*ti)->Target;
       cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
-           this->LocalGenerators[i], target);
+           this->LocalGenerators[i], *ti);
       autogenTargets.push_back(*ti);
       }
     }
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index fe888b7..d988665 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -25,19 +25,16 @@
 # include "cmGlobalVisualStudioGenerator.h"
 #endif
 
-static void SetupSourceFiles(cmTarget const* target,
+static void SetupSourceFiles(cmGeneratorTarget const* target,
                                    std::vector<std::string>& skipMoc,
                                    std::vector<std::string>& mocSources,
                                    std::vector<std::string>& mocHeaders,
                                    std::vector<std::string>& skipUic)
 {
-  cmMakefile* makefile = target->GetMakefile();
+  cmMakefile* makefile = target->Target->GetMakefile();
 
   std::vector<cmSourceFile*> srcFiles;
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
-  gtgt->GetConfigCommonSourceFiles(srcFiles);
+  target->GetConfigCommonSourceFiles(srcFiles);
 
   std::vector<std::string> newRccFiles;
 
@@ -67,7 +64,7 @@ static void SetupSourceFiles(cmTarget const* target,
         std::string basename = cmsys::SystemTools::
                                       GetFilenameWithoutLastExtension(absFile);
 
-        std::string rcc_output_dir = target->GetSupportDirectory();
+        std::string rcc_output_dir = target->Target->GetSupportDirectory();
         cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
         std::string rcc_output_file = rcc_output_dir;
         rcc_output_file += "/qrc_" + basename + ".cpp";
@@ -104,40 +101,37 @@ static void SetupSourceFiles(cmTarget const* target,
       fileIt != newRccFiles.end();
       ++fileIt)
     {
-    const_cast<cmTarget*>(target)->AddSource(*fileIt);
+    const_cast<cmTarget*>(target->Target)->AddSource(*fileIt);
     }
 }
 
-static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
+static void GetCompileDefinitionsAndDirectories(cmGeneratorTarget const* target,
                                                 const std::string& config,
                                                 std::string &incs,
                                                 std::string &defs)
 {
-  cmMakefile* makefile = target->GetMakefile();
-  cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator();
   std::vector<std::string> includeDirs;
-  cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target);
-  cmLocalGenerator *localGen = gtgt->GetLocalGenerator();
+  cmLocalGenerator *localGen = target->GetLocalGenerator();
   // 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);
+  localGen->GetIncludeDirectories(includeDirs, target, "CXX", config, false);
 
   incs = cmJoin(includeDirs, ";");
 
   std::set<std::string> defines;
-  localGen->AddCompileDefinitions(defines, target, config, "CXX");
+  localGen->AddCompileDefinitions(defines, target->Target, config, "CXX");
 
   defs += cmJoin(defines, ";");
 }
 
-static void SetupAutoMocTarget(cmTarget const* target,
+static void SetupAutoMocTarget(cmGeneratorTarget const* target,
                           const std::string &autogenTargetName,
                           std::vector<std::string> const& skipMoc,
                           std::vector<std::string> const& mocHeaders,
                           std::map<std::string, std::string> &configIncludes,
                           std::map<std::string, std::string> &configDefines)
 {
-  cmMakefile* makefile = target->GetMakefile();
+  cmMakefile* makefile = target->Target->GetMakefile();
 
   const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
   std::string _moc_options = (tmp!=0 ? tmp : "");
@@ -222,22 +216,20 @@ static void SetupAutoMocTarget(cmTarget const* target,
     }
 }
 
-static void GetUicOpts(cmTarget const* target, const std::string& config,
+static void GetUicOpts(cmGeneratorTarget const* target,
+                       const std::string& config,
                        std::string &optString)
 {
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
   std::vector<std::string> opts;
-  gtgt->GetAutoUicOptions(opts, config);
+  target->GetAutoUicOptions(opts, config);
   optString = cmJoin(opts, ";");
 }
 
-static void SetupAutoUicTarget(cmTarget const* target,
+static void SetupAutoUicTarget(cmGeneratorTarget const* target,
                           std::vector<std::string> const& skipUic,
                           std::map<std::string, std::string> &configUicOptions)
 {
-  cmMakefile *makefile = target->GetMakefile();
+  cmMakefile *makefile = target->Target->GetMakefile();
 
   std::set<std::string> skipped;
   skipped.insert(skipUic.begin(), skipUic.end());
@@ -340,12 +332,9 @@ static void SetupAutoUicTarget(cmTarget const* target,
     }
 }
 
-static std::string GetRccExecutable(cmTarget const* target)
+static std::string GetRccExecutable(cmGeneratorTarget const* target)
 {
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
-  cmMakefile *makefile = target->GetMakefile();
+  cmMakefile *makefile = target->Target->GetMakefile();
   const char *qtVersion = makefile->GetDefinition("_target_qt_version");
   if (!qtVersion)
     {
@@ -355,7 +344,8 @@ static std::string GetRccExecutable(cmTarget const* target)
       qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
       }
     if (const char *targetQtVersion =
-        gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
+        target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION",
+                                                        ""))
       {
       qtVersion = targetQtVersion;
       }
@@ -434,7 +424,7 @@ static void MergeRccOptions(std::vector<std::string> &opts,
 }
 
 std::string GetAutogenTargetName(
-    cmTarget const* target)
+    cmGeneratorTarget const* target)
 {
   std::string autogenTargetName = target->GetName();
   autogenTargetName += "_automoc";
@@ -442,9 +432,9 @@ std::string GetAutogenTargetName(
 }
 
 std::string GetAutogenTargetDir(
-    cmTarget const* target)
+    cmGeneratorTarget const* target)
 {
-  cmMakefile* makefile = target->GetMakefile();
+  cmMakefile* makefile = target->Target->GetMakefile();
   std::string targetDir = makefile->GetCurrentBinaryDirectory();
   targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
   targetDir += "/";
@@ -485,7 +475,7 @@ static std::string ReadAll(const std::string& filename)
 }
 
 static std::string ListQt5RccInputs(cmSourceFile* sf,
-                                            cmTarget const* target,
+                                            cmGeneratorTarget const* target,
                                             std::vector<std::string>& depends)
 {
   std::string rccCommand
@@ -591,17 +581,14 @@ static std::string ListQt4RccInputs(cmSourceFile* sf,
   return entriesList;
 }
 
-static void SetupAutoRccTarget(cmTarget const* target)
+static void SetupAutoRccTarget(cmGeneratorTarget const* target)
 {
   std::string _rcc_files;
   const char* sepRccFiles = "";
-  cmMakefile *makefile = target->GetMakefile();
+  cmMakefile *makefile = target->Target->GetMakefile();
 
   std::vector<cmSourceFile*> srcFiles;
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
-  gtgt->GetConfigCommonSourceFiles(srcFiles);
+  target->GetConfigCommonSourceFiles(srcFiles);
 
   std::string qrcInputs;
   const char* qrcInputsSep = "";
@@ -705,9 +692,10 @@ static void SetupAutoRccTarget(cmTarget const* target)
               GetRccExecutable(target).c_str());
 }
 
-void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target)
+void cmQtAutoGeneratorInitializer::InitializeAutogenSources(
+    cmGeneratorTarget* target)
 {
-  cmMakefile* makefile = target->GetMakefile();
+  cmMakefile* makefile = target->Target->GetMakefile();
 
   if (target->GetPropertyAsBool("AUTOMOC"))
     {
@@ -720,15 +708,15 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target)
     makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
                             mocCppFile.c_str(), false);
 
-    target->AddSource(mocCppFile);
+    target->Target->AddSource(mocCppFile);
     }
 }
 
 void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
                                                  cmLocalGenerator* lg,
-                                                 cmTarget* target)
+                                                 cmGeneratorTarget* target)
 {
-  cmMakefile* makefile = target->GetMakefile();
+  cmMakefile* makefile = target->Target->GetMakefile();
 
   std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
   if (qtMajorVersion == "")
@@ -825,9 +813,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
         )
     {
     std::vector<cmSourceFile*> srcFiles;
-    cmGeneratorTarget* gtgt =
-        lg->GetGlobalGenerator()->GetGeneratorTarget(target);
-    gtgt->GetConfigCommonSourceFiles(srcFiles);
+    target->GetConfigCommonSourceFiles(srcFiles);
     for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
         fileIt != srcFiles.end();
         ++fileIt)
@@ -846,7 +832,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
           std::string basename = cmsys::SystemTools::
                                   GetFilenameWithoutLastExtension(absFile);
 
-          std::string rcc_output_dir = target->GetSupportDirectory();
+          std::string rcc_output_dir = target->Target->GetSupportDirectory();
           cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
           std::string rcc_output_file = rcc_output_dir;
           rcc_output_file += "/qrc_" + basename + ".cpp";
@@ -916,17 +902,17 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
     else
       {
       // inherit FOLDER property from target (#13688)
-      copyTargetProperty(autogenTarget, target, "FOLDER");
+      copyTargetProperty(gt->Target, target->Target, "FOLDER");
       }
 
-    target->AddUtility(autogenTargetName);
+    target->Target->AddUtility(autogenTargetName);
     }
 }
 
 void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
-    cmTarget const* target)
+    cmGeneratorTarget const* target)
 {
-  cmMakefile* makefile = target->GetMakefile();
+  cmMakefile* makefile = target->Target->GetMakefile();
 
   // forget the variables added here afterwards again:
   cmMakefile::ScopePushPop varScope(makefile);
@@ -947,11 +933,8 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
     {
     qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
     }
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
   if (const char *targetQtVersion =
-      gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
+      target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
     {
     qtVersion = targetQtVersion;
     }
diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h
index ad5c85c..eaf140d 100644
--- a/Source/cmQtAutoGeneratorInitializer.h
+++ b/Source/cmQtAutoGeneratorInitializer.h
@@ -21,15 +21,16 @@
 #include <map>
 
 class cmSourceFile;
-class cmTarget;
+class cmGeneratorTarget;
 class cmLocalGenerator;
 
 class cmQtAutoGeneratorInitializer
 {
 public:
-  static void InitializeAutogenSources(cmTarget* target);
-  static void InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target);
-  static void SetupAutoGenerateTarget(cmTarget const* target);
+  static void InitializeAutogenSources(cmGeneratorTarget* target);
+  static void InitializeAutogenTarget(cmLocalGenerator* lg,
+                                      cmGeneratorTarget* target);
+  static void SetupAutoGenerateTarget(cmGeneratorTarget const* target);
 };
 
 #endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7738fd122ac38fb3785e6366193fe5095b23b88
commit f7738fd122ac38fb3785e6366193fe5095b23b88
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 19:15:56 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 19:22:02 2015 +0200

    cmLocalGenerator: Constify target in API.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3230403..b26151c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1180,7 +1180,7 @@ void cmLocalGenerator::AddCompileOptions(
 
 //----------------------------------------------------------------------------
 void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
-                                             cmGeneratorTarget* target,
+                                             cmGeneratorTarget const* target,
                                              const std::string& lang,
                                              const std::string& config,
                                              bool stripImplicitInclDirs
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 6ea414a..33fede1 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -171,7 +171,7 @@ public:
 
   /** Get the include flags for the current makefile and language.  */
   void GetIncludeDirectories(std::vector<std::string>& dirs,
-                             cmGeneratorTarget* target,
+                             cmGeneratorTarget const* target,
                              const std::string& lang = "C",
                              const std::string& config = "",
                              bool stripImplicitInclDirs = true) const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b2054e1661e5c607cf25e1ac127982f58e29dd44
commit b2054e1661e5c607cf25e1ac127982f58e29dd44
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 19:21:59 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 19:21:59 2015 +0200

    QtAutogen: Port global generator to cmGeneratorTarget.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 53c859d..21ada71 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1251,7 +1251,7 @@ bool cmGlobalGenerator::Compute()
 #ifdef CMAKE_BUILD_WITH_CMAKE
   // Iterate through all targets and set up automoc for those which have
   // the AUTOMOC, AUTOUIC or AUTORCC property set
-  std::vector<cmTarget const*> autogenTargets =
+  std::vector<cmGeneratorTarget const*> autogenTargets =
       this->CreateQtAutoGeneratorsTargets();
 #endif
 
@@ -1264,10 +1264,10 @@ bool cmGlobalGenerator::Compute()
     }
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
-  for (std::vector<cmTarget const*>::iterator it = autogenTargets.begin();
-       it != autogenTargets.end(); ++it)
+  for (std::vector<cmGeneratorTarget const*>::iterator it =
+       autogenTargets.begin(); it != autogenTargets.end(); ++it)
     {
-    cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(*it);
+    cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget((*it)->Target);
     }
 #endif
 
@@ -1403,17 +1403,17 @@ bool cmGlobalGenerator::ComputeTargetDepends()
 }
 
 //----------------------------------------------------------------------------
-std::vector<const cmTarget*>
+std::vector<const cmGeneratorTarget*>
 cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
 {
-  std::vector<const cmTarget*> autogenTargets;
+  std::vector<const cmGeneratorTarget*> autogenTargets;
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
     cmTargets& targets =
       this->LocalGenerators[i]->GetMakefile()->GetTargets();
-    std::vector<cmTarget*> filteredTargets;
+    std::vector<cmGeneratorTarget*> filteredTargets;
     filteredTargets.reserve(targets.size());
     for(cmTargets::iterator ti = targets.begin();
         ti != targets.end(); ++ti)
@@ -1449,16 +1449,18 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
         continue;
         }
 
-      cmQtAutoGeneratorInitializer::InitializeAutogenSources(&ti->second);
-      filteredTargets.push_back(&ti->second);
+      cmGeneratorTarget* gt = this->GetGeneratorTarget(&ti->second);
+
+      cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt->Target);
+      filteredTargets.push_back(gt);
       }
-    for(std::vector<cmTarget*>::iterator ti = filteredTargets.begin();
+    for(std::vector<cmGeneratorTarget*>::iterator ti = filteredTargets.begin();
         ti != filteredTargets.end(); ++ti)
       {
-      cmTarget* target = *ti;
+      cmTarget* target = (*ti)->Target;
       cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
            this->LocalGenerators[i], target);
-      autogenTargets.push_back(target);
+      autogenTargets.push_back(*ti);
       }
     }
 #endif
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index ba74c9e..25e06cd 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -384,7 +384,7 @@ protected:
 
   virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const;
 
-  std::vector<cmTarget const*> CreateQtAutoGeneratorsTargets();
+  std::vector<const cmGeneratorTarget*> CreateQtAutoGeneratorsTargets();
 
   std::string SelectMakeProgram(const std::string& makeProgram,
                                 const std::string& makeDefault = "") const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e757c318b38566aea1c9312a6fb5a3accd3966b
commit 1e757c318b38566aea1c9312a6fb5a3accd3966b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 19:21:56 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 19:21:56 2015 +0200

    QtAutogen: Use a target type between loops.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4a48b5d..53c859d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1413,8 +1413,8 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
     {
     cmTargets& targets =
       this->LocalGenerators[i]->GetMakefile()->GetTargets();
-    std::vector<std::string> targetNames;
-    targetNames.reserve(targets.size());
+    std::vector<cmTarget*> filteredTargets;
+    filteredTargets.reserve(targets.size());
     for(cmTargets::iterator ti = targets.begin();
         ti != targets.end(); ++ti)
       {
@@ -1450,13 +1450,12 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
         }
 
       cmQtAutoGeneratorInitializer::InitializeAutogenSources(&ti->second);
-      targetNames.push_back(ti->second.GetName());
+      filteredTargets.push_back(&ti->second);
       }
-    for(std::vector<std::string>::iterator ti = targetNames.begin();
-        ti != targetNames.end(); ++ti)
+    for(std::vector<cmTarget*>::iterator ti = filteredTargets.begin();
+        ti != filteredTargets.end(); ++ti)
       {
-      cmTarget* target = this->LocalGenerators[i]
-                              ->GetMakefile()->FindTarget(*ti, true);
+      cmTarget* target = *ti;
       cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
            this->LocalGenerators[i], target);
       autogenTargets.push_back(target);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5fb730174dc5e0c07dfc7aec27e3d6e60c79e3d3
commit 5fb730174dc5e0c07dfc7aec27e3d6e60c79e3d3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 19:21:48 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 19:21:48 2015 +0200

    QtAutogen: Make some private statics file static.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index a2a72d4..fe888b7 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -25,7 +25,7 @@
 # include "cmGlobalVisualStudioGenerator.h"
 #endif
 
-void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target,
+static void SetupSourceFiles(cmTarget const* target,
                                    std::vector<std::string>& skipMoc,
                                    std::vector<std::string>& mocSources,
                                    std::vector<std::string>& mocHeaders,
@@ -130,7 +130,7 @@ static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
   defs += cmJoin(defines, ";");
 }
 
-void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target,
+static void SetupAutoMocTarget(cmTarget const* target,
                           const std::string &autogenTargetName,
                           std::vector<std::string> const& skipMoc,
                           std::vector<std::string> const& mocHeaders,
@@ -233,7 +233,7 @@ static void GetUicOpts(cmTarget const* target, const std::string& config,
   optString = cmJoin(opts, ";");
 }
 
-void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target,
+static void SetupAutoUicTarget(cmTarget const* target,
                           std::vector<std::string> const& skipUic,
                           std::map<std::string, std::string> &configUicOptions)
 {
@@ -340,8 +340,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target,
     }
 }
 
-std::string cmQtAutoGeneratorInitializer::GetRccExecutable(
-    cmTarget const* target)
+static std::string GetRccExecutable(cmTarget const* target)
 {
   cmGeneratorTarget *gtgt = target->GetMakefile()
                                   ->GetGlobalGenerator()
@@ -391,8 +390,7 @@ std::string cmQtAutoGeneratorInitializer::GetRccExecutable(
   return std::string();
 }
 
-void cmQtAutoGeneratorInitializer::MergeRccOptions(
-                         std::vector<std::string> &opts,
+static void MergeRccOptions(std::vector<std::string> &opts,
                          const std::vector<std::string> &fileOpts,
                          bool isQt5)
 {
@@ -435,7 +433,7 @@ void cmQtAutoGeneratorInitializer::MergeRccOptions(
   opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
 }
 
-std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
+std::string GetAutogenTargetName(
     cmTarget const* target)
 {
   std::string autogenTargetName = target->GetName();
@@ -443,14 +441,14 @@ std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
   return autogenTargetName;
 }
 
-std::string cmQtAutoGeneratorInitializer::GetAutogenTargetDir(
+std::string GetAutogenTargetDir(
     cmTarget const* target)
 {
   cmMakefile* makefile = target->GetMakefile();
   std::string targetDir = makefile->GetCurrentBinaryDirectory();
   targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
   targetDir += "/";
-  targetDir += cmQtAutoGeneratorInitializer::GetAutogenTargetName(target);
+  targetDir += GetAutogenTargetName(target);
   targetDir += ".dir/";
   return targetDir;
 }
@@ -486,12 +484,12 @@ static std::string ReadAll(const std::string& filename)
   return stream.str();
 }
 
-std::string cmQtAutoGeneratorInitializer::ListQt5RccInputs(cmSourceFile* sf,
+static std::string ListQt5RccInputs(cmSourceFile* sf,
                                             cmTarget const* target,
                                             std::vector<std::string>& depends)
 {
   std::string rccCommand
-      = cmQtAutoGeneratorInitializer::GetRccExecutable(target);
+      = GetRccExecutable(target);
   std::vector<std::string> qrcEntries;
 
   std::vector<std::string> command;
@@ -557,7 +555,7 @@ std::string cmQtAutoGeneratorInitializer::ListQt5RccInputs(cmSourceFile* sf,
   return cmJoin(qrcEntries, "@list_sep@");
 }
 
-std::string cmQtAutoGeneratorInitializer::ListQt4RccInputs(cmSourceFile* sf,
+static std::string ListQt4RccInputs(cmSourceFile* sf,
                                             std::vector<std::string>& depends)
 {
   const std::string qrcContents = ReadAll(sf->GetFullPath());
@@ -593,7 +591,7 @@ std::string cmQtAutoGeneratorInitializer::ListQt4RccInputs(cmSourceFile* sf,
   return entriesList;
 }
 
-void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
+static void SetupAutoRccTarget(cmTarget const* target)
 {
   std::string _rcc_files;
   const char* sepRccFiles = "";
@@ -647,7 +645,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
           {
           std::vector<std::string> optsVec;
           cmSystemTools::ExpandListArgument(prop, optsVec);
-          cmQtAutoGeneratorInitializer::MergeRccOptions(rccOptions, optsVec,
+          MergeRccOptions(rccOptions, optsVec,
                                 strcmp(qtVersion, "5") == 0);
           }
 
@@ -675,14 +673,11 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
           {
           if (qtMajorVersion == "5")
             {
-            entriesList = cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf,
-                                                               target,
-                                                               depends);
+            entriesList = ListQt5RccInputs(sf, target, depends);
             }
           else
             {
-            entriesList =
-                cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends);
+            entriesList = ListQt4RccInputs(sf, depends);
             }
           if (entriesList.empty())
             {
@@ -707,7 +702,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
             cmOutputConverter::EscapeForCMake(rccFileOptions).c_str());
 
   makefile->AddDefinition("_qt_rcc_executable",
-              cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str());
+              GetRccExecutable(target).c_str());
 }
 
 void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target)
@@ -716,8 +711,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target)
 
   if (target->GetPropertyAsBool("AUTOMOC"))
     {
-    std::string automocTargetName =
-        cmQtAutoGeneratorInitializer::GetAutogenTargetName(target);
+    std::string automocTargetName = GetAutogenTargetName(target);
     std::string mocCppFile = makefile->GetCurrentBinaryDirectory();
     mocCppFile += "/";
     mocCppFile += automocTargetName;
@@ -743,11 +737,9 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
     }
 
   // create a custom target for running generators at buildtime:
-  std::string autogenTargetName =
-      cmQtAutoGeneratorInitializer::GetAutogenTargetName(target);
+  std::string autogenTargetName = GetAutogenTargetName(target);
 
-  std::string targetDir =
-      cmQtAutoGeneratorInitializer::GetAutogenTargetDir(target);
+  std::string targetDir = GetAutogenTargetDir(target);
 
   cmCustomCommandLine currentLine;
   currentLine.push_back(cmSystemTools::GetCMakeCommand());
@@ -864,12 +856,11 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
             {
             if (qtMajorVersion == "5")
               {
-              cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf, target,
-                                                              depends);
+              ListQt5RccInputs(sf, target, depends);
               }
             else
               {
-              cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends);
+              ListQt4RccInputs(sf, depends);
               }
 #if defined(_WIN32) && !defined(__CYGWIN__)
             // Cannot use PRE_BUILD because the resource files themselves
@@ -942,16 +933,14 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
   static_cast<void>(varScope);
 
   // create a custom target for running generators at buildtime:
-  std::string autogenTargetName =
-      cmQtAutoGeneratorInitializer::GetAutogenTargetName(target);
+  std::string autogenTargetName = GetAutogenTargetName(target);
 
   makefile->AddDefinition("_moc_target_name",
           cmOutputConverter::EscapeForCMake(autogenTargetName).c_str());
   makefile->AddDefinition("_origin_target_name",
           cmOutputConverter::EscapeForCMake(target->GetName()).c_str());
 
-  std::string targetDir =
-      cmQtAutoGeneratorInitializer::GetAutogenTargetDir(target);
+  std::string targetDir = GetAutogenTargetDir(target);
 
   const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
   if (!qtVersion)
@@ -983,25 +972,23 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
       || target->GetPropertyAsBool("AUTOUIC")
       || target->GetPropertyAsBool("AUTORCC"))
     {
-    cmQtAutoGeneratorInitializer::SetupSourceFiles(target, skipMoc,
-                                         mocSources, mocHeaders, skipUic);
+    SetupSourceFiles(target, skipMoc, mocSources, mocHeaders, skipUic);
     }
   makefile->AddDefinition("_cpp_files",
           cmOutputConverter::EscapeForCMake(cmJoin(mocSources, ";")).c_str());
   if (target->GetPropertyAsBool("AUTOMOC"))
     {
-    cmQtAutoGeneratorInitializer::SetupAutoMocTarget(target, autogenTargetName,
+    SetupAutoMocTarget(target, autogenTargetName,
                              skipMoc, mocHeaders,
                              configIncludes, configDefines);
     }
   if (target->GetPropertyAsBool("AUTOUIC"))
     {
-    cmQtAutoGeneratorInitializer::SetupAutoUicTarget(target, skipUic,
-                                                      configUicOptions);
+    SetupAutoUicTarget(target, skipUic, configUicOptions);
     }
   if (target->GetPropertyAsBool("AUTORCC"))
     {
-    cmQtAutoGeneratorInitializer::SetupAutoRccTarget(target);
+    SetupAutoRccTarget(target);
     }
 
   const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h
index c22f172..ad5c85c 100644
--- a/Source/cmQtAutoGeneratorInitializer.h
+++ b/Source/cmQtAutoGeneratorInitializer.h
@@ -30,38 +30,6 @@ public:
   static void InitializeAutogenSources(cmTarget* target);
   static void InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target);
   static void SetupAutoGenerateTarget(cmTarget const* target);
-
-  static std::string GetAutogenTargetName(cmTarget const* target);
-  static std::string GetAutogenTargetDir(cmTarget const* target);
-
-private:
-  static void SetupSourceFiles(cmTarget const* target,
-                        std::vector<std::string>& skipMoc,
-                        std::vector<std::string>& mocSources,
-                        std::vector<std::string>& mocHeaders,
-                        std::vector<std::string>& skipUic);
-
-  static void SetupAutoMocTarget(cmTarget const* target,
-                          const std::string &autogenTargetName,
-                          const std::vector<std::string>& skipMoc,
-                          const std::vector<std::string>& mocHeaders,
-                          std::map<std::string, std::string> &configIncludes,
-                          std::map<std::string, std::string> &configDefines);
-  static void SetupAutoUicTarget(cmTarget const* target,
-                        const std::vector<std::string>& skipUic,
-                        std::map<std::string, std::string> &configUicOptions);
-  static void SetupAutoRccTarget(cmTarget const* target);
-
-  static void MergeRccOptions(std::vector<std::string> &opts,
-                       const std::vector<std::string> &fileOpts, bool isQt5);
-
-  static std::string GetRccExecutable(cmTarget const* target);
-
-  static std::string ListQt5RccInputs(cmSourceFile* sf, cmTarget const* target,
-                               std::vector<std::string>& depends);
-
-  static std::string ListQt4RccInputs(cmSourceFile* sf,
-                               std::vector<std::string>& depends);
 };
 
 #endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86f7fc5d55da5cf569c516f2d1fb8b69603c1be2
commit 86f7fc5d55da5cf569c516f2d1fb8b69603c1be2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 18:55:09 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 18:55:09 2015 +0200

    QtAutogen: Move SetupAutoRccTarget method.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 9bece40..a2a72d4 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -593,6 +593,122 @@ std::string cmQtAutoGeneratorInitializer::ListQt4RccInputs(cmSourceFile* sf,
   return entriesList;
 }
 
+void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
+{
+  std::string _rcc_files;
+  const char* sepRccFiles = "";
+  cmMakefile *makefile = target->GetMakefile();
+
+  std::vector<cmSourceFile*> srcFiles;
+  cmGeneratorTarget *gtgt = target->GetMakefile()
+                                  ->GetGlobalGenerator()
+                                  ->GetGeneratorTarget(target);
+  gtgt->GetConfigCommonSourceFiles(srcFiles);
+
+  std::string qrcInputs;
+  const char* qrcInputsSep = "";
+
+  std::string rccFileFiles;
+  std::string rccFileOptions;
+  const char *optionSep = "";
+
+  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+
+  std::vector<std::string> rccOptions;
+  if (const char* opts = target->GetProperty("AUTORCC_OPTIONS"))
+    {
+    cmSystemTools::ExpandListArgument(opts, rccOptions);
+    }
+  std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
+  if (qtMajorVersion == "")
+    {
+    qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
+    }
+
+  for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
+      fileIt != srcFiles.end();
+      ++fileIt)
+    {
+    cmSourceFile* sf = *fileIt;
+    std::string ext = sf->GetExtension();
+    if (ext == "qrc")
+      {
+      std::string absFile = cmsys::SystemTools::GetRealPath(
+                                                  sf->GetFullPath());
+      bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
+
+      if (!skip)
+        {
+        _rcc_files += sepRccFiles;
+        _rcc_files += absFile;
+        sepRccFiles = ";";
+
+        if (const char *prop = sf->GetProperty("AUTORCC_OPTIONS"))
+          {
+          std::vector<std::string> optsVec;
+          cmSystemTools::ExpandListArgument(prop, optsVec);
+          cmQtAutoGeneratorInitializer::MergeRccOptions(rccOptions, optsVec,
+                                strcmp(qtVersion, "5") == 0);
+          }
+
+        if (!rccOptions.empty())
+          {
+          rccFileFiles += optionSep;
+          rccFileFiles += absFile;
+          rccFileOptions += optionSep;
+          }
+        const char *listSep = "";
+        for(std::vector<std::string>::const_iterator it = rccOptions.begin();
+            it != rccOptions.end();
+            ++it)
+          {
+          rccFileOptions += listSep;
+          rccFileOptions += *it;
+          listSep = "@list_sep@";
+          }
+        optionSep = ";";
+
+        std::vector<std::string> depends;
+
+        std::string entriesList;
+        if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")))
+          {
+          if (qtMajorVersion == "5")
+            {
+            entriesList = cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf,
+                                                               target,
+                                                               depends);
+            }
+          else
+            {
+            entriesList =
+                cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends);
+            }
+          if (entriesList.empty())
+            {
+            return;
+            }
+          }
+        qrcInputs += qrcInputsSep;
+        qrcInputs += entriesList;
+        qrcInputsSep = ";";
+        }
+      }
+    }
+  makefile->AddDefinition("_qt_rcc_inputs_" + target->GetName(),
+                      cmOutputConverter::EscapeForCMake(qrcInputs).c_str());
+
+  makefile->AddDefinition("_rcc_files",
+          cmOutputConverter::EscapeForCMake(_rcc_files).c_str());
+
+  makefile->AddDefinition("_qt_rcc_options_files",
+              cmOutputConverter::EscapeForCMake(rccFileFiles).c_str());
+  makefile->AddDefinition("_qt_rcc_options_options",
+            cmOutputConverter::EscapeForCMake(rccFileOptions).c_str());
+
+  makefile->AddDefinition("_qt_rcc_executable",
+              cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str());
+}
 
 void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target)
 {
@@ -955,120 +1071,3 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
       }
     }
 }
-
-void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
-{
-  std::string _rcc_files;
-  const char* sepRccFiles = "";
-  cmMakefile *makefile = target->GetMakefile();
-
-  std::vector<cmSourceFile*> srcFiles;
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
-  gtgt->GetConfigCommonSourceFiles(srcFiles);
-
-  std::string qrcInputs;
-  const char* qrcInputsSep = "";
-
-  std::string rccFileFiles;
-  std::string rccFileOptions;
-  const char *optionSep = "";
-
-  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
-
-  std::vector<std::string> rccOptions;
-  if (const char* opts = target->GetProperty("AUTORCC_OPTIONS"))
-    {
-    cmSystemTools::ExpandListArgument(opts, rccOptions);
-    }
-  std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
-  if (qtMajorVersion == "")
-    {
-    qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
-    }
-
-  for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
-      fileIt != srcFiles.end();
-      ++fileIt)
-    {
-    cmSourceFile* sf = *fileIt;
-    std::string ext = sf->GetExtension();
-    if (ext == "qrc")
-      {
-      std::string absFile = cmsys::SystemTools::GetRealPath(
-                                                  sf->GetFullPath());
-      bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
-
-      if (!skip)
-        {
-        _rcc_files += sepRccFiles;
-        _rcc_files += absFile;
-        sepRccFiles = ";";
-
-        if (const char *prop = sf->GetProperty("AUTORCC_OPTIONS"))
-          {
-          std::vector<std::string> optsVec;
-          cmSystemTools::ExpandListArgument(prop, optsVec);
-          cmQtAutoGeneratorInitializer::MergeRccOptions(rccOptions, optsVec,
-                                strcmp(qtVersion, "5") == 0);
-          }
-
-        if (!rccOptions.empty())
-          {
-          rccFileFiles += optionSep;
-          rccFileFiles += absFile;
-          rccFileOptions += optionSep;
-          }
-        const char *listSep = "";
-        for(std::vector<std::string>::const_iterator it = rccOptions.begin();
-            it != rccOptions.end();
-            ++it)
-          {
-          rccFileOptions += listSep;
-          rccFileOptions += *it;
-          listSep = "@list_sep@";
-          }
-        optionSep = ";";
-
-        std::vector<std::string> depends;
-
-        std::string entriesList;
-        if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")))
-          {
-          if (qtMajorVersion == "5")
-            {
-            entriesList = cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf,
-                                                               target,
-                                                               depends);
-            }
-          else
-            {
-            entriesList =
-                cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends);
-            }
-          if (entriesList.empty())
-            {
-            return;
-            }
-          }
-        qrcInputs += qrcInputsSep;
-        qrcInputs += entriesList;
-        qrcInputsSep = ";";
-        }
-      }
-    }
-  makefile->AddDefinition("_qt_rcc_inputs_" + target->GetName(),
-                      cmOutputConverter::EscapeForCMake(qrcInputs).c_str());
-
-  makefile->AddDefinition("_rcc_files",
-          cmOutputConverter::EscapeForCMake(_rcc_files).c_str());
-
-  makefile->AddDefinition("_qt_rcc_options_files",
-              cmOutputConverter::EscapeForCMake(rccFileFiles).c_str());
-  makefile->AddDefinition("_qt_rcc_options_options",
-            cmOutputConverter::EscapeForCMake(rccFileOptions).c_str());
-
-  makefile->AddDefinition("_qt_rcc_executable",
-              cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str());
-}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07
commit 2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 18:50:47 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 18:50:47 2015 +0200

    QtAutogen: Move MergeRccOptions method.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 5cb22e9..9bece40 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -391,6 +391,50 @@ std::string cmQtAutoGeneratorInitializer::GetRccExecutable(
   return std::string();
 }
 
+void cmQtAutoGeneratorInitializer::MergeRccOptions(
+                         std::vector<std::string> &opts,
+                         const std::vector<std::string> &fileOpts,
+                         bool isQt5)
+{
+  static const char* valueOptions[] = {
+    "name",
+    "root",
+    "compress",
+    "threshold"
+  };
+  std::vector<std::string> extraOpts;
+  for(std::vector<std::string>::const_iterator it = fileOpts.begin();
+      it != fileOpts.end(); ++it)
+    {
+    std::vector<std::string>::iterator existingIt
+                                  = std::find(opts.begin(), opts.end(), *it);
+    if (existingIt != opts.end())
+      {
+      const char *o = it->c_str();
+      if (*o == '-')
+        {
+        ++o;
+        }
+      if (isQt5 && *o == '-')
+        {
+        ++o;
+        }
+      if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions),
+                  cmStrCmp(*it)) != cmArrayEnd(valueOptions))
+        {
+        assert(existingIt + 1 != opts.end());
+        *(existingIt + 1) = *(it + 1);
+        ++it;
+        }
+      }
+    else
+      {
+      extraOpts.push_back(*it);
+      }
+    }
+  opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
+}
+
 std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
     cmTarget const* target)
 {
@@ -912,50 +956,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
     }
 }
 
-void cmQtAutoGeneratorInitializer::MergeRccOptions(
-                         std::vector<std::string> &opts,
-                         const std::vector<std::string> &fileOpts,
-                         bool isQt5)
-{
-  static const char* valueOptions[] = {
-    "name",
-    "root",
-    "compress",
-    "threshold"
-  };
-  std::vector<std::string> extraOpts;
-  for(std::vector<std::string>::const_iterator it = fileOpts.begin();
-      it != fileOpts.end(); ++it)
-    {
-    std::vector<std::string>::iterator existingIt
-                                  = std::find(opts.begin(), opts.end(), *it);
-    if (existingIt != opts.end())
-      {
-      const char *o = it->c_str();
-      if (*o == '-')
-        {
-        ++o;
-        }
-      if (isQt5 && *o == '-')
-        {
-        ++o;
-        }
-      if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions),
-                  cmStrCmp(*it)) != cmArrayEnd(valueOptions))
-        {
-        assert(existingIt + 1 != opts.end());
-        *(existingIt + 1) = *(it + 1);
-        ++it;
-        }
-      }
-    else
-      {
-      extraOpts.push_back(*it);
-      }
-    }
-  opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
-}
-
 void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
 {
   std::string _rcc_files;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59b91107d16c2f2ba68791ae67c53bdcc0d32e05
commit 59b91107d16c2f2ba68791ae67c53bdcc0d32e05
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 18:50:00 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 18:50:00 2015 +0200

    QtAutogen: Move GetRccExecutable method.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index d998ae0..5cb22e9 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -340,6 +340,57 @@ void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target,
     }
 }
 
+std::string cmQtAutoGeneratorInitializer::GetRccExecutable(
+    cmTarget const* target)
+{
+  cmGeneratorTarget *gtgt = target->GetMakefile()
+                                  ->GetGlobalGenerator()
+                                  ->GetGeneratorTarget(target);
+  cmMakefile *makefile = target->GetMakefile();
+  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+  if (!qtVersion)
+    {
+    qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
+    if (!qtVersion)
+      {
+      qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
+      }
+    if (const char *targetQtVersion =
+        gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
+      {
+      qtVersion = targetQtVersion;
+      }
+    }
+
+  std::string targetName = target->GetName();
+  if (strcmp(qtVersion, "5") == 0)
+    {
+    cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc");
+    if (!qt5Rcc)
+      {
+      cmSystemTools::Error("Qt5::rcc target not found ",
+                          targetName.c_str());
+      return std::string();
+      }
+    return qt5Rcc->ImportedGetLocation("");
+    }
+  else if (strcmp(qtVersion, "4") == 0)
+    {
+    cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc");
+    if (!qt4Rcc)
+      {
+      cmSystemTools::Error("Qt4::rcc target not found ",
+                          targetName.c_str());
+      return std::string();
+      }
+    return qt4Rcc->ImportedGetLocation("");
+    }
+
+  cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
+                      "Qt 5 ", targetName.c_str());
+  return std::string();
+}
+
 std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
     cmTarget const* target)
 {
@@ -1021,54 +1072,3 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
   makefile->AddDefinition("_qt_rcc_executable",
               cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str());
 }
-
-std::string cmQtAutoGeneratorInitializer::GetRccExecutable(
-    cmTarget const* target)
-{
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
-  cmMakefile *makefile = target->GetMakefile();
-  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
-  if (!qtVersion)
-    {
-    qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
-    if (!qtVersion)
-      {
-      qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
-      }
-    if (const char *targetQtVersion =
-        gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
-      {
-      qtVersion = targetQtVersion;
-      }
-    }
-
-  std::string targetName = target->GetName();
-  if (strcmp(qtVersion, "5") == 0)
-    {
-    cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc");
-    if (!qt5Rcc)
-      {
-      cmSystemTools::Error("Qt5::rcc target not found ",
-                          targetName.c_str());
-      return std::string();
-      }
-    return qt5Rcc->ImportedGetLocation("");
-    }
-  else if (strcmp(qtVersion, "4") == 0)
-    {
-    cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc");
-    if (!qt4Rcc)
-      {
-      cmSystemTools::Error("Qt4::rcc target not found ",
-                          targetName.c_str());
-      return std::string();
-      }
-    return qt4Rcc->ImportedGetLocation("");
-    }
-
-  cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
-                      "Qt 5 ", targetName.c_str());
-  return std::string();
-}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7254f6452596f438f0607ece559be7ad556b190a
commit 7254f6452596f438f0607ece559be7ad556b190a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 18:48:41 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 18:48:41 2015 +0200

    QtAutogen: Move SetupAutoUicTarget method.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index ef2f2a5..d998ae0 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -233,6 +233,113 @@ static void GetUicOpts(cmTarget const* target, const std::string& config,
   optString = cmJoin(opts, ";");
 }
 
+void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target,
+                          std::vector<std::string> const& skipUic,
+                          std::map<std::string, std::string> &configUicOptions)
+{
+  cmMakefile *makefile = target->GetMakefile();
+
+  std::set<std::string> skipped;
+  skipped.insert(skipUic.begin(), skipUic.end());
+
+  makefile->AddDefinition("_skip_uic",
+          cmOutputConverter::EscapeForCMake(cmJoin(skipUic, ";")).c_str());
+
+  std::vector<cmSourceFile*> uiFilesWithOptions
+                                        = makefile->GetQtUiFilesWithOptions();
+
+  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+
+  std::string _uic_opts;
+  std::vector<std::string> configs;
+  const std::string& config = makefile->GetConfigurations(configs);
+  GetUicOpts(target, config, _uic_opts);
+
+  if (!_uic_opts.empty())
+    {
+    _uic_opts = cmOutputConverter::EscapeForCMake(_uic_opts);
+    makefile->AddDefinition("_uic_target_options", _uic_opts.c_str());
+    }
+  for (std::vector<std::string>::const_iterator li = configs.begin();
+       li != configs.end(); ++li)
+    {
+    std::string config_uic_opts;
+    GetUicOpts(target, *li, config_uic_opts);
+    if (config_uic_opts != _uic_opts)
+      {
+      configUicOptions[*li] =
+                    cmOutputConverter::EscapeForCMake(config_uic_opts);
+      if(_uic_opts.empty())
+        {
+        _uic_opts = config_uic_opts;
+        }
+      }
+    }
+
+  std::string uiFileFiles;
+  std::string uiFileOptions;
+  const char* sep = "";
+
+  for(std::vector<cmSourceFile*>::const_iterator fileIt =
+      uiFilesWithOptions.begin();
+      fileIt != uiFilesWithOptions.end();
+      ++fileIt)
+    {
+    cmSourceFile* sf = *fileIt;
+    std::string absFile = cmsys::SystemTools::GetRealPath(
+                                                    sf->GetFullPath());
+
+    if (!skipped.insert(absFile).second)
+      {
+      continue;
+      }
+    uiFileFiles += sep;
+    uiFileFiles += absFile;
+    uiFileOptions += sep;
+    std::string opts = sf->GetProperty("AUTOUIC_OPTIONS");
+    cmSystemTools::ReplaceString(opts, ";", "@list_sep@");
+    uiFileOptions += opts;
+    sep = ";";
+    }
+
+  makefile->AddDefinition("_qt_uic_options_files",
+              cmOutputConverter::EscapeForCMake(uiFileFiles).c_str());
+  makefile->AddDefinition("_qt_uic_options_options",
+            cmOutputConverter::EscapeForCMake(uiFileOptions).c_str());
+
+  std::string targetName = target->GetName();
+  if (strcmp(qtVersion, "5") == 0)
+    {
+    cmTarget *qt5Uic = makefile->FindTargetToUse("Qt5::uic");
+    if (!qt5Uic)
+      {
+      // Project does not use Qt5Widgets, but has AUTOUIC ON anyway
+      }
+    else
+      {
+      makefile->AddDefinition("_qt_uic_executable",
+                              qt5Uic->ImportedGetLocation(""));
+      }
+    }
+  else if (strcmp(qtVersion, "4") == 0)
+    {
+    cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic");
+    if (!qt4Uic)
+      {
+      cmSystemTools::Error("Qt4::uic target not found ",
+                          targetName.c_str());
+      return;
+      }
+    makefile->AddDefinition("_qt_uic_executable",
+                            qt4Uic->ImportedGetLocation(""));
+    }
+  else
+    {
+    cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and "
+                        "Qt 5 ", targetName.c_str());
+    }
+}
+
 std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
     cmTarget const* target)
 {
@@ -754,113 +861,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
     }
 }
 
-void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target,
-                          std::vector<std::string> const& skipUic,
-                          std::map<std::string, std::string> &configUicOptions)
-{
-  cmMakefile *makefile = target->GetMakefile();
-
-  std::set<std::string> skipped;
-  skipped.insert(skipUic.begin(), skipUic.end());
-
-  makefile->AddDefinition("_skip_uic",
-          cmOutputConverter::EscapeForCMake(cmJoin(skipUic, ";")).c_str());
-
-  std::vector<cmSourceFile*> uiFilesWithOptions
-                                        = makefile->GetQtUiFilesWithOptions();
-
-  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
-
-  std::string _uic_opts;
-  std::vector<std::string> configs;
-  const std::string& config = makefile->GetConfigurations(configs);
-  GetUicOpts(target, config, _uic_opts);
-
-  if (!_uic_opts.empty())
-    {
-    _uic_opts = cmOutputConverter::EscapeForCMake(_uic_opts);
-    makefile->AddDefinition("_uic_target_options", _uic_opts.c_str());
-    }
-  for (std::vector<std::string>::const_iterator li = configs.begin();
-       li != configs.end(); ++li)
-    {
-    std::string config_uic_opts;
-    GetUicOpts(target, *li, config_uic_opts);
-    if (config_uic_opts != _uic_opts)
-      {
-      configUicOptions[*li] =
-                    cmOutputConverter::EscapeForCMake(config_uic_opts);
-      if(_uic_opts.empty())
-        {
-        _uic_opts = config_uic_opts;
-        }
-      }
-    }
-
-  std::string uiFileFiles;
-  std::string uiFileOptions;
-  const char* sep = "";
-
-  for(std::vector<cmSourceFile*>::const_iterator fileIt =
-      uiFilesWithOptions.begin();
-      fileIt != uiFilesWithOptions.end();
-      ++fileIt)
-    {
-    cmSourceFile* sf = *fileIt;
-    std::string absFile = cmsys::SystemTools::GetRealPath(
-                                                    sf->GetFullPath());
-
-    if (!skipped.insert(absFile).second)
-      {
-      continue;
-      }
-    uiFileFiles += sep;
-    uiFileFiles += absFile;
-    uiFileOptions += sep;
-    std::string opts = sf->GetProperty("AUTOUIC_OPTIONS");
-    cmSystemTools::ReplaceString(opts, ";", "@list_sep@");
-    uiFileOptions += opts;
-    sep = ";";
-    }
-
-  makefile->AddDefinition("_qt_uic_options_files",
-              cmOutputConverter::EscapeForCMake(uiFileFiles).c_str());
-  makefile->AddDefinition("_qt_uic_options_options",
-            cmOutputConverter::EscapeForCMake(uiFileOptions).c_str());
-
-  std::string targetName = target->GetName();
-  if (strcmp(qtVersion, "5") == 0)
-    {
-    cmTarget *qt5Uic = makefile->FindTargetToUse("Qt5::uic");
-    if (!qt5Uic)
-      {
-      // Project does not use Qt5Widgets, but has AUTOUIC ON anyway
-      }
-    else
-      {
-      makefile->AddDefinition("_qt_uic_executable",
-                              qt5Uic->ImportedGetLocation(""));
-      }
-    }
-  else if (strcmp(qtVersion, "4") == 0)
-    {
-    cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic");
-    if (!qt4Uic)
-      {
-      cmSystemTools::Error("Qt4::uic target not found ",
-                          targetName.c_str());
-      return;
-      }
-    makefile->AddDefinition("_qt_uic_executable",
-                            qt4Uic->ImportedGetLocation(""));
-    }
-  else
-    {
-    cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and "
-                        "Qt 5 ", targetName.c_str());
-    }
-}
-
 void cmQtAutoGeneratorInitializer::MergeRccOptions(
                          std::vector<std::string> &opts,
                          const std::vector<std::string> &fileOpts,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=975b753997849507684da7d529d1bbe0ffd3ade9
commit 975b753997849507684da7d529d1bbe0ffd3ade9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 18:47:49 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 18:47:49 2015 +0200

    QtAutogen: Move GetUicOpts method.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index b9bd275..ef2f2a5 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -222,6 +222,17 @@ void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target,
     }
 }
 
+static void GetUicOpts(cmTarget const* target, const std::string& config,
+                       std::string &optString)
+{
+  cmGeneratorTarget *gtgt = target->GetMakefile()
+                                  ->GetGlobalGenerator()
+                                  ->GetGeneratorTarget(target);
+  std::vector<std::string> opts;
+  gtgt->GetAutoUicOptions(opts, config);
+  optString = cmJoin(opts, ";");
+}
+
 std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
     cmTarget const* target)
 {
@@ -743,17 +754,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
     }
 }
 
-static void GetUicOpts(cmTarget const* target, const std::string& config,
-                       std::string &optString)
-{
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
-  std::vector<std::string> opts;
-  gtgt->GetAutoUicOptions(opts, config);
-  optString = cmJoin(opts, ";");
-}
-
 void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target,
                           std::vector<std::string> const& skipUic,
                           std::map<std::string, std::string> &configUicOptions)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f75ec6044c593d0ff042e13b940d2c674910b683
commit f75ec6044c593d0ff042e13b940d2c674910b683
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 18:46:58 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 18:46:58 2015 +0200

    QtAutogen: Move SetupAutoMocTarget method.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 76006fa..b9bd275 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -130,6 +130,98 @@ static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
   defs += cmJoin(defines, ";");
 }
 
+void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target,
+                          const std::string &autogenTargetName,
+                          std::vector<std::string> const& skipMoc,
+                          std::vector<std::string> const& mocHeaders,
+                          std::map<std::string, std::string> &configIncludes,
+                          std::map<std::string, std::string> &configDefines)
+{
+  cmMakefile* makefile = target->GetMakefile();
+
+  const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
+  std::string _moc_options = (tmp!=0 ? tmp : "");
+  makefile->AddDefinition("_moc_options",
+          cmOutputConverter::EscapeForCMake(_moc_options).c_str());
+  makefile->AddDefinition("_skip_moc",
+          cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str());
+  makefile->AddDefinition("_moc_headers",
+          cmOutputConverter::EscapeForCMake(cmJoin(mocHeaders, ";")).c_str());
+  bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
+  makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
+
+  std::string _moc_incs;
+  std::string _moc_compile_defs;
+  std::vector<std::string> configs;
+  const std::string& config = makefile->GetConfigurations(configs);
+  GetCompileDefinitionsAndDirectories(target, config,
+                                      _moc_incs, _moc_compile_defs);
+
+  makefile->AddDefinition("_moc_incs",
+          cmOutputConverter::EscapeForCMake(_moc_incs).c_str());
+  makefile->AddDefinition("_moc_compile_defs",
+          cmOutputConverter::EscapeForCMake(_moc_compile_defs).c_str());
+
+  for (std::vector<std::string>::const_iterator li = configs.begin();
+       li != configs.end(); ++li)
+    {
+    std::string config_moc_incs;
+    std::string config_moc_compile_defs;
+    GetCompileDefinitionsAndDirectories(target, *li,
+                                        config_moc_incs,
+                                        config_moc_compile_defs);
+    if (config_moc_incs != _moc_incs)
+      {
+      configIncludes[*li] =
+                    cmOutputConverter::EscapeForCMake(config_moc_incs);
+      if(_moc_incs.empty())
+        {
+        _moc_incs = config_moc_incs;
+        }
+      }
+    if (config_moc_compile_defs != _moc_compile_defs)
+      {
+      configDefines[*li] =
+            cmOutputConverter::EscapeForCMake(config_moc_compile_defs);
+      if(_moc_compile_defs.empty())
+        {
+        _moc_compile_defs = config_moc_compile_defs;
+        }
+      }
+    }
+
+  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+  if (strcmp(qtVersion, "5") == 0)
+    {
+    cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc");
+    if (!qt5Moc)
+      {
+      cmSystemTools::Error("Qt5::moc target not found ",
+                          autogenTargetName.c_str());
+      return;
+      }
+    makefile->AddDefinition("_qt_moc_executable",
+                            qt5Moc->ImportedGetLocation(""));
+    }
+  else if (strcmp(qtVersion, "4") == 0)
+    {
+    cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc");
+    if (!qt4Moc)
+      {
+      cmSystemTools::Error("Qt4::moc target not found ",
+                          autogenTargetName.c_str());
+      return;
+      }
+    makefile->AddDefinition("_qt_moc_executable",
+                            qt4Moc->ImportedGetLocation(""));
+    }
+  else
+    {
+    cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and "
+                        "Qt 5 ", autogenTargetName.c_str());
+    }
+}
+
 std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
     cmTarget const* target)
 {
@@ -651,98 +743,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
     }
 }
 
-void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target,
-                          const std::string &autogenTargetName,
-                          std::vector<std::string> const& skipMoc,
-                          std::vector<std::string> const& mocHeaders,
-                          std::map<std::string, std::string> &configIncludes,
-                          std::map<std::string, std::string> &configDefines)
-{
-  cmMakefile* makefile = target->GetMakefile();
-
-  const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
-  std::string _moc_options = (tmp!=0 ? tmp : "");
-  makefile->AddDefinition("_moc_options",
-          cmOutputConverter::EscapeForCMake(_moc_options).c_str());
-  makefile->AddDefinition("_skip_moc",
-          cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str());
-  makefile->AddDefinition("_moc_headers",
-          cmOutputConverter::EscapeForCMake(cmJoin(mocHeaders, ";")).c_str());
-  bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
-  makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
-
-  std::string _moc_incs;
-  std::string _moc_compile_defs;
-  std::vector<std::string> configs;
-  const std::string& config = makefile->GetConfigurations(configs);
-  GetCompileDefinitionsAndDirectories(target, config,
-                                      _moc_incs, _moc_compile_defs);
-
-  makefile->AddDefinition("_moc_incs",
-          cmOutputConverter::EscapeForCMake(_moc_incs).c_str());
-  makefile->AddDefinition("_moc_compile_defs",
-          cmOutputConverter::EscapeForCMake(_moc_compile_defs).c_str());
-
-  for (std::vector<std::string>::const_iterator li = configs.begin();
-       li != configs.end(); ++li)
-    {
-    std::string config_moc_incs;
-    std::string config_moc_compile_defs;
-    GetCompileDefinitionsAndDirectories(target, *li,
-                                        config_moc_incs,
-                                        config_moc_compile_defs);
-    if (config_moc_incs != _moc_incs)
-      {
-      configIncludes[*li] =
-                    cmOutputConverter::EscapeForCMake(config_moc_incs);
-      if(_moc_incs.empty())
-        {
-        _moc_incs = config_moc_incs;
-        }
-      }
-    if (config_moc_compile_defs != _moc_compile_defs)
-      {
-      configDefines[*li] =
-            cmOutputConverter::EscapeForCMake(config_moc_compile_defs);
-      if(_moc_compile_defs.empty())
-        {
-        _moc_compile_defs = config_moc_compile_defs;
-        }
-      }
-    }
-
-  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
-  if (strcmp(qtVersion, "5") == 0)
-    {
-    cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc");
-    if (!qt5Moc)
-      {
-      cmSystemTools::Error("Qt5::moc target not found ",
-                          autogenTargetName.c_str());
-      return;
-      }
-    makefile->AddDefinition("_qt_moc_executable",
-                            qt5Moc->ImportedGetLocation(""));
-    }
-  else if (strcmp(qtVersion, "4") == 0)
-    {
-    cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc");
-    if (!qt4Moc)
-      {
-      cmSystemTools::Error("Qt4::moc target not found ",
-                          autogenTargetName.c_str());
-      return;
-      }
-    makefile->AddDefinition("_qt_moc_executable",
-                            qt4Moc->ImportedGetLocation(""));
-    }
-  else
-    {
-    cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and "
-                        "Qt 5 ", autogenTargetName.c_str());
-    }
-}
-
 static void GetUicOpts(cmTarget const* target, const std::string& config,
                        std::string &optString)
 {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3158e45b8fde882603e1d9b2262a5c64e25c1ee
commit f3158e45b8fde882603e1d9b2262a5c64e25c1ee
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 18:46:11 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 18:46:11 2015 +0200

    QtAutogen: Move GetCompileDefinitionsAndDirectories method.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 216c5b4..76006fa 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -108,6 +108,28 @@ void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target,
     }
 }
 
+static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
+                                                const std::string& config,
+                                                std::string &incs,
+                                                std::string &defs)
+{
+  cmMakefile* makefile = target->GetMakefile();
+  cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator();
+  std::vector<std::string> includeDirs;
+  cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target);
+  cmLocalGenerator *localGen = gtgt->GetLocalGenerator();
+  // 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);
+
+  incs = cmJoin(includeDirs, ";");
+
+  std::set<std::string> defines;
+  localGen->AddCompileDefinitions(defines, target, config, "CXX");
+
+  defs += cmJoin(defines, ";");
+}
+
 std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
     cmTarget const* target)
 {
@@ -489,28 +511,6 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
     }
 }
 
-static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
-                                                const std::string& config,
-                                                std::string &incs,
-                                                std::string &defs)
-{
-  cmMakefile* makefile = target->GetMakefile();
-  cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator();
-  std::vector<std::string> includeDirs;
-  cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target);
-  cmLocalGenerator *localGen = gtgt->GetLocalGenerator();
-  // 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);
-
-  incs = cmJoin(includeDirs, ";");
-
-  std::set<std::string> defines;
-  localGen->AddCompileDefinitions(defines, target, config, "CXX");
-
-  defs += cmJoin(defines, ";");
-}
-
 void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
     cmTarget const* target)
 {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=493b17f8c7fb171fd7ca36cc0b29257939609298
commit 493b17f8c7fb171fd7ca36cc0b29257939609298
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 5 18:45:21 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 5 18:45:21 2015 +0200

    QtAutogen: Move SetupSourceFiles method.

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 24e7ed8..216c5b4 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -25,6 +25,89 @@
 # include "cmGlobalVisualStudioGenerator.h"
 #endif
 
+void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target,
+                                   std::vector<std::string>& skipMoc,
+                                   std::vector<std::string>& mocSources,
+                                   std::vector<std::string>& mocHeaders,
+                                   std::vector<std::string>& skipUic)
+{
+  cmMakefile* makefile = target->GetMakefile();
+
+  std::vector<cmSourceFile*> srcFiles;
+  cmGeneratorTarget *gtgt = target->GetMakefile()
+                                  ->GetGlobalGenerator()
+                                  ->GetGeneratorTarget(target);
+  gtgt->GetConfigCommonSourceFiles(srcFiles);
+
+  std::vector<std::string> newRccFiles;
+
+  for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
+      fileIt != srcFiles.end();
+      ++fileIt)
+    {
+    cmSourceFile* sf = *fileIt;
+    std::string absFile = cmsys::SystemTools::GetRealPath(
+                                                    sf->GetFullPath());
+    bool skipFileForMoc =
+        cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
+    bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
+
+    if(cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC")))
+      {
+      skipUic.push_back(absFile);
+      }
+
+    std::string ext = sf->GetExtension();
+
+    if (target->GetPropertyAsBool("AUTORCC"))
+      {
+      if (ext == "qrc"
+          && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")))
+        {
+        std::string basename = cmsys::SystemTools::
+                                      GetFilenameWithoutLastExtension(absFile);
+
+        std::string rcc_output_dir = target->GetSupportDirectory();
+        cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
+        std::string rcc_output_file = rcc_output_dir;
+        rcc_output_file += "/qrc_" + basename + ".cpp";
+        makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
+                                rcc_output_file.c_str(), false);
+        makefile->GetOrCreateSource(rcc_output_file, true);
+        newRccFiles.push_back(rcc_output_file);
+        }
+      }
+
+    if (!generated)
+      {
+      if (skipFileForMoc)
+        {
+        skipMoc.push_back(absFile);
+        }
+      else
+        {
+        cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
+                                                                ext.c_str());
+        if (fileType == cmSystemTools::CXX_FILE_FORMAT)
+          {
+          mocSources.push_back(absFile);
+          }
+        else if (fileType == cmSystemTools::HEADER_FILE_FORMAT)
+          {
+          mocHeaders.push_back(absFile);
+          }
+        }
+      }
+    }
+
+  for(std::vector<std::string>::const_iterator fileIt = newRccFiles.begin();
+      fileIt != newRccFiles.end();
+      ++fileIt)
+    {
+    const_cast<cmTarget*>(target)->AddSource(*fileIt);
+    }
+}
+
 std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
     cmTarget const* target)
 {
@@ -568,89 +651,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
     }
 }
 
-void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target,
-                                   std::vector<std::string>& skipMoc,
-                                   std::vector<std::string>& mocSources,
-                                   std::vector<std::string>& mocHeaders,
-                                   std::vector<std::string>& skipUic)
-{
-  cmMakefile* makefile = target->GetMakefile();
-
-  std::vector<cmSourceFile*> srcFiles;
-  cmGeneratorTarget *gtgt = target->GetMakefile()
-                                  ->GetGlobalGenerator()
-                                  ->GetGeneratorTarget(target);
-  gtgt->GetConfigCommonSourceFiles(srcFiles);
-
-  std::vector<std::string> newRccFiles;
-
-  for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
-      fileIt != srcFiles.end();
-      ++fileIt)
-    {
-    cmSourceFile* sf = *fileIt;
-    std::string absFile = cmsys::SystemTools::GetRealPath(
-                                                    sf->GetFullPath());
-    bool skipFileForMoc =
-        cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
-    bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
-
-    if(cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC")))
-      {
-      skipUic.push_back(absFile);
-      }
-
-    std::string ext = sf->GetExtension();
-
-    if (target->GetPropertyAsBool("AUTORCC"))
-      {
-      if (ext == "qrc"
-          && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")))
-        {
-        std::string basename = cmsys::SystemTools::
-                                      GetFilenameWithoutLastExtension(absFile);
-
-        std::string rcc_output_dir = target->GetSupportDirectory();
-        cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
-        std::string rcc_output_file = rcc_output_dir;
-        rcc_output_file += "/qrc_" + basename + ".cpp";
-        makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
-                                rcc_output_file.c_str(), false);
-        makefile->GetOrCreateSource(rcc_output_file, true);
-        newRccFiles.push_back(rcc_output_file);
-        }
-      }
-
-    if (!generated)
-      {
-      if (skipFileForMoc)
-        {
-        skipMoc.push_back(absFile);
-        }
-      else
-        {
-        cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
-                                                                ext.c_str());
-        if (fileType == cmSystemTools::CXX_FILE_FORMAT)
-          {
-          mocSources.push_back(absFile);
-          }
-        else if (fileType == cmSystemTools::HEADER_FILE_FORMAT)
-          {
-          mocHeaders.push_back(absFile);
-          }
-        }
-      }
-    }
-
-  for(std::vector<std::string>::const_iterator fileIt = newRccFiles.begin();
-      fileIt != newRccFiles.end();
-      ++fileIt)
-    {
-    const_cast<cmTarget*>(target)->AddSource(*fileIt);
-    }
-}
-
 void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target,
                           const std::string &autogenTargetName,
                           std::vector<std::string> const& skipMoc,

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

Summary of changes:
 Source/cmGlobalGenerator.cxx            |   30 +-
 Source/cmGlobalGenerator.h              |    2 +-
 Source/cmLocalGenerator.cxx             |    2 +-
 Source/cmLocalGenerator.h               |    2 +-
 Source/cmQtAutoGeneratorInitializer.cxx | 1707 +++++++++++++++----------------
 Source/cmQtAutoGeneratorInitializer.h   |   41 +-
 6 files changed, 861 insertions(+), 923 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list