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  fff9c79d71279e95d6ccf8535f3c6ecf125847b8 (commit)
       via  bb670d9625e670a0e87ec048e44db39b9d2b336f (commit)
       via  3f86032bdab94e219d053c10b7e55eba9c06e562 (commit)
       via  f24e1d37cef95145927d14d186e1615fca23a75b (commit)
       via  f27c5852b0d1e37fb27bd1da1e7295b5f1fc963d (commit)
       via  d7d2cb48c69e2a9da72a8baf188f02b81ec9c34f (commit)
       via  721997a7a23f0cfa5c9e096cc3768625a51f359d (commit)
       via  9f47d32697686265bc2c5a708d2b53e2337f3f10 (commit)
       via  597124ba8e409edc28cbf8f2a55150d2913a50e3 (commit)
       via  2b400b242101fd8b7a46073412830278aa3cc9ec (commit)
       via  edf0b8a52bd4db8557adaf11d7096f7982c373aa (commit)
       via  06430919f4b903ba256ce158caf223f515faa8a4 (commit)
       via  ca179f2afc6d8ab5e0df3e35255155c21a61b5f6 (commit)
       via  119791ae528aace81f6c209e05798c80d8926b3d (commit)
       via  95e4cfc5947fb5a324f6dad50cff8d71f928aba8 (commit)
       via  6c55755bdd54c2d474e2c8fe4c9d078e10404f26 (commit)
       via  1491ab1c6626ed6a3b67e74b94fd18230e1bb4d4 (commit)
       via  29112c9a695a8dce6486203d0415f17ac41d3a0b (commit)
       via  6d333be14d23b9aaf4452189199134bd674ad395 (commit)
       via  52688bf7453cdb767e231f5fdc7d80ce79ae239d (commit)
      from  905d58d9927224f4907d42179842ef90d95c625f (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=fff9c79d71279e95d6ccf8535f3c6ecf125847b8
commit fff9c79d71279e95d6ccf8535f3c6ecf125847b8
Merge: 905d58d bb670d9
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Jan 13 09:34:58 2017 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Fri Jan 13 09:34:58 2017 -0500

    Merge topic 'Autogen_Config' into next
    
    bb670d96 Autogen: Generators: Remove space
    3f86032b Autogen: Generators: Rename requiresMocing method
    f24e1d37 Autogen: Generators: Fix clang-tidy readability-else-after-return
    f27c5852 Autogen: Initializer: Add old settings file to clean files
    d7d2cb48 Autogen: Generators: Save the UIC/RCC settings that were actually 
used
    721997a7 Autogen: Generators: Dedicated generateAll variables for 
MOC/UIC/RCC
    9f47d326 Autogen: Generators: Save the MOC settings that were actually used
    597124ba Autogen: Generators: Add function to read makefile definitions 
config aware
    2b400b24 Autogen: Generators: Move moc/uic/rcc executable test to generate 
method
    edf0b8a5 Autogen: Generators: Rename GenerateFoo methods to FooGenerate
    06430919 Autogen: Generators: Use FileAbsentOrOlder for UIC tests
    ca179f2a Autogen: Generators: Use FileAbsentOrOlder for MOC tests
    119791ae Autogen: Generators: Introduce FileAbsentOrOlder function
    95e4cfc5 Autogen: Generators: Simplify (and fix) JoinExts function
    6c55755b Autogen: Generators: Make class static method a source static 
function
    1491ab1c Autogen: Generators: Make class static method a source static 
function
    ...


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb670d9625e670a0e87ec048e44db39b9d2b336f
commit bb670d9625e670a0e87ec048e44db39b9d2b336f
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Thu Jan 12 23:58:39 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:45 2017 +0100

    Autogen: Generators: Remove space

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 4979997..c84fe4f 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -585,7 +585,6 @@ void cmQtAutoGenerators::Init()
 
   if (this->IncludeProjectDirsBefore) {
     const std::string binDir = "-I" + this->ProjectBinaryDir;
-
     const std::string srcDir = "-I" + this->ProjectSourceDir;
 
     std::list<std::string> sortedMocIncludes;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f86032bdab94e219d053c10b7e55eba9c06e562
commit 3f86032bdab94e219d053c10b7e55eba9c06e562
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Thu Jan 12 23:54:20 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:45 2017 +0100

    Autogen: Generators: Rename requiresMocing method

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 06decf8..4979997 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -683,8 +683,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
  * @brief Tests if the C++ content requires moc processing
  * @return True if moc is required
  */
-bool cmQtAutoGenerators::requiresMocing(const std::string& text,
-                                        std::string& macroName)
+bool cmQtAutoGenerators::MocRequired(const std::string& text,
+                                     std::string& macroName)
 {
   // Run a simple check before an expensive regular expression check
   if (strstr(text.c_str(), "Q_OBJECT") != CM_NULLPTR) {
@@ -812,7 +812,7 @@ bool cmQtAutoGenerators::ParseContentForMoc(
     cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename);
 
   std::string macroName;
-  const bool requiresMoc = this->requiresMocing(contentsString, macroName);
+  const bool requiresMoc = this->MocRequired(contentsString, macroName);
   bool ownDotMocIncluded = false;
   bool ownMocUnderscoreIncluded = false;
   std::string ownMocUnderscoreFile;
@@ -1053,7 +1053,7 @@ void cmQtAutoGenerators::ParseHeaders(
         this->LogInfo(err.str());
       }
       std::string macroName;
-      if (this->requiresMocing(contents, macroName)) {
+      if (this->MocRequired(contents, macroName)) {
         notIncludedMocs[headerName] = fpathCheckSum.getPart(headerName) +
           "/moc_" +
           cmsys::SystemTools::GetFilenameWithoutLastExtension(headerName) +
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 3720a00..7891eb9 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -39,7 +39,7 @@ private:
   bool RunAutogen(cmMakefile* makefile);
 
   // - Content analysis
-  bool requiresMocing(const std::string& text, std::string& macroName);
+  bool MocRequired(const std::string& text, std::string& macroName);
   bool MocSkipTest(const std::string& absFilename);
   bool UicSkipTest(const std::string& absFilename);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f24e1d37cef95145927d14d186e1615fca23a75b
commit f24e1d37cef95145927d14d186e1615fca23a75b
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Thu Jan 12 23:51:01 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:45 2017 +0100

    Autogen: Generators: Fix clang-tidy readability-else-after-return

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 2a038b9..06decf8 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -918,7 +918,11 @@ bool cmQtAutoGenerators::ParseContentForMoc(
           }
         } else {
           // Mode: Strict
-          if (basename != scannedFileBasename) {
+          if (basename == scannedFileBasename) {
+            // Include self
+            fileToMoc = absFilename;
+            ownDotMocIncluded = true;
+          } else {
             // Don't allow FOO.moc include other than self in strict mode
             std::ostringstream err;
             err << "AutoMoc: Error: " << absFilename << "\n"
@@ -929,10 +933,6 @@ bool cmQtAutoGenerators::ParseContentForMoc(
                 << ".moc\" to run moc on this source file.\n";
             this->LogError(err.str());
             return false;
-          } else {
-            // Include self
-            fileToMoc = absFilename;
-            ownDotMocIncluded = true;
           }
         }
         if (!fileToMoc.empty()) {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f27c5852b0d1e37fb27bd1da1e7295b5f1fc963d
commit f27c5852b0d1e37fb27bd1da1e7295b5f1fc963d
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Thu Jan 12 00:49:58 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:44 2017 +0100

    Autogen: Initializer: Add old settings file to clean files

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx 
b/Source/cmQtAutoGeneratorInitializer.cxx
index 6d4c302..825eba0 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -674,6 +674,14 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
   const std::string qtMajorVersion = GetQtMajorVersion(target);
   std::vector<std::string> autogenOutputFiles;
 
+  // Remove old settings on cleanup
+  {
+    std::string fname = GetAutogenTargetFilesDir(target);
+    fname += "/AutogenOldSettings.cmake";
+    makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", fname.c_str(),
+                             false);
+  }
+
   // Create autogen target build directory and add it to the clean files
   cmSystemTools::MakeDirectory(autogenBuildDir);
   makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7d2cb48c69e2a9da72a8baf188f02b81ec9c34f
commit d7d2cb48c69e2a9da72a8baf188f02b81ec9c34f
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 23:04:45 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:44 2017 +0100

    Autogen: Generators: Save the UIC/RCC settings that were actually used

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 1d7e910..2a038b9 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -30,6 +30,8 @@
 // -- Static variables
 
 static const char* MocOldSettingsKey = "AM_MOC_OLD_SETTINGS";
+static const char* UicOldSettingsKey = "AM_UIC_OLD_SETTINGS";
+static const char* RccOldSettingsKey = "AM_RCC_OLD_SETTINGS";
 
 // -- Static functions
 
@@ -49,11 +51,11 @@ static std::string GetConfigDefinition(cmMakefile* makefile,
   return makefile->GetSafeDefinition(key);
 }
 
-static std::string MocOldSettingsFile(const std::string& targetDirectory)
+static std::string OldSettingsFile(const std::string& targetDirectory)
 {
   std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
   cmSystemTools::ConvertToUnixSlashes(filename);
-  filename += "/AutomocOldSettings.cmake";
+  filename += "/AutogenOldSettings.cmake";
   return filename;
 }
 
@@ -138,6 +140,21 @@ static bool ListContains(const std::vector<std::string>& 
list,
   return (std::find(list.begin(), list.end(), entry) != list.end());
 }
 
+static std::string JoinOptions(const std::map<std::string, std::string>& opts)
+{
+  std::string result;
+  for (std::map<std::string, std::string>::const_iterator it = opts.begin();
+       it != opts.end(); ++it) {
+    if (it != opts.begin()) {
+      result += "%%%";
+    }
+    result += it->first;
+    result += "===";
+    result += it->second;
+  }
+  return result;
+}
+
 static std::string JoinExts(const std::vector<std::string>& lst)
 {
   std::string result;
@@ -242,7 +259,7 @@ bool cmQtAutoGenerators::Run(const std::string& 
targetDirectory,
     return false;
   }
   // Read old settings
-  this->ReadOldMocSettingsFile(mf.get(), targetDirectory);
+  this->OldSettingsReadFile(mf.get(), targetDirectory);
   // Init and run
   this->Init();
   if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") {
@@ -251,7 +268,7 @@ bool cmQtAutoGenerators::Run(const std::string& 
targetDirectory,
     }
   }
   // Write latest settings
-  if (!this->WriteOldMocSettingsFile(targetDirectory)) {
+  if (!this->OldSettingsWriteFile(targetDirectory)) {
     return false;
   }
   return true;
@@ -396,7 +413,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
   return true;
 }
 
-std::string cmQtAutoGenerators::MocCurrentSettingsString()
+std::string cmQtAutoGenerators::MocSettingsStringCompose()
 {
   std::string res;
   res += this->MocCompileDefinitionsStr;
@@ -410,42 +427,108 @@ std::string 
cmQtAutoGenerators::MocCurrentSettingsString()
   return res;
 }
 
-void cmQtAutoGenerators::ReadOldMocSettingsFile(
+std::string cmQtAutoGenerators::UicSettingsStringCompose()
+{
+  std::string res;
+  res += cmJoin(this->UicTargetOptions, "@osep@");
+  res += " ~~~ ";
+  res += JoinOptions(this->UicOptions);
+  res += " ~~~ ";
+  return res;
+}
+
+std::string cmQtAutoGenerators::RccSettingsStringCompose()
+{
+  std::string res;
+  res += JoinOptions(this->RccOptions);
+  res += " ~~~ ";
+  return res;
+}
+
+void cmQtAutoGenerators::OldSettingsReadFile(
   cmMakefile* makefile, const std::string& targetDirectory)
 {
-  // Compose current settings string
-  this->MocSettingsString = this->MocCurrentSettingsString();
-  // Read old settings
-  const std::string filename = MocOldSettingsFile(targetDirectory);
-  if (makefile->ReadListFile(filename.c_str())) {
-    std::string oldSettings = makefile->GetSafeDefinition(MocOldSettingsKey);
-    if (oldSettings != this->MocSettingsString) {
-      // If settings changed everything needs to be re-generated.
+  if (!this->MocExecutable.empty() || !this->UicExecutable.empty() ||
+      !this->RccExecutable.empty()) {
+    // Compose current settings strings
+    this->MocSettingsString = this->MocSettingsStringCompose();
+    this->UicSettingsString = this->UicSettingsStringCompose();
+    this->RccSettingsString = this->RccSettingsStringCompose();
+
+    // Read old settings
+    const std::string filename = OldSettingsFile(targetDirectory);
+    if (makefile->ReadListFile(filename.c_str())) {
+      if (!this->MocExecutable.empty()) {
+        const std::string sol = makefile->GetSafeDefinition(MocOldSettingsKey);
+        if (sol != this->MocSettingsString) {
+          this->GenerateMocAll = true;
+        }
+      }
+      if (!this->UicExecutable.empty()) {
+        const std::string sol = makefile->GetSafeDefinition(UicOldSettingsKey);
+        if (sol != this->UicSettingsString) {
+          this->GenerateUicAll = true;
+        }
+      }
+      if (!this->RccExecutable.empty()) {
+        const std::string sol = makefile->GetSafeDefinition(RccOldSettingsKey);
+        if (sol != this->RccSettingsString) {
+          this->GenerateRccAll = true;
+        }
+      }
+      // In case any setting changed remove the old settings file.
+      // This triggers a full rebuild on the next run if the current
+      // build is aborted before writing the current settings in the end.
+      if (this->GenerateMocAll || this->GenerateUicAll ||
+          this->GenerateRccAll) {
+        cmSystemTools::RemoveFile(filename);
+      }
+    } else {
+      // If the file could not be read re-generate everythiung.
       this->GenerateMocAll = true;
-      // Remove old file in case processing gets aborted before
-      // writing the current settings in the end.
-      cmSystemTools::RemoveFile(filename);
+      this->GenerateUicAll = true;
+      this->GenerateRccAll = true;
     }
-  } else {
-    // If the file could not be read everything needs to be re-generated.
-    this->GenerateMocAll = true;
   }
 }
 
-bool cmQtAutoGenerators::WriteOldMocSettingsFile(
+bool cmQtAutoGenerators::OldSettingsWriteFile(
   const std::string& targetDirectory)
 {
   bool success = true;
-  if (!this->MocExecutable.empty()) {
-    const std::string filename = MocOldSettingsFile(targetDirectory);
+  // Only write if any setting changed
+  if (this->GenerateMocAll || this->GenerateUicAll || this->GenerateRccAll) {
+    const std::string filename = OldSettingsFile(targetDirectory);
     cmsys::ofstream outfile;
     outfile.open(filename.c_str(), std::ios::trunc);
-    if ((success = static_cast<bool>(outfile))) {
-      outfile << "set(" << MocOldSettingsKey << " "
-              << cmOutputConverter::EscapeForCMake(this->MocSettingsString)
-              << ")\n";
+    if (outfile) {
+      if (!this->MocExecutable.empty()) {
+        outfile << "set(" << MocOldSettingsKey << " "
+                << cmOutputConverter::EscapeForCMake(this->MocSettingsString)
+                << ")\n";
+      }
+      if (!this->UicExecutable.empty()) {
+        outfile << "set(" << UicOldSettingsKey << " "
+                << cmOutputConverter::EscapeForCMake(this->UicSettingsString)
+                << ")\n";
+      }
+      if (!this->RccExecutable.empty()) {
+        outfile << "set(" << RccOldSettingsKey << " "
+                << cmOutputConverter::EscapeForCMake(this->RccSettingsString)
+                << ")\n";
+      }
       success = outfile.good();
       outfile.close();
+    } else {
+      success = false;
+      // Remove old settings file to trigger full rebuild on next run
+      cmSystemTools::RemoveFile(filename);
+      {
+        std::ostringstream err;
+        err << "AutoGen: Error: Writing old settings file failed: " << filename
+            << std::endl;
+        this->LogError(err.str());
+      }
     }
   }
   return success;
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 3427be6..3720a00 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -27,10 +27,12 @@ private:
                            const std::string& targetDirectory,
                            const std::string& config);
 
-  std::string MocCurrentSettingsString();
-  void ReadOldMocSettingsFile(cmMakefile* makefile,
-                              const std::string& targetDirectory);
-  bool WriteOldMocSettingsFile(const std::string& targetDirectory);
+  std::string MocSettingsStringCompose();
+  std::string UicSettingsStringCompose();
+  std::string RccSettingsStringCompose();
+  void OldSettingsReadFile(cmMakefile* makefile,
+                           const std::string& targetDirectory);
+  bool OldSettingsWriteFile(const std::string& targetDirectory);
 
   // - Init and run
   void Init();
@@ -138,10 +140,12 @@ private:
   std::vector<std::string> SkipUic;
   std::vector<std::string> UicTargetOptions;
   std::map<std::string, std::string> UicOptions;
+  std::string UicSettingsString;
   // - Rcc
   std::vector<std::string> RccSources;
   std::map<std::string, std::string> RccOptions;
   std::map<std::string, std::vector<std::string> > RccInputs;
+  std::string RccSettingsString;
   // - Utility
   cmFilePathChecksum fpathCheckSum;
   cmsys::RegularExpression RegExpQObject;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=721997a7a23f0cfa5c9e096cc3768625a51f359d
commit 721997a7a23f0cfa5c9e096cc3768625a51f359d
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 22:48:01 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:44 2017 +0100

    Autogen: Generators: Dedicated generateAll variables for MOC/UIC/RCC

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index db35fa6..1d7e910 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -197,7 +197,9 @@ cmQtAutoGenerators::cmQtAutoGenerators()
   , RunMocFailed(false)
   , RunUicFailed(false)
   , RunRccFailed(false)
-  , GenerateAll(false)
+  , GenerateMocAll(false)
+  , GenerateUicAll(false)
+  , GenerateRccAll(false)
 {
 
   std::string colorEnv;
@@ -419,14 +421,14 @@ void cmQtAutoGenerators::ReadOldMocSettingsFile(
     std::string oldSettings = makefile->GetSafeDefinition(MocOldSettingsKey);
     if (oldSettings != this->MocSettingsString) {
       // If settings changed everything needs to be re-generated.
-      this->GenerateAll = true;
+      this->GenerateMocAll = true;
       // Remove old file in case processing gets aborted before
       // writing the current settings in the end.
       cmSystemTools::RemoveFile(filename);
     }
   } else {
     // If the file could not be read everything needs to be re-generated.
-    this->GenerateAll = true;
+    this->GenerateMocAll = true;
   }
 }
 
@@ -1119,7 +1121,7 @@ bool cmQtAutoGenerators::MocGenerateFile(const 
std::string& sourceFile,
     this->AutogenBuildSubDir + subDirPrefix + mocFileName;
   const std::string mocFileAbs = this->CurrentBinaryDir + mocFileRel;
 
-  bool generateMoc = this->GenerateAll;
+  bool generateMoc = this->GenerateMocAll;
   // Test if the source file is newer that the build file
   if (!generateMoc) {
     generateMoc = FileAbsentOrOlder(mocFileAbs, sourceFile);
@@ -1247,7 +1249,7 @@ bool cmQtAutoGenerators::UicGenerateFile(const 
std::string& realName,
     this->AutogenBuildSubDir + "include/" + uiOutputFile;
   const std::string uicFileAbs = this->CurrentBinaryDir + uicFileRel;
 
-  bool generateUic = this->GenerateAll;
+  bool generateUic = this->GenerateUicAll;
   // Test if the source file is newer that the build file
   if (!generateUic) {
     generateUic = FileAbsentOrOlder(uicFileAbs, uiInputFile);
@@ -1368,7 +1370,7 @@ bool cmQtAutoGenerators::QrcGenerateFile(const 
std::string& qrcInputFile,
 
   const std::string qrcBuildFile = this->CurrentBinaryDir + qrcOutputFile;
 
-  bool generateQrc = this->GenerateAll;
+  bool generateQrc = this->GenerateRccAll;
   // Test if the resources list file is newer than build file
   if (!generateQrc) {
     generateQrc = FileAbsentOrOlder(qrcBuildFile, qrcInputFile);
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index a26cfbc..3427be6 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -155,7 +155,9 @@ private:
   bool RunMocFailed;
   bool RunUicFailed;
   bool RunRccFailed;
-  bool GenerateAll;
+  bool GenerateMocAll;
+  bool GenerateUicAll;
+  bool GenerateRccAll;
   bool MocRelaxedMode;
 };
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f47d32697686265bc2c5a708d2b53e2337f3f10
commit 9f47d32697686265bc2c5a708d2b53e2337f3f10
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 22:34:24 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:44 2017 +0100

    Autogen: Generators: Save the MOC settings that were actually used

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 8d525dc..db35fa6 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -27,6 +27,10 @@
 #include <unistd.h>
 #endif
 
+// -- Static variables
+
+static const char* MocOldSettingsKey = "AM_MOC_OLD_SETTINGS";
+
 // -- Static functions
 
 static std::string GetConfigDefinition(cmMakefile* makefile,
@@ -45,6 +49,14 @@ static std::string GetConfigDefinition(cmMakefile* makefile,
   return makefile->GetSafeDefinition(key);
 }
 
+static std::string MocOldSettingsFile(const std::string& targetDirectory)
+{
+  std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
+  cmSystemTools::ConvertToUnixSlashes(filename);
+  filename += "/AutomocOldSettings.cmake";
+  return filename;
+}
+
 static std::string FindMatchingHeader(
   const std::string& absPath, const std::string& mocSubDir,
   const std::string& basename,
@@ -227,15 +239,20 @@ bool cmQtAutoGenerators::Run(const std::string& 
targetDirectory,
   if (!this->ReadAutogenInfoFile(mf.get(), targetDirectory, config)) {
     return false;
   }
-  this->ReadOldMocDefinitionsFile(mf.get(), targetDirectory);
+  // Read old settings
+  this->ReadOldMocSettingsFile(mf.get(), targetDirectory);
+  // Init and run
   this->Init();
-
   if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") {
     if (!this->RunAutogen(mf.get())) {
       return false;
     }
   }
-  return this->WriteOldMocDefinitionsFile(targetDirectory);
+  // Write latest settings
+  if (!this->WriteOldMocSettingsFile(targetDirectory)) {
+    return false;
+  }
+  return true;
 }
 
 bool cmQtAutoGenerators::ReadAutogenInfoFile(
@@ -369,9 +386,6 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
     }
   }
 
-  // - Settings
-  this->CurrentCompileSettingsStr = this->MakeCompileSettingsString(makefile);
-
   // - Flags
   this->IncludeProjectDirsBefore =
     makefile->IsOn("AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE");
@@ -380,58 +394,58 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
   return true;
 }
 
-std::string cmQtAutoGenerators::MakeCompileSettingsString(cmMakefile* makefile)
+std::string cmQtAutoGenerators::MocCurrentSettingsString()
 {
-  std::string s;
-  s += makefile->GetSafeDefinition("AM_MOC_COMPILE_DEFINITIONS");
-  s += " ~~~ ";
-  s += makefile->GetSafeDefinition("AM_MOC_INCLUDES");
-  s += " ~~~ ";
-  s += makefile->GetSafeDefinition("AM_MOC_OPTIONS");
-  s += " ~~~ ";
-  s += makefile->IsOn("AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE") ? "TRUE"
-                                                                     : "FALSE";
-  s += " ~~~ ";
-
-  return s;
+  std::string res;
+  res += this->MocCompileDefinitionsStr;
+  res += " ~~~ ";
+  res += this->MocIncludesStr;
+  res += " ~~~ ";
+  res += this->MocOptionsStr;
+  res += " ~~~ ";
+  res += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE";
+  res += " ~~~ ";
+  return res;
 }
 
-void cmQtAutoGenerators::ReadOldMocDefinitionsFile(
+void cmQtAutoGenerators::ReadOldMocSettingsFile(
   cmMakefile* makefile, const std::string& targetDirectory)
 {
-  std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
-  cmSystemTools::ConvertToUnixSlashes(filename);
-  filename += "/AutomocOldMocDefinitions.cmake";
-
+  // Compose current settings string
+  this->MocSettingsString = this->MocCurrentSettingsString();
+  // Read old settings
+  const std::string filename = MocOldSettingsFile(targetDirectory);
   if (makefile->ReadListFile(filename.c_str())) {
-    this->OldCompileSettingsStr =
-      makefile->GetSafeDefinition("AM_OLD_COMPILE_SETTINGS");
+    std::string oldSettings = makefile->GetSafeDefinition(MocOldSettingsKey);
+    if (oldSettings != this->MocSettingsString) {
+      // If settings changed everything needs to be re-generated.
+      this->GenerateAll = true;
+      // Remove old file in case processing gets aborted before
+      // writing the current settings in the end.
+      cmSystemTools::RemoveFile(filename);
+    }
+  } else {
+    // If the file could not be read everything needs to be re-generated.
+    this->GenerateAll = true;
   }
 }
 
-bool cmQtAutoGenerators::WriteOldMocDefinitionsFile(
+bool cmQtAutoGenerators::WriteOldMocSettingsFile(
   const std::string& targetDirectory)
 {
   bool success = true;
-
-  std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
-  cmSystemTools::ConvertToUnixSlashes(filename);
-  filename += "/AutomocOldMocDefinitions.cmake";
-
-  {
+  if (!this->MocExecutable.empty()) {
+    const std::string filename = MocOldSettingsFile(targetDirectory);
     cmsys::ofstream outfile;
     outfile.open(filename.c_str(), std::ios::trunc);
-    if (outfile) {
-      outfile << "set(AM_OLD_COMPILE_SETTINGS "
-              << cmOutputConverter::EscapeForCMake(
-                   this->CurrentCompileSettingsStr)
+    if ((success = static_cast<bool>(outfile))) {
+      outfile << "set(" << MocOldSettingsKey << " "
+              << cmOutputConverter::EscapeForCMake(this->MocSettingsString)
               << ")\n";
       success = outfile.good();
-    } else {
-      success = false;
+      outfile.close();
     }
   }
-
   return success;
 }
 
@@ -517,11 +531,6 @@ void cmQtAutoGenerators::Init()
 
 bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
 {
-  // If settings changed everything needs to be re-generated.
-  if (this->OldCompileSettingsStr != this->CurrentCompileSettingsStr) {
-    this->GenerateAll = true;
-  }
-
   // the program goes through all .cpp files to see which moc files are
   // included. It is not really interesting how the moc file is named, but
   // what file the moc is created from. Once a moc is included the same moc
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index c2be22c..a26cfbc 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -26,11 +26,11 @@ private:
   bool ReadAutogenInfoFile(cmMakefile* makefile,
                            const std::string& targetDirectory,
                            const std::string& config);
-  void ReadOldMocDefinitionsFile(cmMakefile* makefile,
-                                 const std::string& targetDirectory);
-  bool WriteOldMocDefinitionsFile(const std::string& targetDirectory);
 
-  static std::string MakeCompileSettingsString(cmMakefile* makefile);
+  std::string MocCurrentSettingsString();
+  void ReadOldMocSettingsFile(cmMakefile* makefile,
+                              const std::string& targetDirectory);
+  bool WriteOldMocSettingsFile(const std::string& targetDirectory);
 
   // - Init and run
   void Init();
@@ -133,6 +133,7 @@ private:
   std::list<std::string> MocIncludes;
   std::list<std::string> MocDefinitions;
   std::vector<std::string> MocOptions;
+  std::string MocSettingsString;
   // - Uic
   std::vector<std::string> SkipUic;
   std::vector<std::string> UicTargetOptions;
@@ -141,9 +142,6 @@ private:
   std::vector<std::string> RccSources;
   std::map<std::string, std::string> RccOptions;
   std::map<std::string, std::vector<std::string> > RccInputs;
-  // - Settings
-  std::string CurrentCompileSettingsStr;
-  std::string OldCompileSettingsStr;
   // - Utility
   cmFilePathChecksum fpathCheckSum;
   cmsys::RegularExpression RegExpQObject;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=597124ba8e409edc28cbf8f2a55150d2913a50e3
commit 597124ba8e409edc28cbf8f2a55150d2913a50e3
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 20:27:15 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:44 2017 +0100

    Autogen: Generators: Add function to read makefile definitions config aware

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 4f5af3a..8d525dc 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -29,6 +29,22 @@
 
 // -- Static functions
 
+static std::string GetConfigDefinition(cmMakefile* makefile,
+                                       const std::string& key,
+                                       const std::string& config)
+{
+  std::string keyConf = key;
+  if (!config.empty()) {
+    keyConf += "_";
+    keyConf += config;
+  }
+  const char* valueConf = makefile->GetDefinition(keyConf);
+  if (valueConf != CM_NULLPTR) {
+    return valueConf;
+  }
+  return makefile->GetSafeDefinition(key);
+}
+
 static std::string FindMatchingHeader(
   const std::string& absPath, const std::string& mocSubDir,
   const std::string& basename,
@@ -269,55 +285,30 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
   // - Moc
   cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_SKIP_MOC"),
                                     this->SkipMoc);
-  {
-    std::string compileDefsPropOrig = "AM_MOC_COMPILE_DEFINITIONS";
-    std::string compileDefsProp = compileDefsPropOrig;
-    if (!config.empty()) {
-      compileDefsProp += "_";
-      compileDefsProp += config;
-    }
-    const char* compileDefs = makefile->GetDefinition(compileDefsProp);
-    this->MocCompileDefinitionsStr = compileDefs
-      ? compileDefs
-      : makefile->GetSafeDefinition(compileDefsPropOrig);
-  }
-  {
-    std::string includesPropOrig = "AM_MOC_INCLUDES";
-    std::string includesProp = includesPropOrig;
-    if (!config.empty()) {
-      includesProp += "_";
-      includesProp += config;
-    }
-    const char* includes = makefile->GetDefinition(includesProp);
-    this->MocIncludesStr =
-      includes ? includes : makefile->GetSafeDefinition(includesPropOrig);
-  }
+  this->MocCompileDefinitionsStr =
+    GetConfigDefinition(makefile, "AM_MOC_COMPILE_DEFINITIONS", config);
+  this->MocIncludesStr =
+    GetConfigDefinition(makefile, "AM_MOC_INCLUDES", config);
   this->MocOptionsStr = makefile->GetSafeDefinition("AM_MOC_OPTIONS");
 
   // - Uic
   cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_SKIP_UIC"),
                                     this->SkipUic);
+  cmSystemTools::ExpandListArgument(
+    GetConfigDefinition(makefile, "AM_UIC_TARGET_OPTIONS", config),
+    this->UicTargetOptions);
   {
-    const char* uicOptionsFiles =
-      makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES");
-    std::string uicOptionsPropOrig = "AM_UIC_TARGET_OPTIONS";
-    std::string uicOptionsProp = uicOptionsPropOrig;
-    if (!config.empty()) {
-      uicOptionsProp += "_";
-      uicOptionsProp += config;
-    }
-    const char* uicTargetOptions = makefile->GetSafeDefinition(uicOptionsProp);
-    cmSystemTools::ExpandListArgument(
-      uicTargetOptions ? uicTargetOptions
-                       : makefile->GetSafeDefinition(uicOptionsPropOrig),
-      this->UicTargetOptions);
-    const char* uicOptionsOptions =
-      makefile->GetSafeDefinition("AM_UIC_OPTIONS_OPTIONS");
     std::vector<std::string> uicFilesVec;
-    cmSystemTools::ExpandListArgument(uicOptionsFiles, uicFilesVec);
     std::vector<std::string> uicOptionsVec;
-    cmSystemTools::ExpandListArgument(uicOptionsOptions, uicOptionsVec);
+    cmSystemTools::ExpandListArgument(
+      makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES"), uicFilesVec);
+    cmSystemTools::ExpandListArgument(
+      makefile->GetSafeDefinition("AM_UIC_OPTIONS_OPTIONS"), uicOptionsVec);
     if (uicFilesVec.size() != uicOptionsVec.size()) {
+      std::ostringstream err;
+      err << "AutoGen: Error: Uic files/options lists size missmatch in: "
+          << filename << std::endl;
+      this->LogError(err.str());
       return false;
     }
     for (std::vector<std::string>::iterator fileIt = uicFilesVec.begin(),
@@ -329,20 +320,20 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
   }
 
   // - Rcc
+  cmSystemTools::ExpandListArgument(
+    makefile->GetSafeDefinition("AM_RCC_SOURCES"), this->RccSources);
   {
-    std::string rccSources = makefile->GetSafeDefinition("AM_RCC_SOURCES");
-    cmSystemTools::ExpandListArgument(rccSources, this->RccSources);
-  }
-  {
-    const char* rccOptionsFiles =
-      makefile->GetSafeDefinition("AM_RCC_OPTIONS_FILES");
-    const char* rccOptionsOptions =
-      makefile->GetSafeDefinition("AM_RCC_OPTIONS_OPTIONS");
     std::vector<std::string> rccFilesVec;
-    cmSystemTools::ExpandListArgument(rccOptionsFiles, rccFilesVec);
     std::vector<std::string> rccOptionsVec;
-    cmSystemTools::ExpandListArgument(rccOptionsOptions, rccOptionsVec);
+    cmSystemTools::ExpandListArgument(
+      makefile->GetSafeDefinition("AM_RCC_OPTIONS_FILES"), rccFilesVec);
+    cmSystemTools::ExpandListArgument(
+      makefile->GetSafeDefinition("AM_RCC_OPTIONS_OPTIONS"), rccOptionsVec);
     if (rccFilesVec.size() != rccOptionsVec.size()) {
+      std::ostringstream err;
+      err << "AutoGen: Error: RCC files/options lists size missmatch in: "
+          << filename << std::endl;
+      this->LogError(err.str());
       return false;
     }
     for (std::vector<std::string>::iterator fileIt = rccFilesVec.begin(),
@@ -351,10 +342,11 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
       cmSystemTools::ReplaceString(*optionIt, "@list_sep@", ";");
       this->RccOptions[*fileIt] = *optionIt;
     }
-
-    const char* rccInputs = makefile->GetSafeDefinition("AM_RCC_INPUTS");
+  }
+  {
     std::vector<std::string> rccInputLists;
-    cmSystemTools::ExpandListArgument(rccInputs, rccInputLists);
+    cmSystemTools::ExpandListArgument(
+      makefile->GetSafeDefinition("AM_RCC_INPUTS"), rccInputLists);
 
     // qrc files in the end of the list may have been empty
     if (rccInputLists.size() < this->RccSources.size()) {
@@ -362,19 +354,17 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
     }
     if (this->RccSources.size() != rccInputLists.size()) {
       std::ostringstream err;
-      err << "AutoGen: RCC sources lists size missmatch in: " << filename;
-      err << std::endl;
+      err << "AutoGen: Error: RCC sources/inputs lists size missmatch in: "
+          << filename << std::endl;
       this->LogError(err.str());
       return false;
     }
-
     for (std::vector<std::string>::iterator fileIt = this->RccSources.begin(),
                                             inputIt = rccInputLists.begin();
          fileIt != this->RccSources.end(); ++fileIt, ++inputIt) {
       cmSystemTools::ReplaceString(*inputIt, "@list_sep@", ";");
       std::vector<std::string> rccInputFiles;
       cmSystemTools::ExpandListArgument(*inputIt, rccInputFiles);
-
       this->RccInputs[*fileIt] = rccInputFiles;
     }
   }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b400b242101fd8b7a46073412830278aa3cc9ec
commit 2b400b242101fd8b7a46073412830278aa3cc9ec
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 15:12:41 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:44 2017 +0100

    Autogen: Generators: Move moc/uic/rcc executable test to generate method

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index c088f43..4f5af3a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -582,20 +582,14 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
                      notIncludedMocs, includedUis);
 
   // Generate files
-  if (!this->MocExecutable.empty()) {
-    if (!this->MocGenerateAll(includedMocs, notIncludedMocs)) {
-      return false;
-    }
+  if (!this->MocGenerateAll(includedMocs, notIncludedMocs)) {
+    return false;
   }
-  if (!this->UicExecutable.empty()) {
-    if (!this->UicGenerateAll(includedUis)) {
-      return false;
-    }
+  if (!this->UicGenerateAll(includedUis)) {
+    return false;
   }
-  if (!this->RccExecutable.empty()) {
-    if (!this->QrcGenerateAll()) {
-      return false;
-    }
+  if (!this->QrcGenerateAll()) {
+    return false;
   }
 
   return true;
@@ -994,6 +988,10 @@ bool cmQtAutoGenerators::MocGenerateAll(
   const std::map<std::string, std::string>& includedMocs,
   const std::map<std::string, std::string>& notIncludedMocs)
 {
+  if (this->MocExecutable.empty()) {
+    return true;
+  }
+
   // look for name collisions
   {
     std::multimap<std::string, std::string> collisions;
@@ -1179,6 +1177,10 @@ bool cmQtAutoGenerators::MocGenerateFile(const 
std::string& sourceFile,
 bool cmQtAutoGenerators::UicGenerateAll(
   const std::map<std::string, std::vector<std::string> >& includedUis)
 {
+  if (this->UicExecutable.empty()) {
+    return true;
+  }
+
   // single map with input / output names
   std::map<std::string, std::map<std::string, std::string> > uiGenMap;
   std::map<std::string, std::string> testMap;
@@ -1304,6 +1306,10 @@ bool cmQtAutoGenerators::UicGenerateFile(const 
std::string& realName,
 
 bool cmQtAutoGenerators::QrcGenerateAll()
 {
+  if (this->RccExecutable.empty()) {
+    return true;
+  }
+
   // generate single map with input / output names
   std::map<std::string, std::string> qrcGenMap;
   for (std::vector<std::string>::const_iterator si = this->RccSources.begin();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edf0b8a52bd4db8557adaf11d7096f7982c373aa
commit edf0b8a52bd4db8557adaf11d7096f7982c373aa
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 15:08:24 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:44 2017 +0100

    Autogen: Generators: Rename GenerateFoo methods to FooGenerate

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 645ecc0..c088f43 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -583,17 +583,17 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
 
   // Generate files
   if (!this->MocExecutable.empty()) {
-    if (!this->GenerateMocFiles(includedMocs, notIncludedMocs)) {
+    if (!this->MocGenerateAll(includedMocs, notIncludedMocs)) {
       return false;
     }
   }
   if (!this->UicExecutable.empty()) {
-    if (!this->GenerateUiFiles(includedUis)) {
+    if (!this->UicGenerateAll(includedUis)) {
       return false;
     }
   }
   if (!this->RccExecutable.empty()) {
-    if (!this->GenerateQrcFiles()) {
+    if (!this->QrcGenerateAll()) {
       return false;
     }
   }
@@ -990,7 +990,7 @@ void cmQtAutoGenerators::ParseHeaders(
   }
 }
 
-bool cmQtAutoGenerators::GenerateMocFiles(
+bool cmQtAutoGenerators::MocGenerateAll(
   const std::map<std::string, std::string>& includedMocs,
   const std::map<std::string, std::string>& notIncludedMocs)
 {
@@ -1020,7 +1020,7 @@ bool cmQtAutoGenerators::GenerateMocFiles(
     for (std::map<std::string, std::string>::const_iterator it =
            includedMocs.begin();
          it != includedMocs.end(); ++it) {
-      if (!this->GenerateMoc(it->first, it->second, subDirPrefix)) {
+      if (!this->MocGenerateFile(it->first, it->second, subDirPrefix)) {
         if (this->RunMocFailed) {
           return false;
         }
@@ -1035,7 +1035,7 @@ bool cmQtAutoGenerators::GenerateMocFiles(
     for (std::map<std::string, std::string>::const_iterator it =
            notIncludedMocs.begin();
          it != notIncludedMocs.end(); ++it) {
-      if (this->GenerateMoc(it->first, it->second, subDirPrefix)) {
+      if (this->MocGenerateFile(it->first, it->second, subDirPrefix)) {
         automocCppChanged = true;
       } else {
         if (this->RunMocFailed) {
@@ -1114,9 +1114,9 @@ bool cmQtAutoGenerators::GenerateMocFiles(
 /**
  * @return True if a moc file was created. False may indicate an error.
  */
-bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
-                                     const std::string& mocFileName,
-                                     const std::string& subDirPrefix)
+bool cmQtAutoGenerators::MocGenerateFile(const std::string& sourceFile,
+                                         const std::string& mocFileName,
+                                         const std::string& subDirPrefix)
 {
   const std::string mocFileRel =
     this->AutogenBuildSubDir + subDirPrefix + mocFileName;
@@ -1176,7 +1176,7 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& 
sourceFile,
   return false;
 }
 
-bool cmQtAutoGenerators::GenerateUiFiles(
+bool cmQtAutoGenerators::UicGenerateAll(
   const std::map<std::string, std::vector<std::string> >& includedUis)
 {
   // single map with input / output names
@@ -1224,7 +1224,7 @@ bool cmQtAutoGenerators::GenerateUiFiles(
     for (std::map<std::string, std::string>::const_iterator sit =
            it->second.begin();
          sit != it->second.end(); ++sit) {
-      if (!this->GenerateUi(it->first, sit->first, sit->second)) {
+      if (!this->UicGenerateFile(it->first, sit->first, sit->second)) {
         if (this->RunUicFailed) {
           return false;
         }
@@ -1238,9 +1238,9 @@ bool cmQtAutoGenerators::GenerateUiFiles(
 /**
  * @return True if a uic file was created. False may indicate an error.
  */
-bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
-                                    const std::string& uiInputFile,
-                                    const std::string& uiOutputFile)
+bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName,
+                                         const std::string& uiInputFile,
+                                         const std::string& uiOutputFile)
 {
   const std::string uicFileRel =
     this->AutogenBuildSubDir + "include/" + uiOutputFile;
@@ -1302,7 +1302,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& 
realName,
   return false;
 }
 
-bool cmQtAutoGenerators::GenerateQrcFiles()
+bool cmQtAutoGenerators::QrcGenerateAll()
 {
   // generate single map with input / output names
   std::map<std::string, std::string> qrcGenMap;
@@ -1335,7 +1335,7 @@ bool cmQtAutoGenerators::GenerateQrcFiles()
          qrcGenMap.begin();
        si != qrcGenMap.end(); ++si) {
     bool unique = FileNameIsUnique(si->first, qrcGenMap);
-    if (!this->GenerateQrc(si->first, si->second, unique)) {
+    if (!this->QrcGenerateFile(si->first, si->second, unique)) {
       if (this->RunRccFailed) {
         return false;
       }
@@ -1347,9 +1347,9 @@ bool cmQtAutoGenerators::GenerateQrcFiles()
 /**
  * @return True if a rcc file was created. False may indicate an error.
  */
-bool cmQtAutoGenerators::GenerateQrc(const std::string& qrcInputFile,
-                                     const std::string& qrcOutputFile,
-                                     bool unique_n)
+bool cmQtAutoGenerators::QrcGenerateFile(const std::string& qrcInputFile,
+                                         const std::string& qrcOutputFile,
+                                         bool unique_n)
 {
   std::string symbolName =
     cmsys::SystemTools::GetFilenameWithoutLastExtension(qrcInputFile);
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 3223c6d..c2be22c 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -72,23 +72,24 @@ private:
                           bool relaxed);
 
   // - Moc file generation
-  bool GenerateMocFiles(
+  bool MocGenerateAll(
     const std::map<std::string, std::string>& includedMocs,
     const std::map<std::string, std::string>& notIncludedMocs);
-  bool GenerateMoc(const std::string& sourceFile,
-                   const std::string& mocFileName,
-                   const std::string& subDirPrefix);
+  bool MocGenerateFile(const std::string& sourceFile,
+                       const std::string& mocFileName,
+                       const std::string& subDirPrefix);
 
   // - Uic file generation
-  bool GenerateUiFiles(
+  bool UicGenerateAll(
     const std::map<std::string, std::vector<std::string> >& includedUis);
-  bool GenerateUi(const std::string& realName, const std::string& uiInputFile,
-                  const std::string& uiOutputFile);
+  bool UicGenerateFile(const std::string& realName,
+                       const std::string& uiInputFile,
+                       const std::string& uiOutputFile);
 
   // - Qrc file generation
-  bool GenerateQrcFiles();
-  bool GenerateQrc(const std::string& qrcInputFile,
-                   const std::string& qrcOutputFile, bool unique_n);
+  bool QrcGenerateAll();
+  bool QrcGenerateFile(const std::string& qrcInputFile,
+                       const std::string& qrcOutputFile, bool unique_n);
 
   // - Logging
   void LogErrorNameCollision(

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06430919f4b903ba256ce158caf223f515faa8a4
commit 06430919f4b903ba256ce158caf223f515faa8a4
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 14:56:44 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:43 2017 +0100

    Autogen: Generators: Use FileAbsentOrOlder for UIC tests

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index d4997d5..645ecc0 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1246,10 +1246,12 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& 
realName,
     this->AutogenBuildSubDir + "include/" + uiOutputFile;
   const std::string uicFileAbs = this->CurrentBinaryDir + uicFileRel;
 
-  int sourceNewerThanUi = 0;
-  bool success = cmsys::SystemTools::FileTimeCompare(uiInputFile, uicFileAbs,
-                                                     &sourceNewerThanUi);
-  if (this->GenerateAll || !success || sourceNewerThanUi >= 0) {
+  bool generateUic = this->GenerateAll;
+  // Test if the source file is newer that the build file
+  if (!generateUic) {
+    generateUic = FileAbsentOrOlder(uicFileAbs, uiInputFile);
+  }
+  if (generateUic) {
     // Log
     this->LogBold("Generating UIC header " + uicFileRel);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca179f2afc6d8ab5e0df3e35255155c21a61b5f6
commit ca179f2afc6d8ab5e0df3e35255155c21a61b5f6
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 14:53:20 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:43 2017 +0100

    Autogen: Generators: Use FileAbsentOrOlder for MOC tests

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index c766d54..d4997d5 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1121,10 +1121,13 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& 
sourceFile,
   const std::string mocFileRel =
     this->AutogenBuildSubDir + subDirPrefix + mocFileName;
   const std::string mocFileAbs = this->CurrentBinaryDir + mocFileRel;
-  int sourceNewerThanMoc = 0;
-  bool success = cmsys::SystemTools::FileTimeCompare(sourceFile, mocFileAbs,
-                                                     &sourceNewerThanMoc);
-  if (this->GenerateAll || !success || sourceNewerThanMoc >= 0) {
+
+  bool generateMoc = this->GenerateAll;
+  // Test if the source file is newer that the build file
+  if (!generateMoc) {
+    generateMoc = FileAbsentOrOlder(mocFileAbs, sourceFile);
+  }
+  if (generateMoc) {
     // Log
     this->LogBold("Generating MOC source " + mocFileRel);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=119791ae528aace81f6c209e05798c80d8926b3d
commit 119791ae528aace81f6c209e05798c80d8926b3d
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 14:45:04 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:43 2017 +0100

    Autogen: Generators: Introduce FileAbsentOrOlder function

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index f3fa047..c766d54 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -91,6 +91,19 @@ static std::string ReadAll(const std::string& filename)
   return stream.str();
 }
 
+/**
+ * @brief Tests if buildFile doesn't exist or is older than sourceFile
+ * @return True if buildFile doesn't exist or is older than sourceFile
+ */
+static bool FileAbsentOrOlder(const std::string& buildFile,
+                              const std::string& sourceFile)
+{
+  int result = 0;
+  bool success =
+    cmsys::SystemTools::FileTimeCompare(buildFile, sourceFile, &result);
+  return (!success || (result <= 0));
+}
+
 static bool ListContains(const std::vector<std::string>& list,
                          const std::string& entry)
 {
@@ -1284,22 +1297,6 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& 
realName,
   return false;
 }
 
-bool cmQtAutoGenerators::InputFilesNewerThanQrc(const std::string& qrcFile,
-                                                const std::string& rccOutput)
-{
-  std::vector<std::string> const& files = this->RccInputs[qrcFile];
-  for (std::vector<std::string>::const_iterator it = files.begin();
-       it != files.end(); ++it) {
-    int inputNewerThanQrc = 0;
-    bool success =
-      cmsys::SystemTools::FileTimeCompare(*it, rccOutput, &inputNewerThanQrc);
-    if (!success || inputNewerThanQrc >= 0) {
-      return true;
-    }
-  }
-  return false;
-}
-
 bool cmQtAutoGenerators::GenerateQrcFiles()
 {
   // generate single map with input / output names
@@ -1361,14 +1358,23 @@ bool cmQtAutoGenerators::GenerateQrc(const std::string& 
qrcInputFile,
 
   const std::string qrcBuildFile = this->CurrentBinaryDir + qrcOutputFile;
 
-  int sourceNewerThanQrc = 0;
-  bool generateQrc = !cmsys::SystemTools::FileTimeCompare(
-    qrcInputFile, qrcBuildFile, &sourceNewerThanQrc);
-  generateQrc = generateQrc || (sourceNewerThanQrc >= 0);
-  generateQrc =
-    generateQrc || this->InputFilesNewerThanQrc(qrcInputFile, qrcBuildFile);
-
-  if (this->GenerateAll || generateQrc) {
+  bool generateQrc = this->GenerateAll;
+  // Test if the resources list file is newer than build file
+  if (!generateQrc) {
+    generateQrc = FileAbsentOrOlder(qrcBuildFile, qrcInputFile);
+  }
+  // Test if any resource file is newer than the build file
+  if (!generateQrc) {
+    const std::vector<std::string>& files = this->RccInputs[qrcInputFile];
+    for (std::vector<std::string>::const_iterator it = files.begin();
+         it != files.end(); ++it) {
+      if (FileAbsentOrOlder(qrcBuildFile, *it)) {
+        generateQrc = true;
+        break;
+      }
+    }
+  }
+  if (generateQrc) {
     {
       std::string msg = "Generating RCC source ";
       msg += qrcOutputFile;
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index b9d670a..3223c6d 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -86,8 +86,6 @@ private:
                   const std::string& uiOutputFile);
 
   // - Qrc file generation
-  bool InputFilesNewerThanQrc(const std::string& qrcFile,
-                              const std::string& rccOutput);
   bool GenerateQrcFiles();
   bool GenerateQrc(const std::string& qrcInputFile,
                    const std::string& qrcOutputFile, bool unique_n);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95e4cfc5947fb5a324f6dad50cff8d71f928aba8
commit 95e4cfc5947fb5a324f6dad50cff8d71f928aba8
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 14:05:41 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:43 2017 +0100

    Autogen: Generators: Simplify (and fix) JoinExts function

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 73afdc1..f3fa047 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -99,20 +99,18 @@ static bool ListContains(const std::vector<std::string>& 
list,
 
 static std::string JoinExts(const std::vector<std::string>& lst)
 {
-  if (lst.empty()) {
-    return "";
-  }
-
   std::string result;
-  std::string separator = ",";
-  for (std::vector<std::string>::const_iterator it = lst.begin();
-       it != lst.end(); ++it) {
-    if (it != lst.begin()) {
-      result += separator;
+  if (!lst.empty()) {
+    const std::string separator = ",";
+    for (std::vector<std::string>::const_iterator it = lst.begin();
+         it != lst.end(); ++it) {
+      if (it != lst.begin()) {
+        result += separator;
+      }
+      result += '.';
+      result += *it;
     }
-    result += '.' + (*it);
   }
-  result.erase(result.end() - 1);
   return result;
 }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c55755bdd54c2d474e2c8fe4c9d078e10404f26
commit 6c55755bdd54c2d474e2c8fe4c9d078e10404f26
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 13:56:13 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:43 2017 +0100

    Autogen: Generators: Make class static method a source static function

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index ea55064..73afdc1 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -97,6 +97,25 @@ static bool ListContains(const std::vector<std::string>& 
list,
   return (std::find(list.begin(), list.end(), entry) != list.end());
 }
 
+static std::string JoinExts(const std::vector<std::string>& lst)
+{
+  if (lst.empty()) {
+    return "";
+  }
+
+  std::string result;
+  std::string separator = ",";
+  for (std::vector<std::string>::const_iterator it = lst.begin();
+       it != lst.end(); ++it) {
+    if (it != lst.begin()) {
+      result += separator;
+    }
+    result += '.' + (*it);
+  }
+  result.erase(result.end() - 1);
+  return result;
+}
+
 static void UicMergeOptions(std::vector<std::string>& opts,
                             const std::vector<std::string>& fileOpts,
                             bool isQt5)
@@ -749,7 +768,7 @@ bool cmQtAutoGenerators::ParseContentForMoc(
           err << "AutoMoc: Error: " << absFilename << "\n"
               << "The file includes the moc file \"" << currentMoc
               << "\", but could not find header \"" << basename << '{'
-              << this->JoinExts(headerExtensions) << "}\" ";
+              << JoinExts(headerExtensions) << "}\" ";
           if (mocSubDir.empty()) {
             err << "in " << scannedFileAbsPath << "\n";
           } else {
@@ -1509,22 +1528,3 @@ bool cmQtAutoGenerators::MakeParentDirectory(const 
std::string& filename)
   }
   return success;
 }
-
-std::string cmQtAutoGenerators::JoinExts(const std::vector<std::string>& lst)
-{
-  if (lst.empty()) {
-    return "";
-  }
-
-  std::string result;
-  std::string separator = ",";
-  for (std::vector<std::string>::const_iterator it = lst.begin();
-       it != lst.end(); ++it) {
-    if (it != lst.begin()) {
-      result += separator;
-    }
-    result += '.' + (*it);
-  }
-  result.erase(result.end() - 1);
-  return result;
-}
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index ed17dcd..b9d670a 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -106,7 +106,6 @@ private:
   bool NameCollisionTest(const std::map<std::string, std::string>& genFiles,
                          std::multimap<std::string, std::string>& collisions);
   bool MakeParentDirectory(const std::string& filename);
-  static std::string JoinExts(const std::vector<std::string>& lst);
 
   // - Target names
   std::string OriginTargetName;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1491ab1c6626ed6a3b67e74b94fd18230e1bb4d4
commit 1491ab1c6626ed6a3b67e74b94fd18230e1bb4d4
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 13:51:31 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:43 2017 +0100

    Autogen: Generators: Make class static method a source static function

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 57b9450..ea55064 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -97,6 +97,40 @@ static bool ListContains(const std::vector<std::string>& 
list,
   return (std::find(list.begin(), list.end(), entry) != list.end());
 }
 
+static void UicMergeOptions(std::vector<std::string>& opts,
+                            const std::vector<std::string>& fileOpts,
+                            bool isQt5)
+{
+  static const char* valueOptions[] = { "tr",      "translate",
+                                        "postfix", "generator",
+                                        "include", // Since Qt 5.3
+                                        "g" };
+  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());
+}
+
 // -- Class methods
 
 cmQtAutoGenerators::cmQtAutoGenerators()
@@ -1109,40 +1143,6 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& 
sourceFile,
   return false;
 }
 
-void cmQtAutoGenerators::MergeUicOptions(
-  std::vector<std::string>& opts, const std::vector<std::string>& fileOpts,
-  bool isQt5)
-{
-  static const char* valueOptions[] = { "tr",      "translate",
-                                        "postfix", "generator",
-                                        "include", // Since Qt 5.3
-                                        "g" };
-  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());
-}
-
 bool cmQtAutoGenerators::GenerateUiFiles(
   const std::map<std::string, std::vector<std::string> >& includedUis)
 {
@@ -1235,8 +1235,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& 
realName,
     if (optionIt != this->UicOptions.end()) {
       std::vector<std::string> fileOpts;
       cmSystemTools::ExpandListArgument(optionIt->second, fileOpts);
-      cmQtAutoGenerators::MergeUicOptions(opts, fileOpts,
-                                          this->QtMajorVersion == "5");
+      UicMergeOptions(opts, fileOpts, this->QtMajorVersion == "5");
     }
     command.insert(command.end(), opts.begin(), opts.end());
 
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 18648e6..ed17dcd 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -80,9 +80,6 @@ private:
                    const std::string& subDirPrefix);
 
   // - Uic file generation
-  static void MergeUicOptions(std::vector<std::string>& opts,
-                              const std::vector<std::string>& fileOpts,
-                              bool isQt5);
   bool GenerateUiFiles(
     const std::map<std::string, std::vector<std::string> >& includedUis);
   bool GenerateUi(const std::string& realName, const std::string& uiInputFile,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29112c9a695a8dce6486203d0415f17ac41d3a0b
commit 29112c9a695a8dce6486203d0415f17ac41d3a0b
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 13:47:43 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:42 2017 +0100

    Autogen: Generators: Static function upper case rename

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 2c9310e..57b9450 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -55,7 +55,7 @@ static std::string FindMatchingHeader(
   return header;
 }
 
-static std::string extractSubDir(const std::string& absPath,
+static std::string ExtractSubDir(const std::string& absPath,
                                  const std::string& currentMoc)
 {
   std::string subDir;
@@ -699,7 +699,7 @@ bool cmQtAutoGenerators::ParseContentForMoc(
         // finding the correct header, so we need to remove the moc_ part
         basename = basename.substr(4);
         const std::string mocSubDir =
-          extractSubDir(scannedFileAbsPath, currentMoc);
+          ExtractSubDir(scannedFileAbsPath, currentMoc);
         const std::string headerToMoc = FindMatchingHeader(
           scannedFileAbsPath, mocSubDir, basename, headerExtensions);
 
@@ -732,7 +732,7 @@ bool cmQtAutoGenerators::ParseContentForMoc(
           // Mode: Relaxed
           if (!requiresMoc || basename != scannedFileBasename) {
             const std::string mocSubDir =
-              extractSubDir(scannedFileAbsPath, currentMoc);
+              ExtractSubDir(scannedFileAbsPath, currentMoc);
             const std::string headerToMoc = FindMatchingHeader(
               scannedFileAbsPath, mocSubDir, basename, headerExtensions);
             if (!headerToMoc.empty()) {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6d333be14d23b9aaf4452189199134bd674ad395
commit 6d333be14d23b9aaf4452189199134bd674ad395
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 13:47:26 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:42 2017 +0100

    Autogen: Generators: Static function upper case rename

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 017fb04..2c9310e 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -29,7 +29,7 @@
 
 // -- Static functions
 
-static std::string findMatchingHeader(
+static std::string FindMatchingHeader(
   const std::string& absPath, const std::string& mocSubDir,
   const std::string& basename,
   const std::vector<std::string>& headerExtensions)
@@ -700,7 +700,7 @@ bool cmQtAutoGenerators::ParseContentForMoc(
         basename = basename.substr(4);
         const std::string mocSubDir =
           extractSubDir(scannedFileAbsPath, currentMoc);
-        const std::string headerToMoc = findMatchingHeader(
+        const std::string headerToMoc = FindMatchingHeader(
           scannedFileAbsPath, mocSubDir, basename, headerExtensions);
 
         if (!headerToMoc.empty()) {
@@ -733,7 +733,7 @@ bool cmQtAutoGenerators::ParseContentForMoc(
           if (!requiresMoc || basename != scannedFileBasename) {
             const std::string mocSubDir =
               extractSubDir(scannedFileAbsPath, currentMoc);
-            const std::string headerToMoc = findMatchingHeader(
+            const std::string headerToMoc = FindMatchingHeader(
               scannedFileAbsPath, mocSubDir, basename, headerExtensions);
             if (!headerToMoc.empty()) {
               // This is for KDE4 compatibility:

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52688bf7453cdb767e231f5fdc7d80ce79ae239d
commit 52688bf7453cdb767e231f5fdc7d80ce79ae239d
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Wed Jan 11 13:41:14 2017 +0100
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Fri Jan 13 00:00:42 2017 +0100

    Autogen: Generators: Sort methods by task

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index f5c33fe..017fb04 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -27,6 +27,8 @@
 #include <unistd.h>
 #endif
 
+// -- Static functions
+
 static std::string findMatchingHeader(
   const std::string& absPath, const std::string& mocSubDir,
   const std::string& basename,
@@ -95,6 +97,8 @@ static bool ListContains(const std::vector<std::string>& list,
   return (std::find(list.begin(), list.end(), entry) != list.end());
 }
 
+// -- Class methods
+
 cmQtAutoGenerators::cmQtAutoGenerators()
   : Verbose(cmsys::SystemTools::HasEnv("VERBOSE"))
   , ColorOutput(true)
@@ -124,40 +128,6 @@ cmQtAutoGenerators::cmQtAutoGenerators()
                                  "[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
 }
 
-void cmQtAutoGenerators::MergeUicOptions(
-  std::vector<std::string>& opts, const std::vector<std::string>& fileOpts,
-  bool isQt5)
-{
-  static const char* valueOptions[] = { "tr",      "translate",
-                                        "postfix", "generator",
-                                        "include", // Since Qt 5.3
-                                        "g" };
-  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());
-}
-
 bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
                              const std::string& config)
 {
@@ -568,6 +538,60 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
 }
 
 /**
+ * @brief Tests if the C++ content requires moc processing
+ * @return True if moc is required
+ */
+bool cmQtAutoGenerators::requiresMocing(const std::string& text,
+                                        std::string& macroName)
+{
+  // Run a simple check before an expensive regular expression check
+  if (strstr(text.c_str(), "Q_OBJECT") != CM_NULLPTR) {
+    if (this->RegExpQObject.find(text)) {
+      macroName = "Q_OBJECT";
+      return true;
+    }
+  }
+  if (strstr(text.c_str(), "Q_GADGET") != CM_NULLPTR) {
+    if (this->RegExpQGadget.find(text)) {
+      macroName = "Q_GADGET";
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * @brief Tests if the file should be ignored for moc scanning
+ * @return True if the file should be ignored
+ */
+bool cmQtAutoGenerators::MocSkipTest(const std::string& absFilename)
+{
+  // Test if moc scanning is enabled
+  if (!this->MocExecutable.empty()) {
+    // Test if the file name is on the skip list
+    if (!ListContains(this->SkipMoc, absFilename)) {
+      return false;
+    }
+  }
+  return true;
+}
+
+/**
+ * @brief Tests if the file name is in the skip list
+ */
+bool cmQtAutoGenerators::UicSkipTest(const std::string& absFilename)
+{
+  // Test if uic scanning is enabled
+  if (!this->UicExecutable.empty()) {
+    // Test if the file name is on the skip list
+    if (!ListContains(this->SkipUic, absFilename)) {
+      return false;
+    }
+  }
+  return true;
+}
+
+/**
  * @return True on success
  */
 bool cmQtAutoGenerators::ParseSourceFile(
@@ -597,25 +621,6 @@ bool cmQtAutoGenerators::ParseSourceFile(
   return success;
 }
 
-bool cmQtAutoGenerators::requiresMocing(const std::string& text,
-                                        std::string& macroName)
-{
-  // Run a simple check before an expensive regular expression check
-  if (strstr(text.c_str(), "Q_OBJECT") != CM_NULLPTR) {
-    if (this->RegExpQObject.find(text)) {
-      macroName = "Q_OBJECT";
-      return true;
-    }
-  }
-  if (strstr(text.c_str(), "Q_GADGET") != CM_NULLPTR) {
-    if (this->RegExpQGadget.find(text)) {
-      macroName = "Q_GADGET";
-      return true;
-    }
-  }
-  return false;
-}
-
 void cmQtAutoGenerators::ParseContentForUic(
   const std::string& absFilename, const std::string& contentsString,
   std::map<std::string, std::vector<std::string> >& includedUis)
@@ -1104,6 +1109,40 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& 
sourceFile,
   return false;
 }
 
+void cmQtAutoGenerators::MergeUicOptions(
+  std::vector<std::string>& opts, const std::vector<std::string>& fileOpts,
+  bool isQt5)
+{
+  static const char* valueOptions[] = { "tr",      "translate",
+                                        "postfix", "generator",
+                                        "include", // Since Qt 5.3
+                                        "g" };
+  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());
+}
+
 bool cmQtAutoGenerators::GenerateUiFiles(
   const std::map<std::string, std::vector<std::string> >& includedUis)
 {
@@ -1365,67 +1404,6 @@ bool cmQtAutoGenerators::GenerateQrc(const std::string& 
qrcInputFile,
   return false;
 }
 
-/**
- * @brief Tests if the file should be ignored for moc scanning
- * @return True if the file should be ignored
- */
-bool cmQtAutoGenerators::MocSkipTest(const std::string& absFilename)
-{
-  // Test if moc scanning is enabled
-  if (!this->MocExecutable.empty()) {
-    // Test if the file name is on the skip list
-    if (!ListContains(this->SkipMoc, absFilename)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-/**
- * @brief Tests if the file name is in the skip list
- */
-bool cmQtAutoGenerators::UicSkipTest(const std::string& absFilename)
-{
-  // Test if uic scanning is enabled
-  if (!this->UicExecutable.empty()) {
-    // Test if the file name is on the skip list
-    if (!ListContains(this->SkipUic, absFilename)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-/**
- * @brief Collects name collisions as output/input pairs
- * @return True if there were collisions
- */
-bool cmQtAutoGenerators::NameCollisionTest(
-  const std::map<std::string, std::string>& genFiles,
-  std::multimap<std::string, std::string>& collisions)
-{
-  typedef std::map<std::string, std::string>::const_iterator Iter;
-  typedef std::map<std::string, std::string>::value_type VType;
-  for (Iter ait = genFiles.begin(); ait != genFiles.end(); ++ait) {
-    bool first_match(true);
-    for (Iter bit = (++Iter(ait)); bit != genFiles.end(); ++bit) {
-      if (ait->second == bit->second) {
-        if (first_match) {
-          if (collisions.find(ait->second) != collisions.end()) {
-            // We already know of this collision from before
-            break;
-          }
-          collisions.insert(VType(ait->second, ait->first));
-          first_match = false;
-        }
-        collisions.insert(VType(bit->second, bit->first));
-      }
-    }
-  }
-
-  return !collisions.empty();
-}
-
 void cmQtAutoGenerators::LogErrorNameCollision(
   const std::string& message,
   const std::multimap<std::string, std::string>& collisions)
@@ -1485,6 +1463,36 @@ void cmQtAutoGenerators::LogCommand(const 
std::vector<std::string>& command)
 }
 
 /**
+ * @brief Collects name collisions as output/input pairs
+ * @return True if there were collisions
+ */
+bool cmQtAutoGenerators::NameCollisionTest(
+  const std::map<std::string, std::string>& genFiles,
+  std::multimap<std::string, std::string>& collisions)
+{
+  typedef std::map<std::string, std::string>::const_iterator Iter;
+  typedef std::map<std::string, std::string>::value_type VType;
+  for (Iter ait = genFiles.begin(); ait != genFiles.end(); ++ait) {
+    bool first_match(true);
+    for (Iter bit = (++Iter(ait)); bit != genFiles.end(); ++bit) {
+      if (ait->second == bit->second) {
+        if (first_match) {
+          if (collisions.find(ait->second) != collisions.end()) {
+            // We already know of this collision from before
+            break;
+          }
+          collisions.insert(VType(ait->second, ait->first));
+          first_match = false;
+        }
+        collisions.insert(VType(bit->second, bit->first));
+      }
+    }
+  }
+
+  return !collisions.empty();
+}
+
+/**
  * @brief Generates the parent directory of the given file on demand
  * @return True on success
  */
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index d0c7066..18648e6 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -22,6 +22,7 @@ public:
   bool Run(const std::string& targetDirectory, const std::string& config);
 
 private:
+  // - Configuration
   bool ReadAutogenInfoFile(cmMakefile* makefile,
                            const std::string& targetDirectory,
                            const std::string& config);
@@ -29,25 +30,16 @@ private:
                                  const std::string& targetDirectory);
   bool WriteOldMocDefinitionsFile(const std::string& targetDirectory);
 
-  std::string MakeCompileSettingsString(cmMakefile* makefile);
+  static std::string MakeCompileSettingsString(cmMakefile* makefile);
 
+  // - Init and run
+  void Init();
   bool RunAutogen(cmMakefile* makefile);
 
-  bool GenerateMocFiles(
-    const std::map<std::string, std::string>& includedMocs,
-    const std::map<std::string, std::string>& notIncludedMocs);
-  bool GenerateMoc(const std::string& sourceFile,
-                   const std::string& mocFileName,
-                   const std::string& subDirPrefix);
-
-  bool GenerateUiFiles(
-    const std::map<std::string, std::vector<std::string> >& includedUis);
-  bool GenerateUi(const std::string& realName, const std::string& uiInputFile,
-                  const std::string& uiOutputFile);
-
-  bool GenerateQrcFiles();
-  bool GenerateQrc(const std::string& qrcInputFile,
-                   const std::string& qrcOutputFile, bool unique_n);
+  // - Content analysis
+  bool requiresMocing(const std::string& text, std::string& macroName);
+  bool MocSkipTest(const std::string& absFilename);
+  bool UicSkipTest(const std::string& absFilename);
 
   bool ParseSourceFile(
     const std::string& absFilename,
@@ -55,6 +47,7 @@ private:
     std::map<std::string, std::string>& includedMocs,
     std::map<std::string, std::vector<std::string> >& includedUis,
     bool relaxed);
+
   void SearchHeadersForSourceFile(
     const std::string& absFilename,
     const std::vector<std::string>& headerExtensions,
@@ -68,8 +61,6 @@ private:
     std::map<std::string, std::string>& notIncludedMocs,
     std::map<std::string, std::vector<std::string> >& includedUis);
 
-  bool requiresMocing(const std::string& text, std::string& macroName);
-
   void ParseContentForUic(
     const std::string& fileName, const std::string& contentsString,
     std::map<std::string, std::vector<std::string> >& includedUis);
@@ -80,18 +71,31 @@ private:
                           std::map<std::string, std::string>& includedMocs,
                           bool relaxed);
 
-  void ParseForUic(
-    const std::string& fileName,
-    std::map<std::string, std::vector<std::string> >& includedUis);
-
-  void Init();
+  // - Moc file generation
+  bool GenerateMocFiles(
+    const std::map<std::string, std::string>& includedMocs,
+    const std::map<std::string, std::string>& notIncludedMocs);
+  bool GenerateMoc(const std::string& sourceFile,
+                   const std::string& mocFileName,
+                   const std::string& subDirPrefix);
 
-  bool MocSkipTest(const std::string& absFilename);
-  bool UicSkipTest(const std::string& absFilename);
+  // - Uic file generation
+  static void MergeUicOptions(std::vector<std::string>& opts,
+                              const std::vector<std::string>& fileOpts,
+                              bool isQt5);
+  bool GenerateUiFiles(
+    const std::map<std::string, std::vector<std::string> >& includedUis);
+  bool GenerateUi(const std::string& realName, const std::string& uiInputFile,
+                  const std::string& uiOutputFile);
 
-  bool NameCollisionTest(const std::map<std::string, std::string>& genFiles,
-                         std::multimap<std::string, std::string>& collisions);
+  // - Qrc file generation
+  bool InputFilesNewerThanQrc(const std::string& qrcFile,
+                              const std::string& rccOutput);
+  bool GenerateQrcFiles();
+  bool GenerateQrc(const std::string& qrcInputFile,
+                   const std::string& qrcOutputFile, bool unique_n);
 
+  // - Logging
   void LogErrorNameCollision(
     const std::string& message,
     const std::multimap<std::string, std::string>& collisions);
@@ -101,16 +105,11 @@ private:
   void LogError(const std::string& message);
   void LogCommand(const std::vector<std::string>& command);
 
+  // - Utility
+  bool NameCollisionTest(const std::map<std::string, std::string>& genFiles,
+                         std::multimap<std::string, std::string>& collisions);
   bool MakeParentDirectory(const std::string& filename);
-
-  std::string JoinExts(const std::vector<std::string>& lst);
-
-  static void MergeUicOptions(std::vector<std::string>& opts,
-                              const std::vector<std::string>& fileOpts,
-                              bool isQt5);
-
-  bool InputFilesNewerThanQrc(const std::string& qrcFile,
-                              const std::string& rccOutput);
+  static std::string JoinExts(const std::vector<std::string>& lst);
 
   // - Target names
   std::string OriginTargetName;

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

Summary of changes:
 Source/cmQtAutoGeneratorInitializer.cxx |    8 +
 Source/cmQtAutoGenerators.cxx           |  699 ++++++++++++++++++-------------
 Source/cmQtAutoGenerators.h             |   84 ++--
 3 files changed, 451 insertions(+), 340 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to