summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-22 13:13:01 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-09-22 13:13:01 (GMT)
commite6f0bb7b1577923b6252370a6c8dd2db202dece7 (patch)
tree3076cd22c65c6903b745b37201dd2b915f5bd5a6 /Tests
parentd8dde37d609fd0badfa4c9d13c927c2d2ed27902 (diff)
parente3c97a1914aa0a521b55b53ab1b0d71732c5e466 (diff)
downloadCMake-e6f0bb7b1577923b6252370a6c8dd2db202dece7.zip
CMake-e6f0bb7b1577923b6252370a6c8dd2db202dece7.tar.gz
CMake-e6f0bb7b1577923b6252370a6c8dd2db202dece7.tar.bz2
Merge topic 'autogen-fixes'
e3c97a19 QtAutogen: Process all ui files in a source file (#14981). b8877b1d QtAutogen: Add source files to target when only AUTORCC is used.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/multiplewidgets.cpp19
-rw-r--r--Tests/QtAutogen/multiplewidgets.h33
-rw-r--r--Tests/QtAutogen/rcconly.cpp9
-rw-r--r--Tests/QtAutogen/widget1.ui45
-rw-r--r--Tests/QtAutogen/widget2.ui29
6 files changed, 139 insertions, 0 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 3973653..3fd00b8 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})
@@ -71,6 +74,7 @@ if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_
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 ${debug_srcs}
)
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/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;
+}
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>