summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2016-12-31 09:25:38 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-01-10 11:49:16 (GMT)
commit8dbdd3e726ead25c179e6eb4ffab212a1db3aba8 (patch)
tree25955cdfe99ed04ed2ceaa62d5bc074533b2dfe1 /Tests/QtAutogen
parent0699760d5c8b644242ddd4ac6d07d8c4c68f2b94 (diff)
downloadCMake-8dbdd3e726ead25c179e6eb4ffab212a1db3aba8.zip
CMake-8dbdd3e726ead25c179e6eb4ffab212a1db3aba8.tar.gz
CMake-8dbdd3e726ead25c179e6eb4ffab212a1db3aba8.tar.bz2
AUTOGEN: Tests: AUTOMOC SKIP_AUTOMOC and SKIP_AUTOGEN test
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt22
-rw-r--r--Tests/QtAutogen/skipMoc.cpp14
-rw-r--r--Tests/QtAutogen/skipSource/qItemA.cpp5
-rw-r--r--Tests/QtAutogen/skipSource/qItemA.hpp13
-rw-r--r--Tests/QtAutogen/skipSource/qItemB.cpp5
-rw-r--r--Tests/QtAutogen/skipSource/qItemB.hpp13
-rw-r--r--Tests/QtAutogen/skipSource/qItemC.cpp5
-rw-r--r--Tests/QtAutogen/skipSource/qItemC.hpp13
8 files changed, 90 insertions, 0 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 6d4e2c4..068b037 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -139,6 +139,28 @@ if (automoc_rerun_result)
message(SEND_ERROR "Second build of automoc_rerun failed.")
endif()
+# -- Test: AUTOMOC, SKIP_AUTOMOC
+# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
+qtx_wrap_cpp(skipMocWrapMoc
+ skipSource/qItemA.hpp
+ skipSource/qItemB.hpp)
+set(skipMocSources
+ skipMoc.cpp
+ skipSource/qItemA.cpp
+ skipSource/qItemB.cpp
+ skipSource/qItemC.cpp)
+set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
+set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
+# AUTOMOC enabled only
+add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
+set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
+target_link_libraries(skipMocA ${QT_LIBRARIES})
+# AUTOMOC and AUTOUIC enabled
+add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc})
+set_property(TARGET skipMocB PROPERTY AUTOMOC ON)
+set_property(TARGET skipMocB PROPERTY AUTOUIC ON)
+target_link_libraries(skipMocB ${QT_LIBRARIES})
+
# -- Test: AUTOMOC AUTORCC
# Source files with the same basename in different subdirectories
add_subdirectory(sameName)
diff --git a/Tests/QtAutogen/skipMoc.cpp b/Tests/QtAutogen/skipMoc.cpp
new file mode 100644
index 0000000..85305f5
--- /dev/null
+++ b/Tests/QtAutogen/skipMoc.cpp
@@ -0,0 +1,14 @@
+
+#include "skipSource/qItemA.hpp"
+#include "skipSource/qItemB.hpp"
+#include "skipSource/qItemC.hpp"
+
+int main(int, char**)
+{
+ QItemA itemA;
+ QItemA itemB;
+ QItemA itemC;
+
+ // Fails to link if the symbol is not present.
+ return 0;
+}
diff --git a/Tests/QtAutogen/skipSource/qItemA.cpp b/Tests/QtAutogen/skipSource/qItemA.cpp
new file mode 100644
index 0000000..522c2c7
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemA.cpp
@@ -0,0 +1,5 @@
+#include "qItemA.hpp"
+
+void QItemA::go()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/qItemA.hpp b/Tests/QtAutogen/skipSource/qItemA.hpp
new file mode 100644
index 0000000..d295faf
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemA.hpp
@@ -0,0 +1,13 @@
+#ifndef QITEMA_HPP
+#define QITEMA_HPP
+
+#include <QObject>
+
+class QItemA : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/qItemB.cpp b/Tests/QtAutogen/skipSource/qItemB.cpp
new file mode 100644
index 0000000..636e15d
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemB.cpp
@@ -0,0 +1,5 @@
+#include "qItemB.hpp"
+
+void QItemB::go()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/qItemB.hpp b/Tests/QtAutogen/skipSource/qItemB.hpp
new file mode 100644
index 0000000..1775915
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemB.hpp
@@ -0,0 +1,13 @@
+#ifndef QITEMB_HPP
+#define QITEMB_HPP
+
+#include <QObject>
+
+class QItemB : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/skipSource/qItemC.cpp b/Tests/QtAutogen/skipSource/qItemC.cpp
new file mode 100644
index 0000000..700abd6
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemC.cpp
@@ -0,0 +1,5 @@
+#include "qItemC.hpp"
+
+void QItemC::go()
+{
+}
diff --git a/Tests/QtAutogen/skipSource/qItemC.hpp b/Tests/QtAutogen/skipSource/qItemC.hpp
new file mode 100644
index 0000000..f06bda2
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemC.hpp
@@ -0,0 +1,13 @@
+#ifndef QITEMC_HPP
+#define QITEMC_HPP
+
+#include <QObject>
+
+class QItemC : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif