[Cmake-commits] CMake branch, next, updated. v3.0.2-5358-ge1dc2e3

Stephen Kelly steveire at gmail.com
Wed Sep 17 08:51:09 EDT 2014


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  e1dc2e3050c1c61489ccff85479d03f81a98c084 (commit)
       via  7bddcf337c145819774be52456e6c5c30756c002 (commit)
       via  b8877b1d62599bba7a014e95fbbd670f177243ce (commit)
      from  240356877edd2ec55024b51bd0b862fcef002ee1 (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=e1dc2e3050c1c61489ccff85479d03f81a98c084
commit e1dc2e3050c1c61489ccff85479d03f81a98c084
Merge: 2403568 7bddcf3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Sep 17 08:51:07 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Sep 17 08:51:07 2014 -0400

    Merge topic 'autogen-fixes' into next
    
    7bddcf33 QtAutogen: Process all ui files in a source file (#14981).
    b8877b1d QtAutogen: Add source files to target when only AUTORCC is used.

diff --cc Tests/QtAutogen/CMakeLists.txt
index 3973653,f1a272a..3fd00b8
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@@ -64,15 -67,10 +67,16 @@@ add_custom_command
    DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in"
  )
  
 +message("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
 +if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_TYPES)
 +  set(debug_srcs "$<$<CONFIG:Debug>:debug_class.cpp>" $<$<CONFIG:Debug>:debug_resource.qrc>)
 +  add_definitions(-DTEST_DEBUG_CLASS)
 +endif()
 +
  add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
+                multiplewidgets.cpp
                 xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
 -               test.qrc second_resource.qrc resourcetester.cpp generated.cpp
 +               test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs}
  )
  set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h")
  

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bddcf337c145819774be52456e6c5c30756c002
commit 7bddcf337c145819774be52456e6c5c30756c002
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Sep 17 01:23:57 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Sep 17 14:51:03 2014 +0200

    QtAutogen: Process all ui files in a source file (#14981).
    
    Use a vector to store a list of matched ui_ includes, instead of
    overwriting the previous match.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 4b8f810..9c5d846 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1296,8 +1296,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
   const std::vector<std::string>& headerExtensions =
                                                makefile->GetHeaderExtensions();
 
-  std::map<std::string, std::string> includedUis;
-  std::map<std::string, std::string> skippedUis;
+  std::map<std::string, std::vector<std::string> > includedUis;
+  std::map<std::string, std::vector<std::string> > skippedUis;
   std::vector<std::string> uicSkipped;
   cmSystemTools::ExpandListArgument(this->SkipUic, uicSkipped);
 
@@ -1307,7 +1307,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     {
     const bool skipUic = std::find(uicSkipped.begin(), uicSkipped.end(), *it)
         != uicSkipped.end();
-    std::map<std::string, std::string>& uiFiles
+    std::map<std::string, std::vector<std::string> >& uiFiles
                                           = skipUic ? skippedUis : includedUis;
     const std::string &absFilename = *it;
     if (this->Verbose)
@@ -1368,12 +1368,17 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     {
     this->GenerateMoc(it->first, it->second);
     }
-  for(std::map<std::string, std::string>::const_iterator
+  for(std::map<std::string, std::vector<std::string> >::const_iterator
       it = includedUis.begin();
       it != includedUis.end();
       ++it)
     {
-    this->GenerateUi(it->first, it->second);
+    for (std::vector<std::string>::const_iterator nit = it->second.begin();
+        nit != it->second.end();
+        ++nit)
+      {
+      this->GenerateUi(it->first, *nit);
+      }
     }
 
   if(!this->RccExecutable.empty())
@@ -1450,7 +1455,7 @@ 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> &includedUis)
+                              std::map<std::string, std::vector<std::string> > &includedUis)
 {
   cmsys::RegularExpression mocIncludeRegExp(
               "[\n][ \t]*#[ \t]*include[ \t]+"
@@ -1638,7 +1643,7 @@ 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>& includedUis)
+                              std::map<std::string, std::vector<std::string> >& includedUis)
 {
   cmsys::RegularExpression mocIncludeRegExp(
               "[\n][ \t]*#[ \t]*include[ \t]+"
@@ -1756,7 +1761,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
 
 
 void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
-                              std::map<std::string, std::string>& includedUis)
+                              std::map<std::string, std::vector<std::string> >& includedUis)
 {
   if (this->UicExecutable.empty())
     {
@@ -1775,7 +1780,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
 
 void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
                                      const std::string& contentsString,
-                              std::map<std::string, std::string>& includedUis)
+                              std::map<std::string, std::vector<std::string> >& includedUis)
 {
   if (this->UicExecutable.empty())
     {
@@ -1805,7 +1810,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
       // finding the correct header, so we need to remove the ui_ part
       basename = basename.substr(3);
 
-      includedUis[realName] = basename;
+      includedUis[realName].push_back(basename);
 
       matchOffset += uiIncludeRegExp.end();
       } while(uiIncludeRegExp.find(contentsString.c_str() + matchOffset));
@@ -1853,7 +1858,7 @@ 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>& includedUis)
+                        std::map<std::string, std::vector<std::string> >& includedUis)
 {
   for(std::set<std::string>::const_iterator hIt=absHeaders.begin();
       hIt!=absHeaders.end();
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 9ddf64f..8778b33 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -53,11 +53,11 @@ private:
   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>& includedUis);
+                          std::map<std::string, 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>& includedUis);
+                          std::map<std::string, std::vector<std::string> >& includedUis);
   void SearchHeadersForCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
                               std::set<std::string>& absHeaders);
