summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen/RccOffMocLibrary
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-12-08 17:03:20 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-12-13 12:48:28 (GMT)
commitf658bdaa7c7899a46caf402d4114999019897d46 (patch)
tree8f329910864515efcd551ebe05b532a84e823859 /Tests/QtAutogen/RccOffMocLibrary
parentf00e6c7c7024a784d2da310ba7b5f4a67e60fdff (diff)
downloadCMake-f658bdaa7c7899a46caf402d4114999019897d46.zip
CMake-f658bdaa7c7899a46caf402d4114999019897d46.tar.gz
CMake-f658bdaa7c7899a46caf402d4114999019897d46.tar.bz2
Autogen: Tests: Separate RccOffMocLibrary test
Diffstat (limited to 'Tests/QtAutogen/RccOffMocLibrary')
-rw-r--r--Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt17
-rw-r--r--Tests/QtAutogen/RccOffMocLibrary/empty.cpp1
-rw-r--r--Tests/QtAutogen/RccOffMocLibrary/empty.h9
-rw-r--r--Tests/QtAutogen/RccOffMocLibrary/not_generated_file.qrc5
4 files changed, 32 insertions, 0 deletions
diff --git a/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt
new file mode 100644
index 0000000..7f7432e
--- /dev/null
+++ b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.10)
+project(RccOffMocLibrary)
+include("../AutogenTest.cmake")
+
+# Add not_generated_file.qrc to the source list to get the file-level
+# dependency, but don't generate a c++ file from it. Disable the AUTORCC
+# feature for this target. This tests that qrc files in the sources don't
+# have an effect on generation if AUTORCC is off.
+add_library(empty STATIC empty.cpp not_generated_file.qrc)
+set_target_properties(empty PROPERTIES AUTORCC OFF)
+set_target_properties(empty PROPERTIES AUTOMOC TRUE)
+target_link_libraries(empty no_link_language)
+add_library(no_link_language STATIC empty.h)
+set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE)
+# Pass Qt compiler features to targets that don't link against Qt
+target_compile_features(no_link_language PRIVATE ${QT_COMPILE_FEATURES})
+target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES})
diff --git a/Tests/QtAutogen/RccOffMocLibrary/empty.cpp b/Tests/QtAutogen/RccOffMocLibrary/empty.cpp
new file mode 100644
index 0000000..ab32cf6
--- /dev/null
+++ b/Tests/QtAutogen/RccOffMocLibrary/empty.cpp
@@ -0,0 +1 @@
+// No content
diff --git a/Tests/QtAutogen/RccOffMocLibrary/empty.h b/Tests/QtAutogen/RccOffMocLibrary/empty.h
new file mode 100644
index 0000000..6bdd2ac
--- /dev/null
+++ b/Tests/QtAutogen/RccOffMocLibrary/empty.h
@@ -0,0 +1,9 @@
+
+#include <QObject>
+
+class Empty : public QObject
+{
+ Q_OBJECT
+public:
+ explicit Empty(QObject* parent = 0) {}
+};
diff --git a/Tests/QtAutogen/RccOffMocLibrary/not_generated_file.qrc b/Tests/QtAutogen/RccOffMocLibrary/not_generated_file.qrc
new file mode 100644
index 0000000..c769834
--- /dev/null
+++ b/Tests/QtAutogen/RccOffMocLibrary/not_generated_file.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>abc.cpp</file>
+</qresource>
+</RCC>