[Cmake-commits] CMake branch, next, updated. v2.8.12-4438-ga497cf5

Stephen Kelly steveire at gmail.com
Thu Oct 24 06:31:25 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  a497cf51c8670acc1273f5c6cd2171285832719f (commit)
       via  9c87d9cc3e7a046f79ff62eda81203ef424e4a14 (commit)
       via  84218e1870ab075c9e2be1f2947358702c849fed (commit)
       via  94a0ca604ca6ba3699b6d309938e881b2a3984a0 (commit)
       via  18fb7588df5b380340423eb36a90a7aefc1fa6ca (commit)
       via  e485ba12193d36ffc4faee89bb80dbe611ad7e82 (commit)
       via  7ce65c3c9738414213ae307005277c774daea669 (commit)
       via  32771fc7ca959a90ef5e267831650323f3c0cf13 (commit)
       via  f371ab5803b3d675170f4b163701d707e56b47d9 (commit)
       via  85b3d6e73d1d5620229c7fc67a705fd50c8bcff0 (commit)
       via  ca124a15150b5f88a9dcd9edfc4f61cf473efc64 (commit)
       via  a342c9ffedb865919b7a13b5620caecbb5076865 (commit)
       via  98632effebc7ed59105a67c549989265a3b207f1 (commit)
       via  63378baa1ceacbfdd52753e6dc7228ccfc53f4e5 (commit)
       via  97f1aa39da3e56ea4839e918f05928440d9d9dfa (commit)
       via  4abb111584c4f0738cd2858cfa7d3adee5248a83 (commit)
       via  03878c9a22719eb8e86025c3cb489af8fd47a250 (commit)
       via  be23dcfeb1ef2d855bd24bb933ae7da4a6b4b9da (commit)
       via  52d5d4e9154644597630ed844a254dfb8de524dd (commit)
       via  5c058c8f12742dcb96b2e22b43208f345a865fbf (commit)
       via  a25c440f195e0ebc3f812c5e68f7f9a7546f249d (commit)
      from  16e8226d78bf4a270b8bf06b365e5da5cf582e44 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a497cf51c8670acc1273f5c6cd2171285832719f
commit a497cf51c8670acc1273f5c6cd2171285832719f
Merge: 16e8226 9c87d9c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Oct 24 06:31:13 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 24 06:31:13 2013 -0400

    Merge topic 'Qt-auto-generators' into next
    
    9c87d9c Add automatic rcc invocation for Qt.
    84218e1 Add automatic uic invocation for Qt.
    94a0ca6 Record which files are skipped by automoc.
    18fb758 Run the main executable created in the autogen tests.
    e485ba1 Rename the QtAutomoc tests to QtAutogen.
    7ce65c3 Add extra checks for the AUTOMOC target property.
    32771fc Update output messages for generic use.
    f371ab5 Rename RunAutomoc to RunAutogen.
    85b3d6e Extract an SetupAutoMocTarget method.
    ca124a1 Rename the AutomocInfo.cmake file to be more generic.
    a342c9f Move some makefile definitions up away from moc-specific code.
    98632ef Add the AUTOGEN_TARGETS_FOLDER and obsolete AUTOMOC_TARGETS_FOLDER.
    63378ba Rename some variables to reflect broader scope.
    97f1aa3 Rename method to reflect generic use.
    4abb111 Rename local variable to reflect generic use.
    03878c9 Move variable set to where it is used.
    ...


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c87d9cc3e7a046f79ff62eda81203ef424e4a14
commit 9c87d9cc3e7a046f79ff62eda81203ef424e4a14
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Sep 15 14:41:07 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 12:30:41 2013 +0200

    Add automatic rcc invocation for Qt.
    
    This replaces the need to invoke qt4_add_resources by allowing
    adding the source .qrc file directly to the target sources.

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index ddf24d4..34a549c 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -75,6 +75,8 @@ Properties on Targets
    /prop_tgt/AUTOMOC
    /prop_tgt/AUTOUIC
    /prop_tgt/AUTOUIC_OPTIONS
+   /prop_tgt/AUTORCC
+   /prop_tgt/AUTORCC_OPTIONS
    /prop_tgt/BUILD_WITH_INSTALL_RPATH
    /prop_tgt/BUNDLE_EXTENSION
    /prop_tgt/BUNDLE
@@ -237,6 +239,7 @@ Properties on Source Files
 .. toctree::
    /prop_sf/ABSTRACT
    /prop_sf/AUTOUIC_OPTIONS
+   /prop_sf/AUTORCC_OPTIONS
    /prop_sf/COMPILE_DEFINITIONS_CONFIG
    /prop_sf/COMPILE_DEFINITIONS
    /prop_sf/COMPILE_FLAGS
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 9a5f254..22a1c4d 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -155,6 +155,8 @@ Variables that Control the Build
    /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
    /variable/CMAKE_AUTOMOC_MOC_OPTIONS
    /variable/CMAKE_AUTOMOC
+   /variable/CMAKE_AUTORCC
+   /variable/CMAKE_AUTORCC_OPTIONS
    /variable/CMAKE_AUTOUIC
    /variable/CMAKE_AUTOUIC_OPTIONS
    /variable/CMAKE_BUILD_WITH_INSTALL_RPATH