@@ -65,14 +65,14 @@ private:
   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>& includedUis);
+                          std::map<std::string, std::vector<std::string> >& includedUis);
 
   void ParseForUic(const std::string& fileName,
                    const std::string& contentsString,
-                   std::map<std::string, std::string>& includedUis);
+                   std::map<std::string, std::vector<std::string> >& includedUis);
 
   void ParseForUic(const std::string& fileName,
-                   std::map<std::string, std::string>& includedUis);
+                   std::map<std::string, std::vector<std::string> >& includedUis);
 
   void Init();
 
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index f9aa309..f1a272a 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -68,6 +68,7 @@ add_custom_command(
 )
 
 add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
+               multiplewidgets.cpp
                xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
                test.qrc second_resource.qrc resourcetester.cpp generated.cpp
 )
diff --git a/Tests/QtAutogen/multiplewidgets.cpp b/Tests/QtAutogen/multiplewidgets.cpp
new file mode 100644
index 0000000..f143875
--- /dev/null
+++ b/Tests/QtAutogen/multiplewidgets.cpp
@@ -0,0 +1,19 @@
+
+#include "multiplewidgets.h"
+
+#include "ui_widget1.h"
+#include "ui_widget2.h"
+
+Widget1::Widget1(QWidget *parent)
+  : QWidget(parent),
+    ui(new Ui::Widget1)
+{
+  ui->setupUi(this);
+}
+
+Widget2::Widget2(QWidget *parent)
+  : QWidget(parent),
+    ui(new Ui::Widget2)
+{
+  ui->setupUi(this);
+}
diff --git a/Tests/QtAutogen/multiplewidgets.h b/Tests/QtAutogen/multiplewidgets.h
new file mode 100644
index 0000000..6ae6ad1
--- /dev/null
+++ b/Tests/QtAutogen/multiplewidgets.h
@@ -0,0 +1,33 @@
+
+#ifndef MULTIPLEWIDGETS_H
+#define MULTIPLEWIDGETS_H
+
+#include <QWidget>
+
+namespace Ui {
+class Widget1;
+}
+
+class Widget1 : public QWidget
+{
+  Q_OBJECT
+public:
+  Widget1(QWidget *parent = 0);
+private:
+  Ui::Widget1 *ui;
+};
+
+namespace Ui {
+class Widget2;
+}
+
+class Widget2 : public QWidget
+{
+  Q_OBJECT
+public:
+  Widget2(QWidget *parent = 0);
+private:
+  Ui::Widget2 *ui;
+};
+
+#endif
diff --git a/Tests/QtAutogen/widget1.ui b/Tests/QtAutogen/widget1.ui
new file mode 100644
index 0000000..8fce81a
--- /dev/null
+++ b/Tests/QtAutogen/widget1.ui
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Widget1</class>
+ <widget class="QWidget" name="Widget1">
+  <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>140</x>
+     <y>80</y>
+     <width>80</width>
+     <height>23</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>PushButton</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_2">
+   <property name="geometry">
+    <rect>
+     <x>190</x>
+     <y>170</y>
+     <width>80</width>
+     <height>23</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>PushButton</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/widget2.ui b/Tests/QtAutogen/widget2.ui
new file mode 100644
index 0000000..1f411b9
--- /dev/null
+++ b/Tests/QtAutogen/widget2.ui
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Widget2</class>
+ <widget class="QWidget" name="Widget1">
+  <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="QListWidget" name="listWidget">
+   <property name="geometry">
+    <rect>
+     <x>20</x>
+     <y>20</y>
+     <width>256</width>
+     <height>192</height>
+    </rect>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8877b1d62599bba7a014e95fbbd670f177243ce
commit b8877b1d62599bba7a014e95fbbd670f177243ce
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Sep 10 16:20:43 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Sep 17 14:39:42 2014 +0200

    QtAutogen: Add source files to target when only AUTORCC is used.
    
    Add missing entry to if condition.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a8bb317..4b8f810 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -392,7 +392,8 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target)
   std::map<std::string, std::string> configUicOptions;
 
   if (target->GetPropertyAsBool("AUTOMOC")
-      || target->GetPropertyAsBool("AUTOUIC"))
+      || target->GetPropertyAsBool("AUTOUIC")
+      || target->GetPropertyAsBool("AUTORCC"))
     {
     this->SetupSourceFiles(target);
     }
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index d2116aa..f9aa309 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -37,6 +37,9 @@ else()
 
 endif()
 
