[Cmake-commits] CMake branch, next, updated. v3.0.0-rc2-1438-g6da1f94

Stephen Kelly steveire at gmail.com
Mon Mar 24 20:32:00 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  6da1f941dc80d28bc3cec0ecad399bdff7388fe6 (commit)
       via  baae7b916046a4ee45c7abe1c92dab40c29734e1 (commit)
       via  261acd91093ba5f2bf79f38a9632887ab2dd5f1c (commit)
      from  169eb36490d93a84594a617bc607d31915006d06 (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=6da1f941dc80d28bc3cec0ecad399bdff7388fe6
commit 6da1f941dc80d28bc3cec0ecad399bdff7388fe6
Merge: 169eb36 baae7b9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Mar 24 20:31:58 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Mar 24 20:31:58 2014 -0400

    Merge topic 'fix-Qt-Autogen' into next
    
    baae7b91 QtAutogen: Fix use of multiple ui files in a single target.
    261acd91 QtAutogen: Use the basename for resource files.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=baae7b916046a4ee45c7abe1c92dab40c29734e1
commit baae7b916046a4ee45c7abe1c92dab40c29734e1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Mar 25 01:26:27 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Mar 25 01:30:17 2014 +0100

    QtAutogen: Fix use of multiple ui files in a single target.
    
    Don't store a mapping of the directory to the ui file. The directory
    will be a unique key, allowing only one ui file to be specified.
    Use the source file name instead as the mapping key.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index fcc898a..463a55c 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1786,8 +1786,8 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
 
   std::string::size_type matchOffset = 0;
 
-  const std::string absPath = cmsys::SystemTools::GetFilenamePath(
-                   cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/';
+  const std::string realName =
+                   cmsys::SystemTools::GetRealPath(absFilename.c_str());
 
   matchOffset = 0;
   if ((strstr(contentsString.c_str(), "ui_") != NULL)
@@ -1804,7 +1804,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[absPath] = basename;
+      includedUis[realName] = basename;
 
       matchOffset += uiIncludeRegExp.end();
       } while(uiIncludeRegExp.find(contentsString.c_str() + matchOffset));
@@ -1960,7 +1960,7 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
   return false;
 }
 
-bool cmQtAutoGenerators::GenerateUi(const std::string& path,
+bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
                                     const std::string& uiFileName)
 {
   if (!cmsys::SystemTools::FileExists(this->Builddir.c_str(), false))
@@ -1968,6 +1968,9 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& path,
     cmsys::SystemTools::MakeDirectory(this->Builddir.c_str());
     }
 
+  const std::string path = cmsys::SystemTools::GetFilenamePath(
+                   cmsys::SystemTools::GetRealPath(realName.c_str())) + '/';
+
   std::string ui_output_file = "ui_" + uiFileName + ".h";
   std::string ui_input_file = path + uiFileName + ".ui";
 
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 2840fbf..9ddf64f 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -48,7 +48,7 @@ private:
   bool RunAutogen(cmMakefile* makefile);
   bool GenerateMoc(const std::string& sourceFile,
                    const std::string& mocFileName);
-  bool GenerateUi(const std::string& path, const std::string& uiFileName);
+  bool GenerateUi(const std::string& realName, const std::string& uiFileName);
   bool GenerateQrc();
   void ParseCppFile(const std::string& absFilename,
                     const std::vector<std::string>& headerExtensions,
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index cf80f41..d2116aa 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -64,7 +64,7 @@ add_custom_command(
   DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in"
 )
 
-add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
+add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
                xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
                test.qrc second_resource.qrc resourcetester.cpp generated.cpp
 )
diff --git a/Tests/QtAutogen/second_widget.cpp b/Tests/QtAutogen/second_widget.cpp
new file mode 100644
index 0000000..65ba962
--- /dev/null
+++ b/Tests/QtAutogen/second_widget.cpp
@@ -0,0 +1,14 @@
+
+#include "second_widget.h"
+#include "ui_second_widget.h"
+
+SecondWidget::SecondWidget(QWidget *parent)
+  : QWidget(parent), ui(new Ui::SecondWidget)
+{
+  ui->setupUi(this);
+}
+
+SecondWidget::~SecondWidget()
+{
+  delete ui;
+}
diff --git a/Tests/QtAutogen/second_widget.h b/Tests/QtAutogen/second_widget.h
new file mode 100644
index 0000000..fe4d175
--- /dev/null
+++ b/Tests/QtAutogen/second_widget.h
@@ -0,0 +1,19 @@
+
+#include <QWidget>
+
+namespace Ui
+{
+class SecondWidget;
+}
+
+class SecondWidget : public QWidget
+{
+  Q_OBJECT
+public:
+  explicit SecondWidget(QWidget *parent = 0);
+
+  ~SecondWidget();
+
+private:
+  Ui::SecondWidget* ui;
+};
diff --git a/Tests/QtAutogen/second_widget.ui b/Tests/QtAutogen/second_widget.ui
new file mode 100644
index 0000000..4effa58
--- /dev/null
+++ b/Tests/QtAutogen/second_widget.ui
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SecondWidget</class>
+ <widget class="QWidget" name="SecondWidget">
+  <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>80</x>
+     <y>20</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=261acd91093ba5f2bf79f38a9632887ab2dd5f1c
commit 261acd91093ba5f2bf79f38a9632887ab2dd5f1c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Mar 25 01:16:49 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Mar 25 01:16:49 2014 +0100

    QtAutogen: Use the basename for resource files.
    
    The rcc tool generates a cpp file with a symbol called qInitResources
    or called qInitResources_${name}, if the name is passed. The
    qInitResources symbol clashes if multiple qrc files are used in
    one target.
    
    Always pass the name to ensure that the symbol is unique. This is also
    the behavior of the qtx_add_resource macros.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 2c5dd45..fcc898a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -2074,6 +2074,8 @@ bool cmQtAutoGenerators::GenerateQrc()
           }
         }
 
