summaryrefslogtreecommitdiff
path: root/Tests/QtAutogen
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-02-13 17:25:00 +0100
committerStephen Kelly <steveire@gmail.com>2014-04-02 23:14:02 +0200
commite6971df6ab647031ba9689c9afbbde78cc62e35f (patch)
treec9c67c6e3a1627d65cda8ee93373b97403c92106 /Tests/QtAutogen
parentdf753df94bb1e995372baabb0240585560c72ded (diff)
downloadcmake-e6971df6ab647031ba9689c9afbbde78cc62e35f.tar.gz
cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with the Visual Studio and Xcode generators. They don't have any way to represent the condition currently. Use the same common-config API in cmQtAutoGenerators. While it accepts config-specific files, it doesn't have to support multiple configurations yet. Loop over the configs in cmTargetTraceDependencies and cmGlobalGenerator::WriteSummary and consume all source files. Loop over the configs in cmComputeTargetDepends and compute the object library dependencies for each config.
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt8
-rw-r--r--Tests/QtAutogen/debug_class.cpp9
-rw-r--r--Tests/QtAutogen/debug_class.h20
-rw-r--r--Tests/QtAutogen/debug_class.ui45
-rw-r--r--Tests/QtAutogen/debug_resource.qrc5
-rw-r--r--Tests/QtAutogen/main.cpp9
-rw-r--r--Tests/QtAutogen/resourcetester.cpp4
7 files changed, 99 insertions, 1 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index d2116aa929..39736539b2 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -64,9 +64,15 @@ 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
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")
diff --git a/Tests/QtAutogen/debug_class.cpp b/Tests/QtAutogen/debug_class.cpp
new file mode 100644
index 0000000000..58e72e46cc
--- /dev/null
+++ b/Tests/QtAutogen/debug_class.cpp
@@ -0,0 +1,9 @@
+
+#include "debug_class.h"
+#include "ui_debug_class.h"
+
+DebugClass::DebugClass(QWidget *parent)
+ : QWidget(parent), ui(new Ui::DebugClass)
+{
+ ui->setupUi(this);
+}
diff --git a/Tests/QtAutogen/debug_class.h b/Tests/QtAutogen/debug_class.h
new file mode 100644
index 0000000000..71bc1045a4
--- /dev/null
+++ b/Tests/QtAutogen/debug_class.h
@@ -0,0 +1,20 @@
+
+#include <QWidget>
+
+namespace Ui
+{
+class DebugClass;
+}
+
+class DebugClass : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit DebugClass(QWidget *parent = 0);
+
+signals:
+ void someSignal();
+
+private:
+ Ui::DebugClass *ui;
+};
diff --git a/Tests/QtAutogen/debug_class.ui b/Tests/QtAutogen/debug_class.ui
new file mode 100644
index 0000000000..dc2e1ac189
--- /dev/null
+++ b/Tests/QtAutogen/debug_class.ui
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DebugClass</class>
+ <widget class="QWidget" name="DebugClass">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>DebugClass</string>
+ </property>
+ <widget class="QCheckBox" name="checkBox">
+ <property name="geometry">
+ <rect>
+ <x>50</x>
+ <y>20</y>
+ <width>82</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>CheckBox</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>40</x>
+ <y>70</y>
+ <width>94</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/debug_resource.qrc b/Tests/QtAutogen/debug_resource.qrc
new file mode 100644
index 0000000000..db98b9bc1e
--- /dev/null
+++ b/Tests/QtAutogen/debug_resource.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>debug_class.ui</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/main.cpp b/Tests/QtAutogen/main.cpp
index c8a036e2b8..eb596650e5 100644
--- a/Tests/QtAutogen/main.cpp
+++ b/Tests/QtAutogen/main.cpp
@@ -51,6 +51,11 @@
#include "yaf.h"
#include "libC.h"
#include "resourcetester.h"
+#ifdef TEST_DEBUG_CLASS
+#include "debug_class.h"
+#include <iostream>
+#endif
+
int main(int argv, char **args)
{
@@ -81,5 +86,9 @@ int main(int argv, char **args)
QTimer::singleShot(0, &rt, SLOT(doTest()));
+#ifdef TEST_DEBUG_CLASS
+ std::cout << DebugClass::staticMetaObject.className() << std::endl;
+#endif
+
return app.exec();
}
diff --git a/Tests/QtAutogen/resourcetester.cpp b/Tests/QtAutogen/resourcetester.cpp
index 0c64d80af9..043ec75fc3 100644
--- a/Tests/QtAutogen/resourcetester.cpp
+++ b/Tests/QtAutogen/resourcetester.cpp
@@ -18,6 +18,10 @@ void ResourceTester::doTest()
qApp->exit(EXIT_FAILURE);
if (!QFile::exists(":/main.cpp"))
qApp->exit(EXIT_FAILURE);
+#ifdef TEST_DEBUG_CLASS
+ if (!QFile::exists(":/debug_class.ui"))
+ qApp->exit(EXIT_FAILURE);
+#endif
QTimer::singleShot(0, qApp, SLOT(quit()));
}