+add_executable(rcconly rcconly.cpp second_resource.qrc)
+set_property(TARGET rcconly PROPERTY AUTORCC ON)
+target_link_libraries(rcconly ${QT_QTCORE_TARGET})
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
diff --git a/Tests/QtAutogen/rcconly.cpp b/Tests/QtAutogen/rcconly.cpp
new file mode 100644
index 0000000..854c4c1
--- /dev/null
+++ b/Tests/QtAutogen/rcconly.cpp
@@ -0,0 +1,9 @@
+
+extern int qInitResources_second_resource();
+
+int main(int, char**)
+{
+  // Fails to link if the symbol is not present.
+  qInitResources_second_resource();
+  return 0;
+}

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

Summary of changes:
 Source/cmQtAutoGenerators.cxx                    |   30 ++++++++++++--------
 Source/cmQtAutoGenerators.h                      |   10 +++----
 Tests/QtAutogen/CMakeLists.txt                   |    4 +++
 Tests/QtAutogen/multiplewidgets.cpp              |   19 +++++++++++++
 Tests/QtAutogen/multiplewidgets.h                |   33 ++++++++++++++++++++++
 Tests/QtAutogen/rcconly.cpp                      |    9 ++++++
 Tests/QtAutogen/{debug_class.ui => widget1.ui}   |   28 +++++++++---------
 Tests/QtAutogen/{second_widget.ui => widget2.ui} |   15 ++++------
 8 files changed, 108 insertions(+), 40 deletions(-)
 create mode 100644 Tests/QtAutogen/multiplewidgets.cpp
 create mode 100644 Tests/QtAutogen/multiplewidgets.h
 create mode 100644 Tests/QtAutogen/rcconly.cpp
 copy Tests/QtAutogen/{debug_class.ui => widget1.ui} (64%)
 copy Tests/QtAutogen/{second_widget.ui => widget2.ui} (61%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list