+      command.push_back("-name");
+      command.push_back(basename);
       command.push_back("-o");
       command.push_back(rcc_output_file);
       command.push_back(*si);
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 0821b45..cf80f41 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -66,7 +66,7 @@ add_custom_command(
 
 add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
                xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
-               test.qrc resourcetester.cpp generated.cpp
+               test.qrc second_resource.qrc resourcetester.cpp generated.cpp
 )
 set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h")
 
diff --git a/Tests/QtAutogen/resourcetester.cpp b/Tests/QtAutogen/resourcetester.cpp
index 43314e1..0c64d80 100644
--- a/Tests/QtAutogen/resourcetester.cpp
+++ b/Tests/QtAutogen/resourcetester.cpp
@@ -16,6 +16,8 @@ void ResourceTester::doTest()
 {
   if (!QFile::exists(":/CMakeLists.txt"))
       qApp->exit(EXIT_FAILURE);
+  if (!QFile::exists(":/main.cpp"))
+      qApp->exit(EXIT_FAILURE);
 
   QTimer::singleShot(0, qApp, SLOT(quit()));
 }
diff --git a/Tests/QtAutogen/second_resource.qrc b/Tests/QtAutogen/second_resource.qrc
new file mode 100644
index 0000000..27bfb14
--- /dev/null
+++ b/Tests/QtAutogen/second_resource.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+    <file>main.cpp</file>
+</qresource>
+</RCC>

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

Summary of changes:
 Source/cmQtAutoGenerators.cxx                       |   13 +++++++++----
 Source/cmQtAutoGenerators.h                         |    2 +-
 Tests/QtAutogen/CMakeLists.txt                      |    4 ++--
 Tests/QtAutogen/resourcetester.cpp                  |    2 ++
 .../{not_generated_file.qrc => second_resource.qrc} |    2 +-
 Tests/QtAutogen/second_widget.cpp                   |   14 ++++++++++++++
 Tests/QtAutogen/second_widget.h                     |   19 +++++++++++++++++++
 Tests/QtAutogen/{calwidget.ui => second_widget.ui}  |    8 ++++----
 8 files changed, 52 insertions(+), 12 deletions(-)
 copy Tests/QtAutogen/{not_generated_file.qrc => second_resource.qrc} (71%)
 create mode 100644 Tests/QtAutogen/second_widget.cpp
 create mode 100644 Tests/QtAutogen/second_widget.h
 copy Tests/QtAutogen/{calwidget.ui => second_widget.ui} (84%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list