diff --git a/Help/prop_sf/AUTORCC_OPTIONS.rst b/Help/prop_sf/AUTORCC_OPTIONS.rst
new file mode 100644
index 0000000..4b6bb10
--- /dev/null
+++ b/Help/prop_sf/AUTORCC_OPTIONS.rst
@@ -0,0 +1,14 @@
+AUTORCC_OPTIONS
+---------------
+
+Additional options for rcc when using autorcc (see the :prop_tgt:`AUTORCC` target
+property)
+
+This property holds additional command line options which will be used when
+rcc is executed during the build via autorcc, i.e. it is equivalent to the
+optional OPTIONS argument of the qt4_add_resources() macro.
+
+By default it is empty.
+
+The options set on the .qrc source file may override :prop_tgt:`AUTORCC_OPTIONS` set
+on the target.
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
new file mode 100644
index 0000000..ef2c9c8
--- /dev/null
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -0,0 +1,21 @@
+
+AUTORCC
+-------
+
+Should the target be processed with autorcc (for Qt projects).
+
+AUTORCC is a boolean specifying whether CMake will handle
+the Qt rcc code generator automatically, i.e. without having to use
+the QT4_ADD_RESOURCES() or QT5_ADD_RESOURCES() macro. Currently Qt4 and Qt5 are
+supported.
+
+When this property is set to TRUE, CMake will handle .qrc files added
+as target sources at build time and invoke rcc accordingly.
+This property is initialized by the value of the :variable:`CMAKE_AUTORCC`
+variable if it is set when a target is created.
+
+Additional command line options for rcc can be set via the
+:prop_sf:`AUTORCC_OPTIONS` source file property on the .qrc file.
+
+The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
+autouic targets together in an IDE, e.g. in MSVS.
diff --git a/Help/prop_tgt/AUTORCC_OPTIONS.rst b/Help/prop_tgt/AUTORCC_OPTIONS.rst
new file mode 100644
index 0000000..489e277
--- /dev/null
+++ b/Help/prop_tgt/AUTORCC_OPTIONS.rst
@@ -0,0 +1,17 @@
+AUTORCC_OPTIONS
+---------------
+
+Additional options for rcc when using autorcc (see the :prop_tgt:`AUTORCC` target property)
+
+This property holds additional command line options
+which will be used when rcc is executed during the build via autorcc,
+i.e. it is equivalent to the optional OPTIONS argument of the
+qt4_add_resources() macro.
+
+By default it is empty.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_AUTORCC` if it is set when a target is created.
+
+The options set on the target may be overridden by :prop_sf:`AUTORCC_OPTIONS` set
+on the .qrc source file.
diff --git a/Help/variable/CMAKE_AUTORCC.rst b/Help/variable/CMAKE_AUTORCC.rst
new file mode 100644
index 0000000..d213993
--- /dev/null
+++ b/Help/variable/CMAKE_AUTORCC.rst
@@ -0,0 +1,7 @@
+CMAKE_AUTORCC
+-------------
+
+Whether to handle rcc automatically for Qt targets.
+
+This variable is used to initialize the :prop_tgt:`AUTORCC` property on all the targets.
+See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTORCC_OPTIONS.rst b/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
new file mode 100644
index 0000000..5efbfa3
--- /dev/null
+++ b/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
@@ -0,0 +1,7 @@
+CMAKE_AUTORCC_OPTIONS
+---------------------
+
+Whether to handle rcc automatically for Qt targets.
+
+This variable is used to initialize the :prop_tgt:`AUTORCC_OPTIONS` property on
+all the targets.  See that target property for additional information.
diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in
index d2fb807..7554213 100644
--- a/Modules/AutogenInfo.cmake.in
+++ b/Modules/AutogenInfo.cmake.in
@@ -1,4 +1,5 @@
 set(AM_SOURCES @_moc_files@ )
+set(AM_RCC_SOURCES @_rcc_files@ )
 set(AM_SKIP_MOC @_skip_moc@ )
 set(AM_SKIP_UIC @_skip_uic@ )
 set(AM_HEADERS @_moc_headers@ )
@@ -10,6 +11,7 @@ set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/")
 set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
 set(AM_QT_MOC_EXECUTABLE "@_qt_moc_executable@")
 set(AM_QT_UIC_EXECUTABLE "@_qt_uic_executable@")
+set(AM_QT_RCC_EXECUTABLE "@_qt_rcc_executable@")
 set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
 set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
 set(AM_QT_VERSION_MAJOR "@_target_qt_version@")
@@ -18,3 +20,5 @@ set(AM_RELAXED_MODE "@_moc_relaxed_mode@")
 set(AM_UIC_TARGET_OPTIONS @_uic_target_options@)
 set(AM_UIC_OPTIONS_FILES @_qt_uic_options_files@)
 set(AM_UIC_OPTIONS_OPTIONS @_qt_uic_options_options@)
+set(AM_RCC_OPTIONS_FILES @_qt_rcc_options_files@)
+set(AM_RCC_OPTIONS_OPTIONS @_qt_rcc_options_options@)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 3fb6848..a8bb3fc 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1226,7 +1226,8 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
          target.GetType() == cmTarget::OBJECT_LIBRARY)
         {
         if((target.GetPropertyAsBool("AUTOMOC")
-              || target.GetPropertyAsBool("AUTOUIC"))
+              || target.GetPropertyAsBool("AUTOUIC")
+              || target.GetPropertyAsBool("AUTORCC"))
             && !target.IsImported())
           {
           cmQtAutoGenerators autogen;
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 30211f2..5f7a26f 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -119,6 +119,7 @@ cmQtAutoGenerators::cmQtAutoGenerators()
 ,ColorOutput(true)
 ,RunMocFailed(false)
 ,RunUicFailed(false)
+,RunRccFailed(false)
 ,GenerateAll(false)
 {
 
@@ -266,9 +267,18 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     {
     toolNames.push_back("uic");
     }
+  if (target->GetPropertyAsBool("AUTORCC"))
+    {
+    toolNames.push_back("rcc");
+    }
 
   std::string tools = toolNames[0];
   toolNames.erase(toolNames.begin());
+  while (toolNames.size() > 1)
+    {
+    tools += ", " + toolNames[0];
+    toolNames.erase(toolNames.begin());
+    }
   if (toolNames.size() == 1)
     {
     tools += " and " + toolNames[0];
@@ -343,6 +353,10 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     {
     this->SetupAutoUicTarget(target);
     }
+  if (target->GetPropertyAsBool("AUTORCC"))
+    {
+    this->SetupAutoRccTarget(target);
+    }
 
   const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
   std::string inputFile = cmakeRoot;
@@ -670,6 +684,168 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget* target)
     }
 }
 
+void cmQtAutoGenerators::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(o)) != 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 cmQtAutoGenerators::SetupAutoRccTarget(cmTarget* target)
+{
+  std::string _rcc_files;
+  const char* sepRccFiles = "";
+  cmMakefile *makefile = target->GetMakefile();
+
+  std::vector<cmSourceFile*> newFiles;
+
+  const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
+
+  std::string rccFileFiles;
+  std::string rccFileOptions;
+  const char *sep = "";
+
+  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);
+    }
+
+  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().c_str());
+      bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
+
+      if (!skip)
+        {
+        _rcc_files += sepRccFiles;
+        _rcc_files += absFile;
+        sepRccFiles = ";";
+
+        std::string basename = cmsys::SystemTools::
+                                      GetFilenameWithoutLastExtension(absFile);
+
+        std::string rcc_output_file = makefile->GetCurrentOutputDirectory();
+        rcc_output_file += "/qrc_" + basename + ".cpp";
+        makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
+                                rcc_output_file.c_str(), false);
+        cmSourceFile* rccCppSource
+                = makefile->GetOrCreateSource(rcc_output_file.c_str(), true);
+        newFiles.push_back(rccCppSource);
+
+        if (const char *prop = sf->GetProperty("AUTORCC_OPTIONS"))
+          {
+          std::vector<std::string> optsVec;
+          cmSystemTools::ExpandListArgument(prop, optsVec);
+          this->MergeRccOptions(rccOptions, optsVec,
+                                strcmp(qtVersion, "5") == 0);
+          }
+
+        if (!rccOptions.empty())
+          {
+          rccFileFiles += sep;
+          rccFileFiles += absFile;
+          rccFileOptions += sep;
+          }
+        const char *listSep = "";
+        for(std::vector<std::string>::const_iterator it = rccOptions.begin();
+            it != rccOptions.end();
+            ++it)
+          {
+          rccFileOptions += listSep;
+          rccFileOptions += *it;
+          listSep = "@list_sep@";
+          }
+        sep = ";";
+        }
+      }
+    }
+
+  for(std::vector<cmSourceFile*>::const_iterator fileIt = newFiles.begin();
+      fileIt != newFiles.end();
+      ++fileIt)
+    {
+    target->AddSourceFile(*fileIt);
+    }
+
+  makefile->AddDefinition("_rcc_files",
+          cmLocalGenerator::EscapeForCMake(_rcc_files.c_str()).c_str());
+
+  makefile->AddDefinition("_qt_rcc_options_files",
+              cmLocalGenerator::EscapeForCMake(rccFileFiles.c_str()).c_str());
+  makefile->AddDefinition("_qt_rcc_options_options",
+            cmLocalGenerator::EscapeForCMake(rccFileOptions.c_str()).c_str());
+
+  const char *qtRcc = makefile->GetSafeDefinition("QT_RCC_EXECUTABLE");
+  makefile->AddDefinition("_qt_rcc_executable", qtRcc);
+
+  const char* targetName = target->GetName();
+  if (strcmp(qtVersion, "5") == 0)
+    {
+    cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc");
+    if (!qt5Rcc)
+      {
+      cmSystemTools::Error("Qt5::rcc target not found ",
+                          targetName);
+      return;
+      }
+    makefile->AddDefinition("_qt_rcc_executable", qt5Rcc->GetLocation(0));
+    }
+  else
+    {
+    if (strcmp(qtVersion, "4") != 0)
+      {
+      cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
+                          "Qt 5 ", targetName);
+      }
+    }
+}
+
 bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
 {
   bool success = true;
@@ -734,6 +910,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
                                      "AM_Qt5Core_VERSION_MAJOR");
     }
   this->Sources = makefile->GetSafeDefinition("AM_SOURCES");
+  this->RccSources = makefile->GetSafeDefinition("AM_RCC_SOURCES");
   this->SkipMoc = makefile->GetSafeDefinition("AM_SKIP_MOC");
   this->SkipUic = makefile->GetSafeDefinition("AM_SKIP_UIC");
   this->Headers = makefile->GetSafeDefinition("AM_HEADERS");
@@ -743,6 +920,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
   this->Builddir = makefile->GetSafeDefinition("AM_CMAKE_CURRENT_BINARY_DIR");
   this->MocExecutable = makefile->GetSafeDefinition("AM_QT_MOC_EXECUTABLE");
   this->UicExecutable = makefile->GetSafeDefinition("AM_QT_UIC_EXECUTABLE");
+  this->RccExecutable = makefile->GetSafeDefinition("AM_QT_RCC_EXECUTABLE");
   std::string compileDefsPropOrig = "AM_MOC_COMPILE_DEFINITIONS";
   std::string compileDefsProp = compileDefsPropOrig;
   if(config)
@@ -793,6 +971,28 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
     this->UicOptions[*fileIt] = *optionIt;
     }
   }
+  {
+  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);
+  if (rccFilesVec.size() != rccOptionsVec.size())
+    {
+    return false;
+    }
+  for (std::vector<std::string>::iterator fileIt = rccFilesVec.begin(),
+                                            optionIt = rccOptionsVec.begin();
+                                            fileIt != rccFilesVec.end();
+                                            ++fileIt, ++optionIt)
+    {
+    cmSystemTools::ReplaceString(*optionIt, "@list_sep@", ";");
+    this->RccOptions[*fileIt] = *optionIt;
+    }
+  }
   this->CurrentCompileSettingsStr = this->MakeCompileSettingsString(makefile);
 
   this->RelaxedMode = makefile->IsOn("AM_RELAXED_MODE");
@@ -1044,6 +1244,11 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     this->GenerateUi(*it);
     }
 
+  if(!this->RccExecutable.empty())
+    {
+    this->GenerateQrc();
+    }
+
   cmsys_ios::stringstream outStream;
   outStream << "/* This file is autogenerated, do not edit*/\n";
 
@@ -1081,6 +1286,11 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     std::cerr << "uic failed..."<< std::endl;
     return false;
     }
+  if (this->RunRccFailed)
+    {
+    std::cerr << "rcc failed..."<< std::endl;
+    return false;
+    }
   outStream.flush();
   std::string automocSource = outStream.str();
   if (!automocCppChanged)
@@ -1677,6 +1887,79 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& uiFileName)
   return false;
 }
 
+bool cmQtAutoGenerators::GenerateQrc()
+{
+  std::vector<std::string> sourceFiles;
+  cmSystemTools::ExpandListArgument(this->RccSources, sourceFiles);
+
+  for(std::vector<std::string>::const_iterator si = sourceFiles.begin();
+      si != sourceFiles.end(); ++si)
+    {
+    std::string ext = cmsys::SystemTools::GetFilenameLastExtension(*si);
+
+    if (ext != ".qrc")
+      {
+      continue;
+      }
+    std::vector<cmStdString> command;
+    command.push_back(this->RccExecutable);
+
+    std::string basename = cmsys::SystemTools::
+                                  GetFilenameWithoutLastExtension(*si);
+
+    std::string rcc_output_file = this->Builddir + "qrc_" + basename + ".cpp";
+
+    int sourceNewerThanQrc = 0;
+    bool success = cmsys::SystemTools::FileTimeCompare(si->c_str(),
+                                                      rcc_output_file.c_str(),
+                                                      &sourceNewerThanQrc);
+    if (this->GenerateAll || !success || sourceNewerThanQrc >= 0)
+      {
+      std::string options;
+      std::map<std::string, std::string>::const_iterator optionIt
+              = this->RccOptions.find(*si);
+      if (optionIt != this->RccOptions.end())
+        {
+        std::vector<std::string> opts;
+        cmSystemTools::ExpandListArgument(optionIt->second, opts);
+        for(std::vector<std::string>::const_iterator optIt = opts.begin();
+            optIt != opts.end();
+            ++optIt)
+          {
+          command.push_back(*optIt);
+          }
+        }
+
+      command.push_back("-o");
+      command.push_back(rcc_output_file);
+      command.push_back(*si);
+
+      if (this->Verbose)
+        {
+        for(std::vector<cmStdString>::const_iterator cmdIt = command.begin();
+            cmdIt != command.end();
+            ++cmdIt)
+          {
+          std::cout << *cmdIt << " ";
+          }
+        std::cout << std::endl;
+        }
+      std::string output;
+      int retVal = 0;
+      bool result = cmSystemTools::RunSingleCommand(command, &output, &retVal);
+      if (!result || retVal)
+        {
+        std::cerr << "AUTORCC: error: process for " << rcc_output_file <<
+                  " failed:\n" << output << std::endl;
+        this->RunRccFailed = true;
+        cmSystemTools::RemoveFile(rcc_output_file.c_str());
+        return false;
+        }
+      }
+    }
+  return true;
+}
+
 std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst,
                               char separator)
 {
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 37b6154..696abc8 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -32,6 +32,7 @@ private:
                           std::map<std::string, std::string> &configIncludes,
                           std::map<std::string, std::string> &configDefines);
   void SetupAutoUicTarget(cmTarget* target);
+  void SetupAutoRccTarget(cmTarget* target);
 
   cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
                                            const char* targetDirectory);
@@ -49,6 +50,7 @@ private:
   bool GenerateMoc(const std::string& sourceFile,
                    const std::string& mocFileName);
   bool GenerateUi(const std::string& uiFileName);
+  bool GenerateQrc();
   void ParseCppFile(const std::string& absFilename,
                     const std::vector<std::string>& headerExtensions,
                     std::map<std::string, std::string>& includedMocs,
@@ -83,8 +85,12 @@ private:
   void MergeUicOptions(std::vector<std::string> &opts,
                        const std::vector<std::string> &fileOpts, bool isQt5);
 
+  void MergeRccOptions(std::vector<std::string> &opts,
+                       const std::vector<std::string> &fileOpts, bool isQt5);
+
   std::string QtMajorVersion;
   std::string Sources;
+  std::string RccSources;
   std::string SkipMoc;
   std::string SkipUic;
   std::string Headers;
@@ -93,6 +99,7 @@ private:
   std::string Builddir;
   std::string MocExecutable;
   std::string UicExecutable;
+  std::string RccExecutable;
   std::string MocCompileDefinitionsStr;
   std::string MocIncludesStr;
   std::string MocOptionsStr;
@@ -109,11 +116,13 @@ private:
   std::vector<std::string> MocOptions;
   std::vector<std::string> UicTargetOptions;
   std::map<std::string, std::string> UicOptions;
+  std::map<std::string, std::string> RccOptions;
 
   bool Verbose;
   bool ColorOutput;
   bool RunMocFailed;
   bool RunUicFailed;
+  bool RunRccFailed;
   bool GenerateAll;
   bool RelaxedMode;
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 5b77c27..98e615d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -275,8 +275,10 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
   this->SetPropertyDefault("AUTOMOC", 0);
   this->SetPropertyDefault("AUTOUIC", 0);
+  this->SetPropertyDefault("AUTORCC", 0);
   this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", 0);
   this->SetPropertyDefault("AUTOUIC_OPTIONS", 0);
+  this->SetPropertyDefault("AUTORCC_OPTIONS", 0);
   this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", 0);
   this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0);
   this->SetPropertyDefault("WIN32_EXECUTABLE", 0);
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index e194b94..7991c4e 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -36,6 +36,7 @@ add_definitions(-DFOO -DSomeDefine="Barx")
 set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
 
 set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
 
 # create an executable and two library targets, each requiring automoc:
 add_library(codeeditorLib STATIC codeeditor.cpp)
@@ -43,7 +44,9 @@ add_library(codeeditorLib STATIC codeeditor.cpp)
 add_library(privateSlot OBJECT private_slot.cpp)
 
 add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
-               xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>)
+               xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
+               test.qrc resourcetester.cpp
+)
 
 set_target_properties(QtAutogen codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE)
 
diff --git a/Tests/QtAutogen/main.cpp b/Tests/QtAutogen/main.cpp
index 39597ba..c8a036e 100644
--- a/Tests/QtAutogen/main.cpp
+++ b/Tests/QtAutogen/main.cpp
@@ -38,7 +38,8 @@
  **
  ****************************************************************************/
 
-#include <QApplication>
+#include <QCoreApplication>
+#include <QTimer>
 
 #include "codeeditor.h"
 #include "calwidget.h"
@@ -49,16 +50,11 @@
 #include "xyz.h"
 #include "yaf.h"
 #include "libC.h"
+#include "resourcetester.h"
 
 int main(int argv, char **args)
 {
-  QApplication app(argv, args);
-
-  CodeEditor editor;
-  editor.setWindowTitle(QObject::tr("Code Editor Example"));
-
-  Window w;
-  w.setWindowTitle(QObject::tr("Window Example"));
+  QCoreApplication app(argv, args);
 
   Foo foo;
   foo.doFoo();
@@ -81,5 +77,9 @@ int main(int argv, char **args)
   LibC lc;
   lc.foo();
 
+  ResourceTester rt;
+
+  QTimer::singleShot(0, &rt, SLOT(doTest()));
+
   return app.exec();
 }
diff --git a/Tests/QtAutogen/resourcetester.cpp b/Tests/QtAutogen/resourcetester.cpp
new file mode 100644
index 0000000..43314e1
--- /dev/null
+++ b/Tests/QtAutogen/resourcetester.cpp
@@ -0,0 +1,21 @@
+
+#include "resourcetester.h"
+
+#include <QDebug>
+#include <QApplication>
+#include <QFile>
+#include <QTimer>
+
+ResourceTester::ResourceTester(QObject *parent)
+  : QObject(parent)
+{
+
+}
+
+void ResourceTester::doTest()
+{
+  if (!QFile::exists(":/CMakeLists.txt"))
+      qApp->exit(EXIT_FAILURE);
+
+  QTimer::singleShot(0, qApp, SLOT(quit()));
+}
diff --git a/Tests/QtAutogen/resourcetester.h b/Tests/QtAutogen/resourcetester.h
new file mode 100644
index 0000000..b02cb4e
--- /dev/null
+++ b/Tests/QtAutogen/resourcetester.h
@@ -0,0 +1,17 @@
+
+#ifndef RESOURCE_TESTER_H
+#define RESOURCE_TESTER_H
+
+#include <QObject>
+
+class ResourceTester : public QObject
+{
+  Q_OBJECT
+public:
+  explicit ResourceTester(QObject *parent = 0);
+
+private slots:
+  void doTest();
+};
+
+#endif
diff --git a/Tests/QtAutogen/test.qrc b/Tests/QtAutogen/test.qrc
new file mode 100644
index 0000000..c3d4e3c
--- /dev/null
+++ b/Tests/QtAutogen/test.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+    <file>CMakeLists.txt</file>
+</qresource>
+</RCC>

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84218e1870ab075c9e2be1f2947358702c849fed
commit 84218e1870ab075c9e2be1f2947358702c849fed
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 25 09:24:53 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 12:30:38 2013 +0200

    Add automatic uic invocation for Qt.
    
    The source files are already processed by cmQtAutomoc to look for
    moc includes, so extend that to also look for ui_ includes and
    find corresponding .ui files to process.
    
    This replaces the need to invoke qt4_wrap_ui().
    
    As the ui files are not likely to be part of the SOURCES of the
    target, store the options associated with them separately in the
    cmMakefile for querying during the autogen run.

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index c248085..ddf24d4 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -73,6 +73,8 @@ Properties on Targets
    /prop_tgt/ARCHIVE_OUTPUT_NAME
    /prop_tgt/AUTOMOC_MOC_OPTIONS
    /prop_tgt/AUTOMOC
+   /prop_tgt/AUTOUIC
+   /prop_tgt/AUTOUIC_OPTIONS
    /prop_tgt/BUILD_WITH_INSTALL_RPATH
    /prop_tgt/BUNDLE_EXTENSION
    /prop_tgt/BUNDLE
@@ -234,6 +236,7 @@ Properties on Source Files
 
 .. toctree::
    /prop_sf/ABSTRACT
+   /prop_sf/AUTOUIC_OPTIONS
    /prop_sf/COMPILE_DEFINITIONS_CONFIG
    /prop_sf/COMPILE_DEFINITIONS
    /prop_sf/COMPILE_FLAGS
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 2311ac8..9a5f254 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -155,6 +155,8 @@ Variables that Control the Build
    /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
    /variable/CMAKE_AUTOMOC_MOC_OPTIONS
    /variable/CMAKE_AUTOMOC
+   /variable/CMAKE_AUTOUIC
+   /variable/CMAKE_AUTOUIC_OPTIONS
    /variable/CMAKE_BUILD_WITH_INSTALL_RPATH
    /variable/CMAKE_CONFIG_POSTFIX
    /variable/CMAKE_DEBUG_POSTFIX
diff --git a/Help/prop_sf/AUTOUIC_OPTIONS.rst b/Help/prop_sf/AUTOUIC_OPTIONS.rst
new file mode 100644
index 0000000..a38b2f8
--- /dev/null
+++ b/Help/prop_sf/AUTOUIC_OPTIONS.rst
@@ -0,0 +1,14 @@
+AUTOUIC_OPTIONS
+---------------
+
+Additional options for uic when using autouic (see the :prop_tgt:`AUTOUIC` target property)
+
+This property holds additional command line options
+which will be used when uic is executed during the build via autouic,
+i.e. it is equivalent to the optional OPTIONS argument of the
+qt4_wrap_ui() macro.
+
+By default it is empty.
+
+The options set on the .ui source file may override :prop_tgt:`AUTOUIC_OPTIONS` set
+on the target.
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
new file mode 100644
index 0000000..548c259
--- /dev/null
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -0,0 +1,22 @@
+AUTOUIC
+-------
+
+Should the target be processed with autouic (for Qt projects).
+
+AUTOUIC is a boolean specifying whether CMake will handle
+the Qt uic code generator automatically, i.e. without having to use
+the QT4_WRAP_UI() or QT5_WRAP_UI() macro. Currently Qt4 and Qt5 are
+supported.
+
+When this property is set to TRUE, CMake will scan the source files
+at build time and invoke uic accordingly.
+If an #include statement like #include "ui_foo.h" is found in
+foo.cpp, a foo.ui file is expected next to foo.cpp, and uic is
+run on the foo.ui file.
+This property is initialized by the value of the :variable:`CMAKE_AUTOUIC`
+variable if it is set when a target is created.
+
+Additional command line options for uic can be set via the
+:prop_sf:`AUTOUIC_OPTIONS` source file property on the foo.ui file.
+The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
+autouic targets together in an IDE, e.g. in MSVS.
diff --git a/Help/prop_tgt/AUTOUIC_OPTIONS.rst b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
new file mode 100644
index 0000000..c6cf885
--- /dev/null
+++ b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
@@ -0,0 +1,17 @@
+AUTOUIC_OPTIONS
+---------------
+
+Additional options for uic when using autouic (see the :prop_tgt:`AUTOUIC` target property)
+
+This property holds additional command line options
+which will be used when uic is executed during the build via autouic,
+i.e. it is equivalent to the optional OPTIONS argument of the
+qt4_wrap_ui() macro.
+
+By default it is empty.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_AUTOUIC` if it is set when a target is created.
+
+The options set on the target may be overridden by :prop_sf:`AUTOUIC_OPTIONS` set
+on the .ui source file.
diff --git a/Help/variable/CMAKE_AUTOUIC.rst b/Help/variable/CMAKE_AUTOUIC.rst
new file mode 100644
index 0000000..3b016b0
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOUIC.rst
@@ -0,0 +1,7 @@
+CMAKE_AUTOUIC
+-------------
+
+Whether to handle uic automatically for Qt targets.
+
+This variable is used to initialize the :prop_tgt:`AUTOUIC` property on all the targets.
+See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst b/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
new file mode 100644
index 0000000..6a88669
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
@@ -0,0 +1,7 @@
+CMAKE_AUTOUIC_OPTIONS
+---------------------
+
+Whether to handle uic automatically for Qt targets.
+
+This variable is used to initialize the :prop_tgt:`AUTOUIC_OPTIONS` property on
+all the targets.  See that target property for additional information.
diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in
index 19663ff..d2fb807 100644
--- a/Modules/AutogenInfo.cmake.in
+++ b/Modules/AutogenInfo.cmake.in
@@ -1,5 +1,6 @@
 set(AM_SOURCES @_moc_files@ )
 set(AM_SKIP_MOC @_skip_moc@ )
+set(AM_SKIP_UIC @_skip_uic@ )
 set(AM_HEADERS @_moc_headers@ )
 set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
 set(AM_MOC_INCLUDES @_moc_incs@)
@@ -8,8 +9,12 @@ set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJ
 set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/")
 set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
 set(AM_QT_MOC_EXECUTABLE "@_qt_moc_executable@")
+set(AM_QT_UIC_EXECUTABLE "@_qt_uic_executable@")
 set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
 set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
 set(AM_QT_VERSION_MAJOR "@_target_qt_version@")
 set(AM_TARGET_NAME @_moc_target_name@)
 set(AM_RELAXED_MODE "@_moc_relaxed_mode@")
+set(AM_UIC_TARGET_OPTIONS @_uic_target_options@)
+set(AM_UIC_OPTIONS_FILES @_qt_uic_options_files@)
+set(AM_UIC_OPTIONS_OPTIONS @_qt_uic_options_options@)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 386af6d..3fb6848 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1225,7 +1225,9 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
          target.GetType() == cmTarget::MODULE_LIBRARY ||
          target.GetType() == cmTarget::OBJECT_LIBRARY)
         {
-        if(target.GetPropertyAsBool("AUTOMOC") && !target.IsImported())
+        if((target.GetPropertyAsBool("AUTOMOC")
+              || target.GetPropertyAsBool("AUTOUIC"))
+            && !target.IsImported())
           {
           cmQtAutoGenerators autogen;
           if(autogen.InitializeMocSourceFile(&target))
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 13c43fa..df64ca6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4240,6 +4240,18 @@ bool cmMakefile::EnforceUniqueDir(const char* srcPath, const char* binPath)
 }
 
 //----------------------------------------------------------------------------
+void cmMakefile::AddQtUiFileWithOptions(cmSourceFile *sf)
+{
+  this->QtUiFilesWithOptions.push_back(sf);
+}
+
+//----------------------------------------------------------------------------
+std::vector<cmSourceFile*> cmMakefile::GetQtUiFilesWithOptions() const
+{
+  return this->QtUiFilesWithOptions;
+}
+
+//----------------------------------------------------------------------------
 cmPolicies::PolicyStatus
 cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id)
 {
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index ca82336..794873a 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -884,6 +884,9 @@ public:
   bool IsGeneratingBuildSystem(){ return this->GeneratingBuildSystem; }
   void SetGeneratingBuildSystem(){ this->GeneratingBuildSystem = true; }
 
+  void AddQtUiFileWithOptions(cmSourceFile *sf);
+  std::vector<cmSourceFile*> GetQtUiFilesWithOptions() const;
+
   std::set<cmStdString> const & GetSystemIncludeDirectories() const
     { return this->SystemIncludeDirectories; }
 
@@ -1061,6 +1064,8 @@ private:
                                cmSourceFile* source);
   void UpdateOutputToSourceMap(std::string const& output,
                                cmSourceFile* source);
+
+  std::vector<cmSourceFile*> QtUiFilesWithOptions;
 };
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 7f8d283..30211f2 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -23,6 +23,7 @@
 
 #include <cmsys/Terminal.h>
 #include <cmsys/ios/sstream>
+#include <assert.h>
 
 #include <string.h>
 #if defined(__APPLE__)
@@ -117,6 +118,7 @@ cmQtAutoGenerators::cmQtAutoGenerators()
 :Verbose(cmsys::SystemTools::GetEnv("VERBOSE") != 0)
 ,ColorOutput(true)
 ,RunMocFailed(false)
+,RunUicFailed(false)
 ,GenerateAll(false)
 {
 
@@ -255,7 +257,22 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
                                     "", makefile->GetCurrentOutputDirectory());
 
   std::vector<std::string> depends;
-  std::string tools = "moc";
+  std::vector<std::string> toolNames;
+  if (target->GetPropertyAsBool("AUTOMOC"))
+    {
+    toolNames.push_back("moc");
+    }
+  if (target->GetPropertyAsBool("AUTOUIC"))
+    {
+    toolNames.push_back("uic");
+    }
+
+  std::string tools = toolNames[0];
+  toolNames.erase(toolNames.begin());
+  if (toolNames.size() == 1)
+    {
+    tools += " and " + toolNames[0];
+    }
   std::string autogenComment = "Automatic " + tools + " for target ";
   autogenComment += targetName;
 
@@ -322,6 +339,10 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     this->SetupAutoMocTarget(target, autogenTargetName,
                              configIncludes, configDefines);
     }
+  if (target->GetPropertyAsBool("AUTOUIC"))
+    {
+    this->SetupAutoUicTarget(target);
+    }
 
   const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
   std::string inputFile = cmakeRoot;
@@ -499,6 +520,156 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
     }
 }
 
+void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
+                         const std::vector<std::string> &fileOpts,
+                         bool isQt5)
+{
+  static const char* valueOptions[] = {
+    "tr",
+    "translate",
+    "postfix",
+    "generator",
+    "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(o)) != 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 cmQtAutoGenerators::SetupAutoUicTarget(cmTarget* target)
+{
+  cmMakefile *makefile = target->GetMakefile();
+
+  const char *qtUic = makefile->GetSafeDefinition("QT_UIC_EXECUTABLE");
+  makefile->AddDefinition("_qt_uic_executable", qtUic);
+
+  const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
+
+  std::string skip_uic;
+  const char *sep = "";
+
+  bool skip  = target->GetPropertyAsBool("SKIP_AUTOUIC");
+
+  std::set<cmStdString> skipped;
+
+  for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
+      fileIt != srcFiles.end();
+      ++fileIt)
+    {
+    cmSourceFile* sf = *fileIt;
+    std::string absFile = cmsys::SystemTools::GetRealPath(
+                                                    sf->GetFullPath().c_str());
+    if (!skip)
+      {
+      skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"));
+      }
+
+    if (skip)
+      {
+      skip_uic += sep;
+      skip_uic += absFile;
+      sep = ";";
+      skipped.insert(absFile);
+      }
+    }
+
+  makefile->AddDefinition("_skip_uic",
+          cmLocalGenerator::EscapeForCMake(skip_uic.c_str()).c_str());
+
+  std::vector<cmSourceFile*> uiFilesWithOptions
+                                        = makefile->GetQtUiFilesWithOptions();
+
+  std::string uiFileFiles;
+  std::string uiFileOptions;
+  sep = "";
+
+  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+
+  if (const char* opts = target->GetProperty("AUTOUIC_OPTIONS"))
+    {
+    makefile->AddDefinition("_uic_target_options",
+                            cmLocalGenerator::EscapeForCMake(opts).c_str());
+    }
+
+  for(std::vector<cmSourceFile*>::const_iterator fileIt =
+      uiFilesWithOptions.begin();
+      fileIt != uiFilesWithOptions.end();
+      ++fileIt)
+    {
+    cmSourceFile* sf = *fileIt;
+    std::string absFile = cmsys::SystemTools::GetRealPath(
+                                                    sf->GetFullPath().c_str());
+
+    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",
+              cmLocalGenerator::EscapeForCMake(uiFileFiles.c_str()).c_str());
+  makefile->AddDefinition("_qt_uic_options_options",
+            cmLocalGenerator::EscapeForCMake(uiFileOptions.c_str()).c_str());
+
+  const char* 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
+      makefile->RemoveDefinition("_qt_uic_executable");
+      }
+    else
+      {
+      makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(0));
+      }
+    }
+  else
+    {
+    if (strcmp(qtVersion, "4") != 0)
+      {
+      cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and "
+                          "Qt 5 ", targetName);
+      }
+    }
+}
+
 bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
 {
   bool success = true;
@@ -563,12 +734,15 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
                                      "AM_Qt5Core_VERSION_MAJOR");
     }
   this->Sources = makefile->GetSafeDefinition("AM_SOURCES");
+  this->SkipMoc = makefile->GetSafeDefinition("AM_SKIP_MOC");
+  this->SkipUic = makefile->GetSafeDefinition("AM_SKIP_UIC");
   this->Headers = makefile->GetSafeDefinition("AM_HEADERS");
   this->IncludeProjectDirsBefore = makefile->IsOn(
                                 "AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE");
   this->Srcdir = makefile->GetSafeDefinition("AM_CMAKE_CURRENT_SOURCE_DIR");
   this->Builddir = makefile->GetSafeDefinition("AM_CMAKE_CURRENT_BINARY_DIR");
   this->MocExecutable = makefile->GetSafeDefinition("AM_QT_MOC_EXECUTABLE");
+  this->UicExecutable = makefile->GetSafeDefinition("AM_QT_UIC_EXECUTABLE");
   std::string compileDefsPropOrig = "AM_MOC_COMPILE_DEFINITIONS";
   std::string compileDefsProp = compileDefsPropOrig;
   if(config)
@@ -594,6 +768,31 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
   this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR");
   this->TargetName = makefile->GetSafeDefinition("AM_TARGET_NAME");
 
+  {
+  const char *uicOptionsFiles
+                        = makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES");
+  const char *uicTargetOptions
+                        = makefile->GetSafeDefinition("AM_UIC_TARGET_OPTIONS");
+  cmSystemTools::ExpandListArgument(uicTargetOptions, 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);
+  if (uicFilesVec.size() != uicOptionsVec.size())
+    {
+    return false;
+    }
+  for (std::vector<std::string>::iterator fileIt = uicFilesVec.begin(),
+                                            optionIt = uicOptionsVec.begin();
+                                            fileIt != uicFilesVec.end();
+                                            ++fileIt, ++optionIt)
+    {
+    cmSystemTools::ReplaceString(*optionIt, "@list_sep@", ";");
+    this->UicOptions[*fileIt] = *optionIt;
+    }
+  }
   this->CurrentCompileSettingsStr = this->MakeCompileSettingsString(makefile);
 
   this->RelaxedMode = makefile->IsOn("AM_RELAXED_MODE");
@@ -767,10 +966,18 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
   const std::vector<std::string>& headerExtensions =
                                                makefile->GetHeaderExtensions();
 
+  std::vector<std::string> includedUis;
+  std::vector<std::string> skippedUis;
+  std::vector<std::string> uicSkipped;
+  cmSystemTools::ExpandListArgument(this->SkipUic, uicSkipped);
+
   for (std::vector<std::string>::const_iterator it = sourceFiles.begin();
        it != sourceFiles.end();
        ++it)
     {
+    const bool skipUic = std::find(uicSkipped.begin(), uicSkipped.end(), *it)
+        != uicSkipped.end();
+    std::vector<std::string>& uiFiles = skipUic ? skippedUis : includedUis;
     const std::string &absFilename = *it;
     if (this->Verbose)
       {
@@ -778,15 +985,37 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
       }
     if (this->RelaxedMode)
       {
-      this->ParseCppFile(absFilename, headerExtensions, includedMocs);
+      this->ParseCppFile(absFilename, headerExtensions, includedMocs,
+                         uiFiles);
       }
     else
       {
-      this->StrictParseCppFile(absFilename, headerExtensions, includedMocs);
+      this->StrictParseCppFile(absFilename, headerExtensions, includedMocs,
+                               uiFiles);
       }
     this->SearchHeadersForCppFile(absFilename, headerExtensions, headerFiles);
     }
 
+  {
+  std::vector<std::string> mocSkipped;
+  cmSystemTools::ExpandListArgument(this->SkipMoc, mocSkipped);
+  for (std::vector<std::string>::const_iterator it = mocSkipped.begin();
+       it != mocSkipped.end();
+       ++it)
+    {
+    if (std::find(uicSkipped.begin(), uicSkipped.end(), *it)
+        != uicSkipped.end())
+      {
+      const std::string &absFilename = *it;
+      if (this->Verbose)
+        {
+        std::cout << "AUTOGEN: Checking " << absFilename << std::endl;
+        }
+      this->ParseForUic(absFilename, includedUis);
+      }
+    }
+  }
+
   std::vector<std::string> headerFilesVec;
   cmSystemTools::ExpandListArgument(this->Headers, headerFilesVec);
   for (std::vector<std::string>::const_iterator it = headerFilesVec.begin();
@@ -798,7 +1027,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
 
   // key = moc source filepath, value = moc output filename
   std::map<std::string, std::string> notIncludedMocs;
-  this->ParseHeaders(headerFiles, includedMocs, notIncludedMocs);
+  this->ParseHeaders(headerFiles, includedMocs, notIncludedMocs, includedUis);
 
   // run moc on all the moc's that are #included in source files
   for(std::map<std::string, std::string>::const_iterator
@@ -808,6 +1037,12 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     {
     this->GenerateMoc(it->first, it->second);
     }
+  for(std::vector<std::string>::const_iterator it = includedUis.begin();
+      it != includedUis.end();
+      ++it)
+    {
+    this->GenerateUi(*it);
+    }
 
   cmsys_ios::stringstream outStream;
   outStream << "/* This file is autogenerated, do not edit*/\n";
@@ -840,6 +1075,12 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     std::cerr << "moc failed..."<< std::endl;
     return false;
     }
+
+  if (this->RunUicFailed)
+    {
+    std::cerr << "uic failed..."<< std::endl;
+    return false;
+    }
   outStream.flush();
   std::string automocSource = outStream.str();
   if (!automocCppChanged)
@@ -866,7 +1107,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
 
 void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
-                              std::map<std::string, std::string>& includedMocs)
+                              std::map<std::string, std::string>& includedMocs,
+                              std::vector<std::string> &includedUis)
 {
   cmsys::RegularExpression mocIncludeRegExp(
               "[\n][ \t]*#[ \t]*include[ \t]+"
@@ -1007,6 +1249,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
       matchOffset += mocIncludeRegExp.end();
       } while(mocIncludeRegExp.find(contentsString.c_str() + matchOffset));
     }
+  this->ParseForUic(absFilename, contentsString, includedUis);
 
   // In this case, check whether the scanned file itself contains a Q_OBJECT.
   // If this is the case, the moc_foo.cpp should probably be generated from
@@ -1047,7 +1290,8 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
 
 void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
-                              std::map<std::string, std::string>& includedMocs)
+                              std::map<std::string, std::string>& includedMocs,
+                              std::vector<std::string>& includedUis)
 {
   cmsys::RegularExpression mocIncludeRegExp(
               "[\n][ \t]*#[ \t]*include[ \t]+"
@@ -1138,6 +1382,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
       matchOffset += mocIncludeRegExp.end();
       } while(mocIncludeRegExp.find(contentsString.c_str() + matchOffset));
     }
+  this->ParseForUic(absFilename, contentsString, includedUis);
 
   // In this case, check whether the scanned file itself contains a Q_OBJECT.
   // If this is the case, the moc_foo.cpp should probably be generated from
@@ -1158,6 +1403,61 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
 }
 
 
+void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
+                              std::vector<std::string>& includedUis)
+{
+  if (this->UicExecutable.empty())
+    {
+    return;
+    }
+  const std::string contentsString = this->ReadAll(absFilename);
+  if (contentsString.empty())
+    {
+    std::cerr << "AUTOGEN: warning: " << absFilename << ": file is empty\n"
+              << std::endl;
+    return;
+    }
+  this->ParseForUic(absFilename, contentsString, includedUis);
+}
+
+
+void cmQtAutoGenerators::ParseForUic(const std::string&,
+                                     const std::string& contentsString,
+                                     std::vector<std::string>& includedUis)
+{
+  if (this->UicExecutable.empty())
+    {
+    return;
+    }
+  cmsys::RegularExpression uiIncludeRegExp(
+              "[\n][ \t]*#[ \t]*include[ \t]+"
+              "[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
+
+  std::string::size_type matchOffset = 0;
+
+  matchOffset = 0;
+  if ((strstr(contentsString.c_str(), "ui_") != NULL)
+                                    && (uiIncludeRegExp.find(contentsString)))
+    {
+    do
+      {
+      const std::string currentUi = uiIncludeRegExp.match(1);
+
+      std::string basename = cmsys::SystemTools::
+                                  GetFilenameWithoutLastExtension(currentUi);
+
+      // basename should be the part of the ui filename used for
+      // finding the correct header, so we need to remove the ui_ part
+      basename = basename.substr(3);
+
+      includedUis.push_back(basename);
+
+      matchOffset += uiIncludeRegExp.end();
+      } while(uiIncludeRegExp.find(contentsString.c_str() + matchOffset));
+    }
+}
+
+
 void
 cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
@@ -1197,13 +1497,15 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
 
 void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
                         const std::map<std::string, std::string>& includedMocs,
-                        std::map<std::string, std::string>& notIncludedMocs)
+                        std::map<std::string, std::string>& notIncludedMocs,
+                        std::vector<std::string>& includedUis)
 {
   for(std::set<std::string>::const_iterator hIt=absHeaders.begin();
       hIt!=absHeaders.end();
       ++hIt)
     {
     const std::string& headerName = *hIt;
+    const std::string contents = this->ReadAll(headerName);
 
     if (includedMocs.find(headerName) == includedMocs.end())
       {
@@ -1216,7 +1518,6 @@ void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
                                    GetFilenameWithoutLastExtension(headerName);
 
       const std::string currentMoc = "moc_" + basename + ".cpp";
-      const std::string contents = this->ReadAll(headerName);
       std::string macroName;
       if (requiresMocing(contents, macroName))
         {
@@ -1224,11 +1525,10 @@ void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
         notIncludedMocs[headerName] = currentMoc;
         }
       }
+    this->ParseForUic(headerName, contents, includedUis);
     }
-
 }
 
-
 bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
                               const std::string& mocFileName)
 {
@@ -1305,6 +1605,77 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
   return false;
 }
 
+bool cmQtAutoGenerators::GenerateUi(const std::string& uiFileName)
+{
+  if (!cmsys::SystemTools::FileExists(this->Builddir.c_str(), false))
+    {
+    cmsys::SystemTools::MakeDirectory(this->Builddir.c_str());
+    }
+
+  std::string ui_output_file = "ui_" + uiFileName + ".h";
+  std::string ui_input_file = this->Srcdir + uiFileName + ".ui";
+
+  int sourceNewerThanUi = 0;
+  bool success = cmsys::SystemTools::FileTimeCompare(ui_input_file.c_str(),
+                                    (this->Builddir + ui_output_file).c_str(),
+                                                     &sourceNewerThanUi);
+  if (this->GenerateAll || !success || sourceNewerThanUi >= 0)
+    {
+    std::string msg = "Generating ";
+    msg += ui_output_file;
+    cmSystemTools::MakefileColorEcho(cmsysTerminal_Color_ForegroundBlue
+                                          |cmsysTerminal_Color_ForegroundBold,
+                                      msg.c_str(), true, this->ColorOutput);
+
+    std::vector<cmStdString> command;
+    command.push_back(this->UicExecutable);
+
+    std::string options;
+    std::vector<std::string> opts = this->UicTargetOptions;
+    std::map<std::string, std::string>::const_iterator optionIt
+            = this->UicOptions.find(ui_input_file);
+    if (optionIt != this->UicOptions.end())
+      {
+      std::vector<std::string> fileOpts;
+      cmSystemTools::ExpandListArgument(optionIt->second, fileOpts);
+      this->MergeUicOptions(opts, fileOpts, this->QtMajorVersion == "5");
+      }
+    for(std::vector<std::string>::const_iterator optIt = opts.begin();
+        optIt != opts.end();
+        ++optIt)
+      {
+      command.push_back(*optIt);
+      }
+
+    command.push_back("-o");
+    command.push_back(this->Builddir + ui_output_file);
+    command.push_back(ui_input_file);
+
+    if (this->Verbose)
+      {
+      for(std::vector<cmStdString>::const_iterator cmdIt = command.begin();
+          cmdIt != command.end();
+          ++cmdIt)
+        {
+        std::cout << *cmdIt << " ";
+        }
+      std::cout << std::endl;
+      }
+    std::string output;
+    int retVal = 0;
+    bool result = cmSystemTools::RunSingleCommand(command, &output, &retVal);
+    if (!result || retVal)
+      {
+      std::cerr << "AUTOUIC: error: process for " << ui_output_file <<
+                " failed:\n" << output << std::endl;
+      this->RunUicFailed = true;
+      cmSystemTools::RemoveFile(ui_output_file.c_str());
+      return false;
+      }
+    return true;
+    }
+  return false;
+}
 
 std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst,
                               char separator)
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index fe38b05..37b6154 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -31,6 +31,7 @@ private:
                           const std::string &autogenTargetName,
                           std::map<std::string, std::string> &configIncludes,
                           std::map<std::string, std::string> &configDefines);
+  void SetupAutoUicTarget(cmTarget* target);
 
   cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
                                            const char* targetDirectory);
@@ -47,19 +48,30 @@ private:
   bool RunAutogen(cmMakefile* makefile);
   bool GenerateMoc(const std::string& sourceFile,
                    const std::string& mocFileName);
+  bool GenerateUi(const std::string& uiFileName);
   void ParseCppFile(const std::string& absFilename,
                     const std::vector<std::string>& headerExtensions,
-                    std::map<std::string, std::string>& includedMocs);
+                    std::map<std::string, std::string>& includedMocs,
+                          std::vector<std::string>& includedUis);
   void StrictParseCppFile(const std::string& absFilename,
                           const std::vector<std::string>& headerExtensions,
-                          std::map<std::string, std::string>& includedMocs);
+                          std::map<std::string, std::string>& includedMocs,
+                          std::vector<std::string>& includedUis);
   void SearchHeadersForCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
                               std::set<std::string>& absHeaders);
 
   void ParseHeaders(const std::set<std::string>& absHeaders,
                     const std::map<std::string, std::string>& includedMocs,
-                    std::map<std::string, std::string>& notIncludedMocs);
+                    std::map<std::string, std::string>& notIncludedMocs,
+                          std::vector<std::string>& includedUis);
+
+  void ParseForUic(const std::string& fileName,
+                   const std::string& contentsString,
+                   std::vector<std::string>& includedUis);
+
+  void ParseForUic(const std::string& fileName,
+                   std::vector<std::string>& includedUis);
 
   void Init();
 
@@ -68,13 +80,19 @@ private:
   bool StartsWith(const std::string& str, const std::string& with);
   std::string ReadAll(const std::string& filename);
 
+  void MergeUicOptions(std::vector<std::string> &opts,
+                       const std::vector<std::string> &fileOpts, bool isQt5);
+
   std::string QtMajorVersion;
   std::string Sources;
+  std::string SkipMoc;
+  std::string SkipUic;
   std::string Headers;
   bool IncludeProjectDirsBefore;
   std::string Srcdir;
   std::string Builddir;
   std::string MocExecutable;
+  std::string UicExecutable;
   std::string MocCompileDefinitionsStr;
   std::string MocIncludesStr;
   std::string MocOptionsStr;
@@ -89,10 +107,13 @@ private:
   std::list<std::string> MocIncludes;
   std::list<std::string> MocDefinitions;
   std::vector<std::string> MocOptions;
+  std::vector<std::string> UicTargetOptions;
+  std::map<std::string, std::string> UicOptions;
 
   bool Verbose;
   bool ColorOutput;
   bool RunMocFailed;
+  bool RunUicFailed;
   bool GenerateAll;
   bool RelaxedMode;
 
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index d747309..ec98c2c 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -287,6 +287,17 @@ void cmSourceFile::SetProperty(const char* prop, const char* value)
     }
 
   this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE);
+
+  std::string ext =
+          cmSystemTools::GetFilenameLastExtension(this->Location.GetName());
+  if (ext == ".ui")
+    {
+    cmMakefile* mf = this->Location.GetMakefile();
+    if (strcmp(prop, "AUTOUIC_OPTIONS") == 0)
+      {
+      mf->AddQtUiFileWithOptions(this);
+      }
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ad4ae0c..5b77c27 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -274,7 +274,9 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   this->SetPropertyDefault("GNUtoMS", 0);
   this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
   this->SetPropertyDefault("AUTOMOC", 0);
+  this->SetPropertyDefault("AUTOUIC", 0);
   this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", 0);
+  this->SetPropertyDefault("AUTOUIC_OPTIONS", 0);
   this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", 0);
   this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0);
   this->SetPropertyDefault("WIN32_EXECUTABLE", 0);
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 39c1ae9..e194b94 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -35,6 +35,8 @@ add_definitions(-DFOO -DSomeDefine="Barx")
 # enable relaxed mode so automoc can handle all the special cases:
 set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
 
+set(CMAKE_AUTOUIC ON)
+
 # create an executable and two library targets, each requiring automoc:
 add_library(codeeditorLib STATIC codeeditor.cpp)
 
diff --git a/Tests/QtAutogen/calwidget.cpp b/Tests/QtAutogen/calwidget.cpp
index cbfa5a8..defde20 100644
--- a/Tests/QtAutogen/calwidget.cpp
+++ b/Tests/QtAutogen/calwidget.cpp
@@ -49,7 +49,10 @@
 
  #include "calwidget.h"
 
+ #include "ui_calwidget.h"
+
  Window::Window()
+  : ui(new Ui::Window)
  {
      createPreviewGroupBox();
      createGeneralOptionsGroupBox();
diff --git a/Tests/QtAutogen/calwidget.h b/Tests/QtAutogen/calwidget.h
index 8447389..d21a473 100644
--- a/Tests/QtAutogen/calwidget.h
+++ b/Tests/QtAutogen/calwidget.h
@@ -52,6 +52,11 @@
  class QGroupBox;
  class QLabel;
 
+ namespace Ui
+ {
+ class Window;
+ }
+
  class Window : public QWidget
  {
      Q_OBJECT
@@ -116,6 +121,8 @@
 
      QCheckBox *firstFridayCheckBox;
      QCheckBox *mayFirstCheckBox;
+
+     Ui::Window *ui;
  };
 
  #endif
diff --git a/Tests/QtAutogen/calwidget.ui b/Tests/QtAutogen/calwidget.ui
new file mode 100644
index 0000000..1c245ca
--- /dev/null
+++ b/Tests/QtAutogen/calwidget.ui
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Window</class>
+ <widget class="QWidget" name="Window">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <widget class="QPushButton" name="pushButton">
+   <property name="geometry">
+    <rect>
+     <x>90</x>
+     <y>180</y>
+     <width>94</width>
+     <height>24</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>PushButton</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94a0ca604ca6ba3699b6d309938e881b2a3984a0
commit 94a0ca604ca6ba3699b6d309938e881b2a3984a0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 15:04:15 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:58 2013 +0200

    Record which files are skipped by automoc.
    
    They may not be skipped by autouic.

diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in
index 9cff735..19663ff 100644
--- a/Modules/AutogenInfo.cmake.in
+++ b/Modules/AutogenInfo.cmake.in
@@ -1,4 +1,5 @@
 set(AM_SOURCES @_moc_files@ )
+set(AM_SKIP_MOC @_skip_moc@ )
 set(AM_HEADERS @_moc_headers@ )
 set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
 set(AM_MOC_INCLUDES @_moc_incs@)
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 656bb0c..7f8d283 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -379,6 +379,9 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
 
   const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
 
+  std::string skip_moc;
+  const char *sep = "";
+
   for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
       fileIt != srcFiles.end();
       ++fileIt)
@@ -389,22 +392,31 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
     bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
     bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
 
-    if ((skip==false) && (generated == false))
+    if (!generated)
       {
-      std::string ext = sf->GetExtension();
-      cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
-                                                                  ext.c_str());
-      if (fileType == cmSystemTools::CXX_FILE_FORMAT)
+      if (skip)
         {
-        _moc_files += sepFiles;
-        _moc_files += absFile;
-        sepFiles = ";";
+        skip_moc += sep;
+        skip_moc += absFile;
+        sep = ";";
         }
-      else if (fileType == cmSystemTools::HEADER_FILE_FORMAT)
+      else
         {
-        _moc_headers += sepHeaders;
-        _moc_headers += absFile;
-        sepHeaders = ";";
+        std::string ext = sf->GetExtension();
+        cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
+                                                                ext.c_str());
+        if (fileType == cmSystemTools::CXX_FILE_FORMAT)
+          {
+          _moc_files += sepFiles;
+          _moc_files += absFile;
+          sepFiles = ";";
+          }
+        else if (fileType == cmSystemTools::HEADER_FILE_FORMAT)
+          {
+          _moc_headers += sepHeaders;
+          _moc_headers += absFile;
+          sepHeaders = ";";
+          }
         }
       }
     }
@@ -415,6 +427,8 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
           cmLocalGenerator::EscapeForCMake(_moc_options.c_str()).c_str());
   makefile->AddDefinition("_moc_files",
           cmLocalGenerator::EscapeForCMake(_moc_files.c_str()).c_str());
+  makefile->AddDefinition("_skip_moc",
+          cmLocalGenerator::EscapeForCMake(skip_moc.c_str()).c_str());
   makefile->AddDefinition("_moc_headers",
           cmLocalGenerator::EscapeForCMake(_moc_headers.c_str()).c_str());
   bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18fb7588df5b380340423eb36a90a7aefc1fa6ca
commit 18fb7588df5b380340423eb36a90a7aefc1fa6ca
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 20:16:43 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:58 2013 +0200

    Run the main executable created in the autogen tests.
    
    Don't try to show the windows, which would require a gui capable test
    machine, and that's not guaranteed.
    
    Automatically link to qtmain.a on Windows to avoid a policy warning. Set
    policy CMP0020 to NEW by increasing the required version.
    
    Don't attempt to run the test when using Windows.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 38b2a0c..cf98a41 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1029,6 +1029,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt")
 
+  # On Windows there is no RPATH, so while Qt might be available for building,
+  # the required dlls may not be in the PATH, so we can't run the executables
+  # on that platform.
+  if(WIN32)
+    set(run_autogen_test ${CMAKE_CTEST_COMMAND} -V)
+  else()
+    set(run_autogen_test QtAutogen)
+  endif()
+
   find_package(Qt5Widgets QUIET NO_MODULE)
   if(Qt5Widgets_FOUND)
     add_test(Qt5Autogen ${CMAKE_CTEST_COMMAND}
@@ -1040,7 +1049,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Autogen"
       --force-new-ctest-process
       --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
-      --test-command ${CMAKE_CTEST_COMMAND} -V
+      --test-command ${run_autogen_test}
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen")
   endif()
@@ -1054,7 +1063,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Autogen"
       --force-new-ctest-process
       --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
-      --test-command ${CMAKE_CTEST_COMMAND} -V
+      --test-command ${run_autogen_test}
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen")
 
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index a7f553f..39c1ae9 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.11)
 
 project(QtAutogen)
 
@@ -40,10 +40,10 @@ add_library(codeeditorLib STATIC codeeditor.cpp)
 
 add_library(privateSlot OBJECT private_slot.cpp)
 
-add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
+add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
                xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>)
 
-set_target_properties(foo codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE)
+set_target_properties(QtAutogen codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE)
 
 include(GenerateExportHeader)
 # The order is relevant here. B depends on A, and B headers depend on A
@@ -59,7 +59,7 @@ set_target_properties(libC PROPERTIES AUTOMOC TRUE)
 generate_export_header(libC)
 target_link_libraries(libC LINK_PUBLIC libB)
 
-target_link_libraries(foo codeeditorLib ${QT_LIBRARIES} libC)
+target_link_libraries(QtAutogen codeeditorLib ${QT_LIBRARIES} libC)
 
 add_library(empty STATIC empty.cpp)
 set_target_properties(empty PROPERTIES AUTOMOC TRUE)
diff --git a/Tests/QtAutogen/main.cpp b/Tests/QtAutogen/main.cpp
index bd80180..39597ba 100644
--- a/Tests/QtAutogen/main.cpp
+++ b/Tests/QtAutogen/main.cpp
@@ -56,10 +56,9 @@ int main(int argv, char **args)
 
   CodeEditor editor;
   editor.setWindowTitle(QObject::tr("Code Editor Example"));
-  editor.show();
 
   Window w;
-  w.show();
+  w.setWindowTitle(QObject::tr("Window Example"));
 
   Foo foo;
   foo.doFoo();

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e485ba12193d36ffc4faee89bb80dbe611ad7e82
commit e485ba12193d36ffc4faee89bb80dbe611ad7e82
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 14:17:32 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:58 2013 +0200

    Rename the QtAutomoc tests to QtAutogen.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b9c99e3..38b2a0c 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1031,32 +1031,32 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
   find_package(Qt5Widgets QUIET NO_MODULE)
   if(Qt5Widgets_FOUND)
-    add_test(Qt5Automoc ${CMAKE_CTEST_COMMAND}
+    add_test(Qt5Autogen ${CMAKE_CTEST_COMMAND}
       --build-and-test
-      "${CMake_SOURCE_DIR}/Tests/QtAutomoc"
-      "${CMake_BINARY_DIR}/Tests/Qt5Automoc"
+      "${CMake_SOURCE_DIR}/Tests/QtAutogen"
+      "${CMake_BINARY_DIR}/Tests/Qt5Autogen"
       ${build_generator_args}
-      --build-project QtAutomoc
-      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Automoc"
+      --build-project QtAutogen
+      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Autogen"
       --force-new-ctest-process
       --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
       --test-command ${CMAKE_CTEST_COMMAND} -V
       )
-    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Automoc")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen")
   endif()
   if(QT4_WORKS AND QT_QTGUI_FOUND)
-    add_test(Qt4Automoc ${CMAKE_CTEST_COMMAND}
+    add_test(Qt4Autogen ${CMAKE_CTEST_COMMAND}
       --build-and-test
-      "${CMake_SOURCE_DIR}/Tests/QtAutomoc"
-      "${CMake_BINARY_DIR}/Tests/Qt4Automoc"
+      "${CMake_SOURCE_DIR}/Tests/QtAutogen"
+      "${CMake_BINARY_DIR}/Tests/Qt4Autogen"
       ${build_generator_args}
-      --build-project QtAutomoc
-      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Automoc"
+      --build-project QtAutogen
+      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Autogen"
       --force-new-ctest-process
       --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
       --test-command ${CMAKE_CTEST_COMMAND} -V
       )
-    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Automoc")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen")
 
     add_test(Qt4Targets ${CMAKE_CTEST_COMMAND}
       --build-and-test
diff --git a/Tests/QtAutomoc/Adir/CMakeLists.txt b/Tests/QtAutogen/Adir/CMakeLists.txt
similarity index 100%
rename from Tests/QtAutomoc/Adir/CMakeLists.txt
rename to Tests/QtAutogen/Adir/CMakeLists.txt
diff --git a/Tests/QtAutomoc/Adir/libA.cpp b/Tests/QtAutogen/Adir/libA.cpp
similarity index 100%
rename from Tests/QtAutomoc/Adir/libA.cpp
rename to Tests/QtAutogen/Adir/libA.cpp
diff --git a/Tests/QtAutomoc/Adir/libA.h b/Tests/QtAutogen/Adir/libA.h
similarity index 100%
rename from Tests/QtAutomoc/Adir/libA.h
rename to Tests/QtAutogen/Adir/libA.h
diff --git a/Tests/QtAutomoc/Bdir/CMakeLists.txt b/Tests/QtAutogen/Bdir/CMakeLists.txt
similarity index 100%
rename from Tests/QtAutomoc/Bdir/CMakeLists.txt
rename to Tests/QtAutogen/Bdir/CMakeLists.txt
diff --git a/Tests/QtAutomoc/Bdir/libB.cpp b/Tests/QtAutogen/Bdir/libB.cpp
similarity index 100%
rename from Tests/QtAutomoc/Bdir/libB.cpp
rename to Tests/QtAutogen/Bdir/libB.cpp
diff --git a/Tests/QtAutomoc/Bdir/libB.h b/Tests/QtAutogen/Bdir/libB.h
similarity index 100%
rename from Tests/QtAutomoc/Bdir/libB.h
rename to Tests/QtAutogen/Bdir/libB.h
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
similarity index 99%
rename from Tests/QtAutomoc/CMakeLists.txt
rename to Tests/QtAutogen/CMakeLists.txt
index 8ad693a..a7f553f 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.8)
 
-project(QtAutomoc)
+project(QtAutogen)
 
 if (QT_TEST_VERSION STREQUAL 4)
   find_package(Qt4 REQUIRED)
diff --git a/Tests/QtAutomoc/abc.cpp b/Tests/QtAutogen/abc.cpp
similarity index 100%
rename from Tests/QtAutomoc/abc.cpp
rename to Tests/QtAutogen/abc.cpp
diff --git a/Tests/QtAutomoc/abc.h b/Tests/QtAutogen/abc.h
similarity index 100%
rename from Tests/QtAutomoc/abc.h
rename to Tests/QtAutogen/abc.h
diff --git a/Tests/QtAutomoc/abc_p.h b/Tests/QtAutogen/abc_p.h
similarity index 100%
rename from Tests/QtAutomoc/abc_p.h
rename to Tests/QtAutogen/abc_p.h
diff --git a/Tests/QtAutomoc/bar.cpp b/Tests/QtAutogen/bar.cpp
similarity index 100%
rename from Tests/QtAutomoc/bar.cpp
rename to Tests/QtAutogen/bar.cpp
diff --git a/Tests/QtAutomoc/blub.cpp b/Tests/QtAutogen/blub.cpp
similarity index 100%
rename from Tests/QtAutomoc/blub.cpp
rename to Tests/QtAutogen/blub.cpp
diff --git a/Tests/QtAutomoc/blub.h b/Tests/QtAutogen/blub.h
similarity index 100%
rename from Tests/QtAutomoc/blub.h
rename to Tests/QtAutogen/blub.h
diff --git a/Tests/QtAutomoc/calwidget.cpp b/Tests/QtAutogen/calwidget.cpp
similarity index 100%
rename from Tests/QtAutomoc/calwidget.cpp
rename to Tests/QtAutogen/calwidget.cpp
diff --git a/Tests/QtAutomoc/calwidget.h b/Tests/QtAutogen/calwidget.h
similarity index 100%
rename from Tests/QtAutomoc/calwidget.h
rename to Tests/QtAutogen/calwidget.h
diff --git a/Tests/QtAutomoc/codeeditor.cpp b/Tests/QtAutogen/codeeditor.cpp
similarity index 100%
rename from Tests/QtAutomoc/codeeditor.cpp
rename to Tests/QtAutogen/codeeditor.cpp
diff --git a/Tests/QtAutomoc/codeeditor.h b/Tests/QtAutogen/codeeditor.h
similarity index 100%
rename from Tests/QtAutomoc/codeeditor.h
rename to Tests/QtAutogen/codeeditor.h
diff --git a/Tests/QtAutomoc/defines_test/CMakeLists.txt b/Tests/QtAutogen/defines_test/CMakeLists.txt
similarity index 100%
rename from Tests/QtAutomoc/defines_test/CMakeLists.txt
rename to Tests/QtAutogen/defines_test/CMakeLists.txt
diff --git a/Tests/QtAutomoc/defines_test/defines_test.cpp b/Tests/QtAutogen/defines_test/defines_test.cpp
similarity index 100%
rename from Tests/QtAutomoc/defines_test/defines_test.cpp
rename to Tests/QtAutogen/defines_test/defines_test.cpp
diff --git a/Tests/QtAutomoc/empty.cpp b/Tests/QtAutogen/empty.cpp
similarity index 100%
rename from Tests/QtAutomoc/empty.cpp
rename to Tests/QtAutogen/empty.cpp
diff --git a/Tests/QtAutomoc/empty.h b/Tests/QtAutogen/empty.h
similarity index 100%
rename from Tests/QtAutomoc/empty.h
rename to Tests/QtAutogen/empty.h
diff --git a/Tests/QtAutomoc/foo.cpp b/Tests/QtAutogen/foo.cpp
similarity index 100%
rename from Tests/QtAutomoc/foo.cpp
rename to Tests/QtAutogen/foo.cpp
diff --git a/Tests/QtAutomoc/foo.h b/Tests/QtAutogen/foo.h
similarity index 100%
rename from Tests/QtAutomoc/foo.h
rename to Tests/QtAutogen/foo.h
diff --git a/Tests/QtAutomoc/gadget.cpp b/Tests/QtAutogen/gadget.cpp
similarity index 100%
rename from Tests/QtAutomoc/gadget.cpp
rename to Tests/QtAutogen/gadget.cpp
diff --git a/Tests/QtAutomoc/gadget.h b/Tests/QtAutogen/gadget.h
similarity index 100%
rename from Tests/QtAutomoc/gadget.h
rename to Tests/QtAutogen/gadget.h
diff --git a/Tests/QtAutomoc/libC.cpp b/Tests/QtAutogen/libC.cpp
similarity index 100%
rename from Tests/QtAutomoc/libC.cpp
rename to Tests/QtAutogen/libC.cpp
diff --git a/Tests/QtAutomoc/libC.h b/Tests/QtAutogen/libC.h
similarity index 100%
rename from Tests/QtAutomoc/libC.h
rename to Tests/QtAutogen/libC.h
diff --git a/Tests/QtAutomoc/main.cpp b/Tests/QtAutogen/main.cpp
similarity index 100%
rename from Tests/QtAutomoc/main.cpp
rename to Tests/QtAutogen/main.cpp
diff --git a/Tests/QtAutomoc/private_slot.cpp b/Tests/QtAutogen/private_slot.cpp
similarity index 100%
rename from Tests/QtAutomoc/private_slot.cpp
rename to Tests/QtAutogen/private_slot.cpp
diff --git a/Tests/QtAutomoc/private_slot.h b/Tests/QtAutogen/private_slot.h
similarity index 100%
rename from Tests/QtAutomoc/private_slot.h
rename to Tests/QtAutogen/private_slot.h
diff --git a/Tests/QtAutomoc/sub/bar.h b/Tests/QtAutogen/sub/bar.h
similarity index 100%
rename from Tests/QtAutomoc/sub/bar.h
rename to Tests/QtAutogen/sub/bar.h
diff --git a/Tests/QtAutomoc/xyz.cpp b/Tests/QtAutogen/xyz.cpp
similarity index 100%
rename from Tests/QtAutomoc/xyz.cpp
rename to Tests/QtAutogen/xyz.cpp
diff --git a/Tests/QtAutomoc/xyz.h b/Tests/QtAutogen/xyz.h
similarity index 100%
rename from Tests/QtAutomoc/xyz.h
rename to Tests/QtAutogen/xyz.h
diff --git a/Tests/QtAutomoc/yaf.cpp b/Tests/QtAutogen/yaf.cpp
similarity index 100%
rename from Tests/QtAutomoc/yaf.cpp
rename to Tests/QtAutogen/yaf.cpp
diff --git a/Tests/QtAutomoc/yaf.h b/Tests/QtAutogen/yaf.h
similarity index 100%
rename from Tests/QtAutomoc/yaf.h
rename to Tests/QtAutogen/yaf.h
diff --git a/Tests/QtAutomoc/yaf_p.h b/Tests/QtAutogen/yaf_p.h
similarity index 100%
rename from Tests/QtAutomoc/yaf_p.h
rename to Tests/QtAutogen/yaf_p.h

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ce65c3c9738414213ae307005277c774daea669
commit 7ce65c3c9738414213ae307005277c774daea669
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 13:30:54 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:58 2013 +0200

    Add extra checks for the AUTOMOC target property.
    
    In an upcoming commit, this class will be used even if it is not set.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 4e75733..656bb0c 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -149,18 +149,22 @@ bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target)
     return false;
     }
 
-  std::string automocTargetName = target->GetName();
-  automocTargetName += "_automoc";
-  std::string mocCppFile = makefile->GetCurrentOutputDirectory();
-  mocCppFile += "/";
-  mocCppFile += automocTargetName;
-  mocCppFile += ".cpp";
-  cmSourceFile* mocCppSource = makefile->GetOrCreateSource(mocCppFile.c_str(),
-                                                         true);
-  makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
-                           mocCppFile.c_str(), false);
-
-  target->AddSourceFile(mocCppSource);
+  if (target->GetPropertyAsBool("AUTOMOC"))
+    {
+    std::string automocTargetName = target->GetName();
+    automocTargetName += "_automoc";
+    std::string mocCppFile = makefile->GetCurrentOutputDirectory();
+    mocCppFile += "/";
+    mocCppFile += automocTargetName;
+    mocCppFile += ".cpp";
+    cmSourceFile* mocCppSource = makefile->GetOrCreateSource(
+                                                          mocCppFile.c_str(),
+                                                          true);
+    makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
+                            mocCppFile.c_str(), false);
+
+    target->AddSourceFile(mocCppSource);
+    }
   return true;
 }
 
@@ -313,8 +317,11 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   std::map<std::string, std::string> configIncludes;
   std::map<std::string, std::string> configDefines;
 
-  this->SetupAutoMocTarget(target, autogenTargetName,
-                           configIncludes, configDefines);
+  if (target->GetPropertyAsBool("AUTOMOC"))
+    {
+    this->SetupAutoMocTarget(target, autogenTargetName,
+                             configIncludes, configDefines);
+    }
 
   const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
   std::string inputFile = cmakeRoot;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32771fc7ca959a90ef5e267831650323f3c0cf13
commit 32771fc7ca959a90ef5e267831650323f3c0cf13
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 13:28:48 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:58 2013 +0200

    Update output messages for generic use.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 4f67241..4e75733 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -753,7 +753,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     const std::string &absFilename = *it;
     if (this->Verbose)
       {
-      std::cout << "AUTOMOC: Checking " << absFilename << std::endl;
+      std::cout << "AUTOGEN: Checking " << absFilename << std::endl;
       }
     if (this->RelaxedMode)
       {
@@ -854,7 +854,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
   const std::string contentsString = this->ReadAll(absFilename);
   if (contentsString.empty())
     {
-    std::cerr << "AUTOMOC: warning: " << absFilename << ": file is empty\n"
+    std::cerr << "AUTOGEN: warning: " << absFilename << ": file is empty\n"
               << std::endl;
     return;
     }
@@ -914,7 +914,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
           }
         else
           {
-          std::cerr << "AUTOMOC: error: " << absFilename << " The file "
+          std::cerr << "AUTOGEN: error: " << absFilename << " The file "
                     << "includes the moc file \"" << currentMoc << "\", "
                     << "but could not find header \"" << basename
                     << '{' << this->Join(headerExtensions, ',') << "}\" ";
@@ -945,7 +945,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
             fileToMoc = headerToMoc;
             if ((requiresMoc==false) &&(basename==scannedFileBasename))
               {
-              std::cerr << "AUTOMOC: warning: " << absFilename << ": The file "
+              std::cerr << "AUTOGEN: warning: " << absFilename << ": The file "
                             "includes the moc file \"" << currentMoc <<
                             "\", but does not contain a " << macroName
                             << " macro. Running moc on "
@@ -956,7 +956,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
               }
             else
               {
-              std::cerr << "AUTOMOC: warning: " << absFilename << ": The file "
+              std::cerr << "AUTOGEN: warning: " << absFilename << ": The file "
                             "includes the moc file \"" << currentMoc <<
                             "\" instead of \"moc_" << basename << ".cpp\". "
                             "Running moc on "
@@ -968,7 +968,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
             }
           else
             {
-            std::cerr <<"AUTOMOC: error: " << absFilename << ": The file "
+            std::cerr <<"AUTOGEN: error: " << absFilename << ": The file "
                         "includes the moc file \"" << currentMoc <<
                         "\", which seems to be the moc file from a different "
                         "source file. CMake also could not find a matching "
@@ -996,7 +996,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
     if (mocUnderscoreIncluded == true)
       {
       // this is for KDE4 compatibility:
-      std::cerr << "AUTOMOC: warning: " << absFilename << ": The file "
+      std::cerr << "AUTOGEN: warning: " << absFilename << ": The file "
                 << "contains a " << macroName << " macro, but does not "
                 "include "
                 << "\"" << scannedFileBasename << ".moc\", but instead "
@@ -1012,7 +1012,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
     else
       {
       // otherwise always error out since it will not compile:
-      std::cerr << "AUTOMOC: error: " << absFilename << ": The file "
+      std::cerr << "AUTOGEN: error: " << absFilename << ": The file "
                 << "contains a " << macroName << " macro, but does not "
                 "include "
                 << "\"" << scannedFileBasename << ".moc\" !\n"
@@ -1035,7 +1035,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
   const std::string contentsString = this->ReadAll(absFilename);
   if (contentsString.empty())
     {
-    std::cerr << "AUTOMOC: warning: " << absFilename << ": file is empty\n"
+    std::cerr << "AUTOGEN: warning: " << absFilename << ": file is empty\n"
               << std::endl;
     return;
     }
@@ -1082,7 +1082,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
           }
         else
           {
-          std::cerr << "AUTOMOC: error: " << absFilename << " The file "
+          std::cerr << "AUTOGEN: error: " << absFilename << " The file "
                     << "includes the moc file \"" << currentMoc << "\", "
                     << "but could not find header \"" << basename
                     << '{' << this->Join(headerExtensions, ',') << "}\" ";
@@ -1103,7 +1103,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
         {
         if (basename != scannedFileBasename)
           {
-          std::cerr <<"AUTOMOC: error: " << absFilename << ": The file "
+          std::cerr <<"AUTOGEN: error: " << absFilename << ": The file "
                       "includes the moc file \"" << currentMoc <<
                       "\", which seems to be the moc file from a different "
                       "source file. This is not supported. "
@@ -1127,7 +1127,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
                                                      macroName)))
     {
     // otherwise always error out since it will not compile:
-    std::cerr << "AUTOMOC: error: " << absFilename << ": The file "
+    std::cerr << "AUTOGEN: error: " << absFilename << ": The file "
               << "contains a " << macroName << " macro, but does not include "
               << "\"" << scannedFileBasename << ".moc\" !\n"
               << std::endl;
@@ -1188,7 +1188,7 @@ void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
       {
       if (this->Verbose)
         {
-        std::cout << "AUTOMOC: Checking " << headerName << std::endl;
+        std::cout << "AUTOGEN: Checking " << headerName << std::endl;
         }
 
       const std::string basename = cmsys::SystemTools::
@@ -1274,7 +1274,7 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
     bool result = cmSystemTools::RunSingleCommand(command, &output, &retVal);
     if (!result || retVal)
       {
-      std::cerr << "AUTOMOC: error: process for " << mocFilePath <<" failed:\n"
+      std::cerr << "AUTOGEN: error: process for " << mocFilePath <<" failed:\n"
                 << output << std::endl;
       this->RunMocFailed = true;
       cmSystemTools::RemoveFile(mocFilePath.c_str());

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f371ab5803b3d675170f4b163701d707e56b47d9
commit f371ab5803b3d675170f4b163701d707e56b47d9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 13:28:08 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:58 2013 +0200

    Rename RunAutomoc to RunAutogen.
    
    It will soon be used to process ui and rcc files too.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 8d3de52..4f67241 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -492,7 +492,7 @@ bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
 
   if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5")
     {
-    success = this->RunAutomoc(makefile);
+    success = this->RunAutogen(makefile);
     }
 
   this->WriteOldMocDefinitionsFile(targetDirectory);
@@ -719,7 +719,7 @@ void cmQtAutoGenerators::Init()
 }
 
 
-bool cmQtAutoGenerators::RunAutomoc(cmMakefile* makefile)
+bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
 {
   if (!cmsys::SystemTools::FileExists(this->OutMocCppFilename.c_str())
     || (this->OldCompileSettingsStr != this->CurrentCompileSettingsStr))
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index ce70890..fe38b05 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -44,7 +44,7 @@ private:
 
   std::string MakeCompileSettingsString(cmMakefile* makefile);
 
-  bool RunAutomoc(cmMakefile* makefile);
+  bool RunAutogen(cmMakefile* makefile);
   bool GenerateMoc(const std::string& sourceFile,
                    const std::string& mocFileName);
   void ParseCppFile(const std::string& absFilename,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85b3d6e73d1d5620229c7fc67a705fd50c8bcff0
commit 85b3d6e73d1d5620229c7fc67a705fd50c8bcff0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 14:26:56 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:58 2013 +0200

    Extract an SetupAutoMocTarget method.
    
    This class will soon gain methods for autouic and autorcc.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 9016827..8d3de52 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -310,7 +310,61 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     target->AddUtility(autogenTargetName.c_str());
     }
 
-  // configure a file to get all information to automoc at buildtime:
+  std::map<std::string, std::string> configIncludes;
+  std::map<std::string, std::string> configDefines;
+
+  this->SetupAutoMocTarget(target, autogenTargetName,
+                           configIncludes, configDefines);
+
+  const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
+  std::string inputFile = cmakeRoot;
+  inputFile += "/Modules/AutogenInfo.cmake.in";
+  std::string outputFile = targetDir;
+  outputFile += "/AutogenInfo.cmake";
+  makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(),
+                          false, true, false);
+
+  if (!configDefines.empty() || !configIncludes.empty())
+    {
+    std::ofstream infoFile(outputFile.c_str(), std::ios::app);
+    if ( !infoFile )
+      {
+      std::string error = "Internal CMake error when trying to open file: ";
+      error += outputFile.c_str();
+      error += " for writing.";
+      cmSystemTools::Error(error.c_str());
+      return;
+      }
+    if (!configDefines.empty())
+      {
+      for (std::map<std::string, std::string>::iterator
+            it = configDefines.begin(), end = configDefines.end();
+            it != end; ++it)
+        {
+        infoFile << "set(AM_MOC_COMPILE_DEFINITIONS_" << it->first <<
+          " " << it->second << ")\n";
+        }
+      }
+    if (!configIncludes.empty())
+      {
+      for (std::map<std::string, std::string>::iterator
+            it = configIncludes.begin(), end = configIncludes.end();
+            it != end; ++it)
+        {
+        infoFile << "set(AM_MOC_INCLUDES_" << it->first <<
+          " " << it->second << ")\n";
+        }
+      }
+    }
+}
+
+void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
+                          const std::string &autogenTargetName,
+                          std::map<std::string, std::string> &configIncludes,
+                          std::map<std::string, std::string> &configDefines)
+{
+  cmMakefile* makefile = target->GetMakefile();
+
   std::string _moc_files;
   std::string _moc_headers;
   const char* sepFiles = "";
@@ -371,9 +425,6 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   makefile->AddDefinition("_moc_compile_defs",
           cmLocalGenerator::EscapeForCMake(_moc_compile_defs.c_str()).c_str());
 
-  std::map<std::string, std::string> configIncludes;
-  std::map<std::string, std::string> configDefines;
-
   for (std::vector<std::string>::const_iterator li = configs.begin();
        li != configs.end(); ++li)
     {
@@ -402,11 +453,10 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
       }
     }
 
-  {
   const char *qtMoc = makefile->GetSafeDefinition("QT_MOC_EXECUTABLE");
   makefile->AddDefinition("_qt_moc_executable", qtMoc);
-  }
 
+  const char *qtVersion = makefile->GetDefinition("_target_qt_version");
   if (strcmp(qtVersion, "5") == 0)
     {
     cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc");
@@ -426,50 +476,8 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
                           "Qt 5 ", autogenTargetName.c_str());
       }
     }
-
-  const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
-  std::string inputFile = cmakeRoot;
-  inputFile += "/Modules/AutogenInfo.cmake.in";
-  std::string outputFile = targetDir;
-  outputFile += "/AutogenInfo.cmake";
-  makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(),
-                          false, true, false);
-
-  if (!configDefines.empty() || !configIncludes.empty())
-    {
-    std::ofstream infoFile(outputFile.c_str(), std::ios::app);
-    if ( !infoFile )
-      {
-      std::string error = "Internal CMake error when trying to open file: ";
-      error += outputFile.c_str();
-      error += " for writing.";
-      cmSystemTools::Error(error.c_str());
-      return;
-      }
-    if (!configDefines.empty())
-      {
-      for (std::map<std::string, std::string>::iterator
-            it = configDefines.begin(), end = configDefines.end();
-            it != end; ++it)
-        {
-        infoFile << "set(AM_MOC_COMPILE_DEFINITIONS_" << it->first <<
-          " " << it->second << ")\n";
-        }
-      }
-    if (!configIncludes.empty())
-      {
-      for (std::map<std::string, std::string>::iterator
-            it = configIncludes.begin(), end = configIncludes.end();
-            it != end; ++it)
-        {
-        infoFile << "set(AM_MOC_INCLUDES_" << it->first <<
-          " " << it->second << ")\n";
-        }
-      }
-    }
 }
 
-
 bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
 {
   bool success = true;
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 68a2d27..ce70890 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -27,6 +27,11 @@ public:
   void SetupAutoGenerateTarget(cmTarget* target);
 
 private:
+  void SetupAutoMocTarget(cmTarget* target,
+                          const std::string &autogenTargetName,
+                          std::map<std::string, std::string> &configIncludes,
+                          std::map<std::string, std::string> &configDefines);
+
   cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
                                            const char* targetDirectory);
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca124a15150b5f88a9dcd9edfc4f61cf473efc64
commit ca124a15150b5f88a9dcd9edfc4f61cf473efc64
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 14:26:55 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:57 2013 +0200

    Rename the AutomocInfo.cmake file to be more generic.

diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutogenInfo.cmake.in
similarity index 100%
rename from Modules/AutomocInfo.cmake.in
rename to Modules/AutogenInfo.cmake.in
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 5fbdb83..9016827 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -429,9 +429,9 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
 
   const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
   std::string inputFile = cmakeRoot;
-  inputFile += "/Modules/AutomocInfo.cmake.in";
+  inputFile += "/Modules/AutogenInfo.cmake.in";
   std::string outputFile = targetDir;
-  outputFile += "/AutomocInfo.cmake";
+  outputFile += "/AutogenInfo.cmake";
   makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(),
                           false, true, false);
 
@@ -519,7 +519,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
 {
   std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
   cmSystemTools::ConvertToUnixSlashes(filename);
-  filename += "/AutomocInfo.cmake";
+  filename += "/AutogenInfo.cmake";
 
   if (!makefile->ReadListFile(0, filename.c_str()))
     {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a342c9ffedb865919b7a13b5620caecbb5076865
commit a342c9ffedb865919b7a13b5620caecbb5076865
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 14:26:54 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:57 2013 +0200

    Move some makefile definitions up away from moc-specific code.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 3d915dd..5fbdb83 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -206,10 +206,31 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   cmMakefile* makefile = target->GetMakefile();
   const char* targetName = target->GetName();
 
+  // forget the variables added here afterwards again:
+  cmMakefile::ScopePushPop varScope(makefile);
+  static_cast<void>(varScope);
+
+  const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
+  if (!qtVersion)
+    {
+    qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
+    }
+  if (const char *targetQtVersion =
+      target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0))
+    {
+    qtVersion = targetQtVersion;
+    }
+  if (qtVersion)
+    {
+    makefile->AddDefinition("_target_qt_version", qtVersion);
+    }
   // create a custom target for running generators at buildtime:
   std::string autogenTargetName = targetName;
   autogenTargetName += "_automoc";
 
+  makefile->AddDefinition("_moc_target_name",
+          cmLocalGenerator::EscapeForCMake(autogenTargetName.c_str()).c_str());
+
   std::string targetDir = makefile->GetCurrentOutputDirectory();
   targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
   targetDir += "/";
@@ -329,13 +350,6 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
 
   const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
   std::string _moc_options = (tmp!=0 ? tmp : "");
-
-  // forget the variables added here afterwards again:
-  cmMakefile::ScopePushPop varScope(makefile);
-  static_cast<void>(varScope);
-
-  makefile->AddDefinition("_moc_target_name",
-          cmLocalGenerator::EscapeForCMake(autogenTargetName.c_str()).c_str());
   makefile->AddDefinition("_moc_options",
           cmLocalGenerator::EscapeForCMake(_moc_options.c_str()).c_str());
   makefile->AddDefinition("_moc_files",
@@ -388,21 +402,6 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
       }
     }
 
-  const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
-  if (!qtVersion)
-    {
-    qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
-    }
-  if (const char *targetQtVersion =
-      target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0))
-    {
-    qtVersion = targetQtVersion;
-    }
-  if (qtVersion)
-    {
-    makefile->AddDefinition("_target_qt_version", qtVersion);
-    }
-
   {
   const char *qtMoc = makefile->GetSafeDefinition("QT_MOC_EXECUTABLE");
   makefile->AddDefinition("_qt_moc_executable", qtMoc);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98632effebc7ed59105a67c549989265a3b207f1
commit 98632effebc7ed59105a67c549989265a3b207f1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 14:26:53 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 11:50:47 2013 +0200

    Add the AUTOGEN_TARGETS_FOLDER and obsolete AUTOMOC_TARGETS_FOLDER.

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index bb3acff..c248085 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -10,6 +10,7 @@ Properties of Global Scope
 
 .. toctree::
    /prop_gbl/ALLOW_DUPLICATE_CUSTOM_TARGETS
+   /prop_gbl/AUTOGEN_TARGETS_FOLDER
    /prop_gbl/AUTOMOC_TARGETS_FOLDER
    /prop_gbl/DEBUG_CONFIGURATIONS
    /prop_gbl/DISABLED_FEATURES
diff --git a/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst b/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
similarity index 93%
copy from Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
copy to Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
index c83fb8b..48cc8a1 100644
--- a/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
+++ b/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
@@ -1,4 +1,4 @@
-AUTOMOC_TARGETS_FOLDER
+AUTOGEN_TARGETS_FOLDER
 ----------------------
 
 Name of FOLDER for ``*_automoc`` targets that are added automatically by CMake for targets for which AUTOMOC is enabled.
diff --git a/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst b/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
index c83fb8b..185e0ec 100644
--- a/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
+++ b/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
@@ -3,6 +3,8 @@ AUTOMOC_TARGETS_FOLDER
 
 Name of FOLDER for ``*_automoc`` targets that are added automatically by CMake for targets for which AUTOMOC is enabled.
 
+This property is obsolete.  Use AUTOGEN_TARGETS_FOLDER instead.
+
 If not set, CMake uses the FOLDER property of the parent target as a
 default value for this property.  See also the documentation for the
 FOLDER target property and the AUTOMOC target property.
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index b41ef75..3d915dd 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -269,11 +269,16 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
                                 workingDirectory.c_str(), depends,
                                 commandLines, false, autogenComment.c_str());
     // Set target folder
-    const char* automocFolder = makefile->GetCMakeInstance()->GetProperty(
+    const char* autogenFolder = makefile->GetCMakeInstance()->GetProperty(
                                                      "AUTOMOC_TARGETS_FOLDER");
-    if (automocFolder && *automocFolder)
+    if (!autogenFolder)
       {
-      autogenTarget->SetProperty("FOLDER", automocFolder);
+      autogenFolder = makefile->GetCMakeInstance()->GetProperty(
+                                                     "AUTOGEN_TARGETS_FOLDER");
+      }
+    if (autogenFolder && *autogenFolder)
+      {
+      autogenTarget->SetProperty("FOLDER", autogenFolder);
       }
     else
       {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63378baa1ceacbfdd52753e6dc7228ccfc53f4e5
commit 63378baa1ceacbfdd52753e6dc7228ccfc53f4e5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Oct 11 14:26:51 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 09:14:13 2013 +0200

    Rename some variables to reflect broader scope.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 391f7bb..b41ef75 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -206,7 +206,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   cmMakefile* makefile = target->GetMakefile();
   const char* targetName = target->GetName();
 
-  // create a custom target for running automoc at buildtime:
+  // create a custom target for running generators at buildtime:
   std::string autogenTargetName = targetName;
   autogenTargetName += "_automoc";
 
@@ -230,8 +230,9 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
                                     "", makefile->GetCurrentOutputDirectory());
 
   std::vector<std::string> depends;
-  std::string automocComment = "Automoc for target ";
-  automocComment += targetName;
+  std::string tools = "moc";
+  std::string autogenComment = "Automatic " + tools + " for target ";
+  autogenComment += targetName;
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
   bool usePRE_BUILD = false;
@@ -254,7 +255,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     // PRE_BUILD will work for an OBJECT_LIBRARY in this specific case.
     std::vector<std::string> no_output;
     cmCustomCommand cc(makefile, no_output, depends,
-                       commandLines, automocComment.c_str(),
+                       commandLines, autogenComment.c_str(),
                        workingDirectory.c_str());
     cc.SetEscapeOldStyle(false);
     cc.SetEscapeAllowMakeVars(true);
@@ -263,21 +264,21 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   else
 #endif
     {
-    cmTarget* automocTarget = makefile->AddUtilityCommand(
+    cmTarget* autogenTarget = makefile->AddUtilityCommand(
                                 autogenTargetName.c_str(), true,
                                 workingDirectory.c_str(), depends,
-                                commandLines, false, automocComment.c_str());
+                                commandLines, false, autogenComment.c_str());
     // Set target folder
     const char* automocFolder = makefile->GetCMakeInstance()->GetProperty(
                                                      "AUTOMOC_TARGETS_FOLDER");
     if (automocFolder && *automocFolder)
       {
-      automocTarget->SetProperty("FOLDER", automocFolder);
+      autogenTarget->SetProperty("FOLDER", automocFolder);
       }
     else
       {
       // inherit FOLDER property from target (#13688)
-      copyTargetProperty(automocTarget, target, "FOLDER");
+      copyTargetProperty(autogenTarget, target, "FOLDER");
       }
 
     target->AddUtility(autogenTargetName.c_str());

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97f1aa39da3e56ea4839e918f05928440d9d9dfa
commit 97f1aa39da3e56ea4839e918f05928440d9d9dfa
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 2 13:50:31 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 09:14:13 2013 +0200

    Rename method to reflect generic use.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 26e003f..391f7bb 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -472,7 +472,7 @@ bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
   cmGlobalGenerator* gg = this->CreateGlobalGenerator(&cm, targetDirectory);
   cmMakefile* makefile = gg->GetCurrentLocalGenerator()->GetMakefile();
 
-  this->ReadAutomocInfoFile(makefile, targetDirectory, config);
+  this->ReadAutogenInfoFile(makefile, targetDirectory, config);
   this->ReadOldMocDefinitionsFile(makefile, targetDirectory);
 
   this->Init();
@@ -508,7 +508,7 @@ cmGlobalGenerator* cmQtAutoGenerators::CreateGlobalGenerator(cmake* cm,
 }
 
 
-bool cmQtAutoGenerators::ReadAutomocInfoFile(cmMakefile* makefile,
+bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
                                       const char* targetDirectory,
                                       const char *config)
 {
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index ef38a5b..68a2d27 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -30,7 +30,7 @@ private:
   cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
                                            const char* targetDirectory);
 
-  bool ReadAutomocInfoFile(cmMakefile* makefile,
+  bool ReadAutogenInfoFile(cmMakefile* makefile,
                            const char* targetDirectory,
                            const char *config);
   bool ReadOldMocDefinitionsFile(cmMakefile* makefile,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4abb111584c4f0738cd2858cfa7d3adee5248a83
commit 4abb111584c4f0738cd2858cfa7d3adee5248a83
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 2 13:50:07 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 09:14:13 2013 +0200

    Rename local variable to reflect generic use.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 7e61772..26e003f 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -207,13 +207,13 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   const char* targetName = target->GetName();
 
   // create a custom target for running automoc at buildtime:
-  std::string automocTargetName = targetName;
-  automocTargetName += "_automoc";
+  std::string autogenTargetName = targetName;
+  autogenTargetName += "_automoc";
 
   std::string targetDir = makefile->GetCurrentOutputDirectory();
   targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
   targetDir += "/";
-  targetDir += automocTargetName;
+  targetDir += autogenTargetName;
   targetDir += ".dir/";
 
   cmCustomCommandLine currentLine;
@@ -264,7 +264,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
 #endif
     {
     cmTarget* automocTarget = makefile->AddUtilityCommand(
-                                automocTargetName.c_str(), true,
+                                autogenTargetName.c_str(), true,
                                 workingDirectory.c_str(), depends,
                                 commandLines, false, automocComment.c_str());
     // Set target folder
@@ -280,7 +280,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
       copyTargetProperty(automocTarget, target, "FOLDER");
       }
 
-    target->AddUtility(automocTargetName.c_str());
+    target->AddUtility(autogenTargetName.c_str());
     }
 
   // configure a file to get all information to automoc at buildtime:
@@ -329,7 +329,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   static_cast<void>(varScope);
 
   makefile->AddDefinition("_moc_target_name",
-          cmLocalGenerator::EscapeForCMake(automocTargetName.c_str()).c_str());
+          cmLocalGenerator::EscapeForCMake(autogenTargetName.c_str()).c_str());
   makefile->AddDefinition("_moc_options",
           cmLocalGenerator::EscapeForCMake(_moc_options.c_str()).c_str());
   makefile->AddDefinition("_moc_files",
@@ -408,7 +408,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     if (!qt5Moc)
       {
       cmSystemTools::Error("Qt5::moc target not found ",
-                          automocTargetName.c_str());
+                          autogenTargetName.c_str());
       return;
       }
     makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(0));
@@ -418,7 +418,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
     if (strcmp(qtVersion, "4") != 0)
       {
       cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and "
-                          "Qt 5 ", automocTargetName.c_str());
+                          "Qt 5 ", autogenTargetName.c_str());
       }
     }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03878c9a22719eb8e86025c3cb489af8fd47a250
commit 03878c9a22719eb8e86025c3cb489af8fd47a250
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 2 13:49:19 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 09:14:13 2013 +0200

    Move variable set to where it is used.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index ee30987..7e61772 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -206,8 +206,6 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   cmMakefile* makefile = target->GetMakefile();
   const char* targetName = target->GetName();
 
-  bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
-
   // create a custom target for running automoc at buildtime:
   std::string automocTargetName = targetName;
   automocTargetName += "_automoc";
@@ -338,6 +336,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
           cmLocalGenerator::EscapeForCMake(_moc_files.c_str()).c_str());
   makefile->AddDefinition("_moc_headers",
           cmLocalGenerator::EscapeForCMake(_moc_headers.c_str()).c_str());
+  bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
   makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
 
   std::string _moc_incs;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be23dcfeb1ef2d855bd24bb933ae7da4a6b4b9da
commit be23dcfeb1ef2d855bd24bb933ae7da4a6b4b9da
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 2 13:40:49 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 09:14:13 2013 +0200

    Rename the cmake_automoc command to cmake_autogen.
    
    There is no need for a "cmake_automoc" backward compatibility command
    because it is internal, undocumented, and only executed from a matching
    version of cmake.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 24f4498..ee30987 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -221,7 +221,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
   cmCustomCommandLine currentLine;
   currentLine.push_back(makefile->GetSafeDefinition("CMAKE_COMMAND"));
   currentLine.push_back("-E");
-  currentLine.push_back("cmake_automoc");
+  currentLine.push_back("cmake_autogen");
   currentLine.push_back(targetDir);
   currentLine.push_back("$<CONFIGURATION>");
 
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 79a3969..26251b3 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -632,7 +632,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
       {
       return cmcmd::ExecuteEchoColor(args);
       }
-    else if (args[1] == "cmake_automoc")
+    else if (args[1] == "cmake_autogen")
       {
         cmQtAutoGenerators autogen;
         const char *config = args[3].empty() ? 0 : args[3].c_str();

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52d5d4e9154644597630ed844a254dfb8de524dd
commit 52d5d4e9154644597630ed844a254dfb8de524dd
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 2 13:39:50 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 09:14:12 2013 +0200

    Rename the cmQtAutoGenerator instances to reflect coming features.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f92fe60..386af6d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1209,8 +1209,8 @@ bool cmGlobalGenerator::CheckTargets()
 void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
-  typedef std::vector<std::pair<cmQtAutoGenerators, cmTarget*> > Automocs;
-  Automocs automocs;
+  typedef std::vector<std::pair<cmQtAutoGenerators, cmTarget*> > Autogens;
+  Autogens autogens;
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
     cmTargets& targets =
@@ -1227,16 +1227,16 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
         {
         if(target.GetPropertyAsBool("AUTOMOC") && !target.IsImported())
           {
-          cmQtAutoGenerators automoc;
-          if(automoc.InitializeMocSourceFile(&target))
+          cmQtAutoGenerators autogen;
+          if(autogen.InitializeMocSourceFile(&target))
             {
-            automocs.push_back(std::make_pair(automoc, &target));
+            autogens.push_back(std::make_pair(autogen, &target));
             }
           }
         }
       }
     }
-  for (Automocs::iterator it = automocs.begin(); it != automocs.end();
+  for (Autogens::iterator it = autogens.begin(); it != autogens.end();
        ++it)
     {
     it->first.SetupAutoGenerateTarget(it->second);
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 2fba5dc..79a3969 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -634,10 +634,10 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
       }
     else if (args[1] == "cmake_automoc")
       {
-        cmQtAutoGenerators automoc;
+        cmQtAutoGenerators autogen;
         const char *config = args[3].empty() ? 0 : args[3].c_str();
-        bool automocSuccess = automoc.Run(args[2].c_str(), config);
-        return automocSuccess ? 0 : 1;
+        bool autogenSuccess = autogen.Run(args[2].c_str(), config);
+        return autogenSuccess ? 0 : 1;
       }
 #endif
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c058c8f12742dcb96b2e22b43208f345a865fbf
commit 5c058c8f12742dcb96b2e22b43208f345a865fbf
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Sep 24 20:07:45 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 24 09:14:12 2013 +0200

    Rename the cmQtAutomoc class to cmQtAutoGenerators.
    
    It will be extended to process .ui and .qrc files too.

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 01e4f88..e13a304 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -250,8 +250,8 @@ set(SRCS
   cmPropertyDefinitionMap.h
   cmPropertyMap.cxx
   cmPropertyMap.h
-  cmQtAutomoc.cxx
-  cmQtAutomoc.h
+  cmQtAutoGenerators.cxx
+  cmQtAutoGenerators.h
   cmRST.cxx
   cmRST.h
   cmScriptGenerator.h
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index fb205be..f92fe60 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -18,7 +18,7 @@
 #include "cmExternalMakefileProjectGenerator.h"
 #include "cmake.h"
 #include "cmMakefile.h"
-#include "cmQtAutomoc.h"
+#include "cmQtAutoGenerators.h"
 #include "cmSourceFile.h"
 #include "cmVersion.h"
 #include "cmTargetExport.h"
@@ -1049,8 +1049,8 @@ void cmGlobalGenerator::Generate()
     }
 
   // Iterate through all targets and set up automoc for those which have
-  // the AUTOMOC property set
-  this->CreateAutomocTargets();
+  // the AUTOMOC, AUTOUIC or AUTORCC property set
+  this->CreateQtAutoGeneratorsTargets();
 
   // For each existing cmLocalGenerator
   unsigned int i;
@@ -1206,10 +1206,10 @@ bool cmGlobalGenerator::CheckTargets()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateAutomocTargets()
+void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
-  typedef std::vector<std::pair<cmQtAutomoc, cmTarget*> > Automocs;
+  typedef std::vector<std::pair<cmQtAutoGenerators, cmTarget*> > Automocs;
   Automocs automocs;
   for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
     {
@@ -1227,7 +1227,7 @@ void cmGlobalGenerator::CreateAutomocTargets()
         {
         if(target.GetPropertyAsBool("AUTOMOC") && !target.IsImported())
           {
-          cmQtAutomoc automoc;
+          cmQtAutoGenerators automoc;
           if(automoc.InitializeMocSourceFile(&target))
             {
             automocs.push_back(std::make_pair(automoc, &target));
@@ -1239,7 +1239,7 @@ void cmGlobalGenerator::CreateAutomocTargets()
   for (Automocs::iterator it = automocs.begin(); it != automocs.end();
        ++it)
     {
-    it->first.SetupAutomocTarget(it->second);
+    it->first.SetupAutoGenerateTarget(it->second);
     }
 #endif
 }
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index c930b2b..773da38 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -319,7 +319,7 @@ protected:
   virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
 
   bool CheckTargets();
-  void CreateAutomocTargets();
+  void CreateQtAutoGeneratorsTargets();
 
 
   // Fill the ProjectMap, this must be called after LocalGenerators
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutoGenerators.cxx
similarity index 96%
rename from Source/cmQtAutomoc.cxx
rename to Source/cmQtAutoGenerators.cxx
index 651e0ad..24f4498 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -29,7 +29,7 @@
 #include <unistd.h>
 #endif
 
-#include "cmQtAutomoc.h"
+#include "cmQtAutoGenerators.h"
 
 
 static bool requiresMocing(const std::string& text, std::string &macroName)
@@ -113,7 +113,7 @@ static void copyTargetProperty(cmTarget* destinationTarget,
 }
 
 
-cmQtAutomoc::cmQtAutomoc()
+cmQtAutoGenerators::cmQtAutoGenerators()
 :Verbose(cmsys::SystemTools::GetEnv("VERBOSE") != 0)
 ,ColorOutput(true)
 ,RunMocFailed(false)
@@ -135,7 +135,7 @@ cmQtAutomoc::cmQtAutomoc()
     }
 }
 
-bool cmQtAutomoc::InitializeMocSourceFile(cmTarget* target)
+bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target)
 {
   cmMakefile* makefile = target->GetMakefile();
   // don't do anything if there is no Qt4 or Qt5Core (which contains moc):
@@ -201,7 +201,7 @@ static void GetCompileDefinitionsAndDirectories(cmTarget *target,
     }
 }
 
-void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
+void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
 {
   cmMakefile* makefile = target->GetMakefile();
   const char* targetName = target->GetName();
@@ -466,7 +466,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
 }
 
 
-bool cmQtAutomoc::Run(const char* targetDirectory, const char *config)
+bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
 {
   bool success = true;
   cmake cm;
@@ -492,7 +492,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory, const char *config)
 }
 
 
-cmGlobalGenerator* cmQtAutomoc::CreateGlobalGenerator(cmake* cm,
+cmGlobalGenerator* cmQtAutoGenerators::CreateGlobalGenerator(cmake* cm,
                                                   const char* targetDirectory)
 {
   cmGlobalGenerator* gg = new cmGlobalGenerator();
@@ -509,7 +509,7 @@ cmGlobalGenerator* cmQtAutomoc::CreateGlobalGenerator(cmake* cm,
 }
 
 
-bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
+bool cmQtAutoGenerators::ReadAutomocInfoFile(cmMakefile* makefile,
                                       const char* targetDirectory,
                                       const char *config)
 {
@@ -569,7 +569,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
 }
 
 
-std::string cmQtAutomoc::MakeCompileSettingsString(cmMakefile* makefile)
+std::string cmQtAutoGenerators::MakeCompileSettingsString(cmMakefile* makefile)
 {
   std::string s;
   s += makefile->GetSafeDefinition("AM_MOC_COMPILE_DEFINITIONS");
@@ -586,7 +586,7 @@ std::string cmQtAutomoc::MakeCompileSettingsString(cmMakefile* makefile)
 }
 
 
-bool cmQtAutomoc::ReadOldMocDefinitionsFile(cmMakefile* makefile,
+bool cmQtAutoGenerators::ReadOldMocDefinitionsFile(cmMakefile* makefile,
                                             const char* targetDirectory)
 {
   std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
@@ -602,7 +602,8 @@ bool cmQtAutomoc::ReadOldMocDefinitionsFile(cmMakefile* makefile,
 }
 
 
-void cmQtAutomoc::WriteOldMocDefinitionsFile(const char* targetDirectory)
+void
+cmQtAutoGenerators::WriteOldMocDefinitionsFile(const char* targetDirectory)
 {
   std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
   cmSystemTools::ConvertToUnixSlashes(filename);
@@ -619,7 +620,7 @@ void cmQtAutomoc::WriteOldMocDefinitionsFile(const char* targetDirectory)
 }
 
 
-void cmQtAutomoc::Init()
+void cmQtAutoGenerators::Init()
 {
   this->OutMocCppFilename = this->Builddir;
   this->OutMocCppFilename += this->TargetName;
@@ -706,7 +707,7 @@ void cmQtAutomoc::Init()
 }
 
 
-bool cmQtAutomoc::RunAutomoc(cmMakefile* makefile)
+bool cmQtAutoGenerators::RunAutomoc(cmMakefile* makefile)
 {
   if (!cmsys::SystemTools::FileExists(this->OutMocCppFilename.c_str())
     || (this->OldCompileSettingsStr != this->CurrentCompileSettingsStr))
@@ -830,7 +831,7 @@ bool cmQtAutomoc::RunAutomoc(cmMakefile* makefile)
 }
 
 
-void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
+void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
                               std::map<std::string, std::string>& includedMocs)
 {
@@ -1011,7 +1012,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
 }
 
 
-void cmQtAutomoc::StrictParseCppFile(const std::string& absFilename,
+void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
                               std::map<std::string, std::string>& includedMocs)
 {
@@ -1124,7 +1125,8 @@ void cmQtAutomoc::StrictParseCppFile(const std::string& absFilename,
 }
 
 
-void cmQtAutomoc::SearchHeadersForCppFile(const std::string& absFilename,
+void
+cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
                               std::set<std::string>& absHeaders)
 {
@@ -1160,7 +1162,7 @@ void cmQtAutomoc::SearchHeadersForCppFile(const std::string& absFilename,
 }
 
 
-void cmQtAutomoc::ParseHeaders(const std::set<std::string>& absHeaders,
+void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
                         const std::map<std::string, std::string>& includedMocs,
                         std::map<std::string, std::string>& notIncludedMocs)
 {
@@ -1194,7 +1196,7 @@ void cmQtAutomoc::ParseHeaders(const std::set<std::string>& absHeaders,
 }
 
 
-bool cmQtAutomoc::GenerateMoc(const std::string& sourceFile,
+bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
                               const std::string& mocFileName)
 {
   const std::string mocFilePath = this->Builddir + mocFileName;
@@ -1271,7 +1273,7 @@ bool cmQtAutomoc::GenerateMoc(const std::string& sourceFile,
 }
 
 
-std::string cmQtAutomoc::Join(const std::vector<std::string>& lst,
+std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst,
                               char separator)
 {
     if (lst.empty())
@@ -1291,13 +1293,15 @@ std::string cmQtAutomoc::Join(const std::vector<std::string>& lst,
 }
 
 
-bool cmQtAutomoc::StartsWith(const std::string& str, const std::string& with)
+bool cmQtAutoGenerators::StartsWith(const std::string& str,
+                                    const std::string& with)
 {
   return (str.substr(0, with.length()) == with);
 }
 
 
-bool cmQtAutomoc::EndsWith(const std::string& str, const std::string& with)
+bool cmQtAutoGenerators::EndsWith(const std::string& str,
+                                  const std::string& with)
 {
   if (with.length() > (str.length()))
     {
@@ -1307,7 +1311,7 @@ bool cmQtAutomoc::EndsWith(const std::string& str, const std::string& with)
 }
 
 
-std::string cmQtAutomoc::ReadAll(const std::string& filename)
+std::string cmQtAutoGenerators::ReadAll(const std::string& filename)
 {
   std::ifstream file(filename.c_str());
   cmsys_ios::stringstream stream;
diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutoGenerators.h
similarity index 95%
rename from Source/cmQtAutomoc.h
rename to Source/cmQtAutoGenerators.h
index ebeeb0e..ef38a5b 100644
--- a/Source/cmQtAutomoc.h
+++ b/Source/cmQtAutoGenerators.h
@@ -11,20 +11,20 @@
   See the License for more information.
 ============================================================================*/
 
-#ifndef cmQtAutomoc_h
-#define cmQtAutomoc_h
+#ifndef cmQtAutoGenerators_h
+#define cmQtAutoGenerators_h
 
 class cmGlobalGenerator;
 class cmMakefile;
 
-class cmQtAutomoc
+class cmQtAutoGenerators
 {
 public:
-  cmQtAutomoc();
+  cmQtAutoGenerators();
   bool Run(const char* targetDirectory, const char *config);
 
   bool InitializeMocSourceFile(cmTarget* target);
-  void SetupAutomocTarget(cmTarget* target);
+  void SetupAutoGenerateTarget(cmTarget* target);
 
 private:
   cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 9814aea..2fba5dc 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -13,7 +13,7 @@
 #include "cmMakefile.h"
 #include "cmLocalGenerator.h"
 #include "cmGlobalGenerator.h"
-#include "cmQtAutomoc.h"
+#include "cmQtAutoGenerators.h"
 #include "cmVersion.h"
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -634,7 +634,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
       }
     else if (args[1] == "cmake_automoc")
       {
-        cmQtAutomoc automoc;
+        cmQtAutoGenerators automoc;
         const char *config = args[3].empty() ? 0 : args[3].c_str();
         bool automocSuccess = automoc.Run(args[2].c_str(), config);
         return automocSuccess ? 0 : 1;

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

Summary of changes:
 Help/manual/cmake-properties.7.rst                 |    7 +
 Help/manual/cmake-variables.7.rst                  |    4 +
 Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst           |    8 +
 Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst           |    2 +
 Help/prop_sf/AUTORCC_OPTIONS.rst                   |   14 +
 Help/prop_sf/AUTOUIC_OPTIONS.rst                   |   14 +
 Help/prop_tgt/AUTORCC.rst                          |   21 +
 Help/prop_tgt/AUTORCC_OPTIONS.rst                  |   17 +
 Help/prop_tgt/AUTOUIC.rst                          |   22 +
 Help/prop_tgt/AUTOUIC_OPTIONS.rst                  |   17 +
 Help/variable/CMAKE_AUTORCC.rst                    |    7 +
 Help/variable/CMAKE_AUTORCC_OPTIONS.rst            |    7 +
 Help/variable/CMAKE_AUTOUIC.rst                    |    7 +
 Help/variable/CMAKE_AUTOUIC_OPTIONS.rst            |    7 +
 Modules/AutogenInfo.cmake.in                       |   24 +
 Modules/AutomocInfo.cmake.in                       |   14 -
 Source/CMakeLists.txt                              |    4 +-
 Source/CMakeVersion.cmake                          |    2 +-
 Source/cmGlobalGenerator.cxx                       |   27 +-
 Source/cmGlobalGenerator.h                         |    2 +-
 Source/cmMakefile.cxx                              |   12 +
 Source/cmMakefile.h                                |    5 +
 Source/cmQtAutoGenerators.cxx                      | 2008 ++++++++++++++++++++
 Source/cmQtAutoGenerators.h                        |  131 ++
 Source/cmQtAutomoc.cxx                             | 1317 -------------
 Source/cmQtAutomoc.h                               |   96 -
 Source/cmSourceFile.cxx                            |   11 +
 Source/cmTarget.cxx                                |    4 +
 Source/cmcmd.cxx                                   |   10 +-
 Tests/CMakeLists.txt                               |   37 +-
 Tests/{QtAutomoc => QtAutogen}/Adir/CMakeLists.txt |    0
 Tests/{QtAutomoc => QtAutogen}/Adir/libA.cpp       |    0
 Tests/{QtAutomoc => QtAutogen}/Adir/libA.h         |    0
 Tests/{QtAutomoc => QtAutogen}/Bdir/CMakeLists.txt |    0
 Tests/{QtAutomoc => QtAutogen}/Bdir/libB.cpp       |    0
 Tests/{QtAutomoc => QtAutogen}/Bdir/libB.h         |    0
 Tests/QtAutogen/CMakeLists.txt                     |   73 +
 Tests/{QtAutomoc => QtAutogen}/abc.cpp             |    0
 Tests/{QtAutomoc => QtAutogen}/abc.h               |    0
 Tests/{QtAutomoc => QtAutogen}/abc_p.h             |    0
 Tests/{QtAutomoc => QtAutogen}/bar.cpp             |    0
 Tests/{QtAutomoc => QtAutogen}/blub.cpp            |    0
 Tests/{QtAutomoc => QtAutogen}/blub.h              |    0
 Tests/QtAutogen/calwidget.cpp                      |  434 +++++
 Tests/QtAutogen/calwidget.h                        |  128 ++
 Tests/QtAutogen/calwidget.ui                       |   32 +
 Tests/{QtAutomoc => QtAutogen}/codeeditor.cpp      |    0
 Tests/{QtAutomoc => QtAutogen}/codeeditor.h        |    0
 .../defines_test/CMakeLists.txt                    |    0
 .../defines_test/defines_test.cpp                  |    0
 Tests/{QtAutomoc => QtAutogen}/empty.cpp           |    0
 Tests/{QtAutomoc => QtAutogen}/empty.h             |    0
 Tests/{QtAutomoc => QtAutogen}/foo.cpp             |    0
 Tests/{QtAutomoc => QtAutogen}/foo.h               |    0
 Tests/{QtAutomoc => QtAutogen}/gadget.cpp          |    0
 Tests/{QtAutomoc => QtAutogen}/gadget.h            |    0
 Tests/{QtAutomoc => QtAutogen}/libC.cpp            |    0
 Tests/{QtAutomoc => QtAutogen}/libC.h              |    0
 Tests/QtAutogen/main.cpp                           |   85 +
 Tests/{QtAutomoc => QtAutogen}/private_slot.cpp    |    0
 Tests/{QtAutomoc => QtAutogen}/private_slot.h      |    0
 Tests/QtAutogen/resourcetester.cpp                 |   21 +
 Tests/QtAutogen/resourcetester.h                   |   17 +
 Tests/{QtAutomoc => QtAutogen}/sub/bar.h           |    0
 Tests/QtAutogen/test.qrc                           |    5 +
 Tests/{QtAutomoc => QtAutogen}/xyz.cpp             |    0
 Tests/{QtAutomoc => QtAutogen}/xyz.h               |    0
 Tests/{QtAutomoc => QtAutogen}/yaf.cpp             |    0
 Tests/{QtAutomoc => QtAutogen}/yaf.h               |    0
 Tests/{QtAutomoc => QtAutogen}/yaf_p.h             |    0
 Tests/QtAutomoc/CMakeLists.txt                     |   68 -
 Tests/QtAutomoc/calwidget.cpp                      |  431 -----
 Tests/QtAutomoc/calwidget.h                        |  121 --
 Tests/QtAutomoc/main.cpp                           |   86 -
 74 files changed, 3191 insertions(+), 2168 deletions(-)
 create mode 100644 Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
 create mode 100644 Help/prop_sf/AUTORCC_OPTIONS.rst
 create mode 100644 Help/prop_sf/AUTOUIC_OPTIONS.rst
 create mode 100644 Help/prop_tgt/AUTORCC.rst
 create mode 100644 Help/prop_tgt/AUTORCC_OPTIONS.rst
 create mode 100644 Help/prop_tgt/AUTOUIC.rst
 create mode 100644 Help/prop_tgt/AUTOUIC_OPTIONS.rst
 create mode 100644 Help/variable/CMAKE_AUTORCC.rst
 create mode 100644 Help/variable/CMAKE_AUTORCC_OPTIONS.rst
 create mode 100644 Help/variable/CMAKE_AUTOUIC.rst
 create mode 100644 Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
 create mode 100644 Modules/AutogenInfo.cmake.in
 delete mode 100644 Modules/AutomocInfo.cmake.in
 create mode 100644 Source/cmQtAutoGenerators.cxx
 create mode 100644 Source/cmQtAutoGenerators.h
 delete mode 100644 Source/cmQtAutomoc.cxx
 delete mode 100644 Source/cmQtAutomoc.h
 rename Tests/{QtAutomoc => QtAutogen}/Adir/CMakeLists.txt (100%)
 rename Tests/{QtAutomoc => QtAutogen}/Adir/libA.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/Adir/libA.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/Bdir/CMakeLists.txt (100%)
 rename Tests/{QtAutomoc => QtAutogen}/Bdir/libB.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/Bdir/libB.h (100%)
 create mode 100644 Tests/QtAutogen/CMakeLists.txt
 rename Tests/{QtAutomoc => QtAutogen}/abc.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/abc.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/abc_p.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/bar.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/blub.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/blub.h (100%)
 create mode 100644 Tests/QtAutogen/calwidget.cpp
 create mode 100644 Tests/QtAutogen/calwidget.h
 create mode 100644 Tests/QtAutogen/calwidget.ui
 rename Tests/{QtAutomoc => QtAutogen}/codeeditor.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/codeeditor.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/defines_test/CMakeLists.txt (100%)
 rename Tests/{QtAutomoc => QtAutogen}/defines_test/defines_test.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/empty.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/empty.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/foo.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/foo.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/gadget.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/gadget.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/libC.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/libC.h (100%)
 create mode 100644 Tests/QtAutogen/main.cpp
 rename Tests/{QtAutomoc => QtAutogen}/private_slot.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/private_slot.h (100%)
 create mode 100644 Tests/QtAutogen/resourcetester.cpp
 create mode 100644 Tests/QtAutogen/resourcetester.h
 rename Tests/{QtAutomoc => QtAutogen}/sub/bar.h (100%)
 create mode 100644 Tests/QtAutogen/test.qrc
 rename Tests/{QtAutomoc => QtAutogen}/xyz.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/xyz.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/yaf.cpp (100%)
 rename Tests/{QtAutomoc => QtAutogen}/yaf.h (100%)
 rename Tests/{QtAutomoc => QtAutogen}/yaf_p.h (100%)
 delete mode 100644 Tests/QtAutomoc/CMakeLists.txt
 delete mode 100644 Tests/QtAutomoc/calwidget.cpp
 delete mode 100644 Tests/QtAutomoc/calwidget.h
 delete mode 100644 Tests/QtAutomoc/main.cpp


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list