aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/testlib/CMakeLists.txt
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-09-03 13:25:05 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-09-19 08:06:24 +0000
commitec57196980e6a32fce3c56ec3c9f8183c7bcaad1 (patch)
treee416385c724ca5ca07ae57e5c8c77ec58e79f0a1 /src/imports/testlib/CMakeLists.txt
parent92025df4a52a2cf82e9a538968a8969cac08554c (diff)
Add qt6_add_qml_module() public API
Add qt6_add_qml_module() as a public API for building QML modules. Since the shared implementation details are small, it was easier to just reimplement the shared code than to unmangle the more complicated version we use to build Qt from QtBuild. This patch includes an example conversion. Changes for pro2cmake will follow in a separate patch in qtbase. Change-Id: I942526cc7d978e2d8309b506e785f9c1509d0bbc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/imports/testlib/CMakeLists.txt')
-rw-r--r--src/imports/testlib/CMakeLists.txt44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/imports/testlib/CMakeLists.txt b/src/imports/testlib/CMakeLists.txt
index 89dd13ca0a..bbff88e788 100644
--- a/src/imports/testlib/CMakeLists.txt
+++ b/src/imports/testlib/CMakeLists.txt
@@ -5,9 +5,11 @@
#####################################################################
add_qml_module(qmltestplugin
- CPP_PLUGIN
URI "QtTest"
VERSION "1.${CMAKE_PROJECT_VERSION_MINOR}"
+ CLASSNAME QTestQmlModule
+ DEPENDENCIES
+ QtQuick.Window/2.0
SOURCES
main.cpp
LIBRARIES
@@ -23,24 +25,34 @@ add_qml_module(qmltestplugin
Qt::Test
)
+#### Keys ignored in scope 1:.:.:testlib.pro:<TRUE>:
+# CXX_MODULE = "qml"
+# IMPORT_VERSION = "1.$$QT_MINOR_VERSION"
+# OTHER_FILES = "testlib.json"
+# QML_FILES = "TestCase.qml" "SignalSpy.qml" "testlogger.js"
+# TARGETPATH = "QtTest"
+# _LOADED = "qml_plugin"
+
set(qml_files
- TestCase.qml
- SignalSpy.qml
- testlogger.js
+ "TestCase.qml"
+ "SignalSpy.qml"
+ "testlogger.js"
+)
+set_source_files_properties(TestCase.qml PROPERTIES
+ QT_QML_SOURCE_VERSION "1.2"
+ QT_QML_SOURCE_INSTALL TRUE
+)
+set_source_files_properties(SignalSpy.qml PROPERTIES
+ QT_QML_SOURCE_VERSION "1.0"
+ QT_QML_SOURCE_INSTALL TRUE
+)
+# special case begin
+set_source_files_properties(testlogger.js PROPERTIES
+ QT_QML_SOURCE_INSTALL TRUE
)
+# special case end
-add_qt_resource(qmltestplugin qmake_QtTest
+qt6_target_qml_files(qmltestplugin
FILES
${qml_files}
)
-
-qt_install_qml_files(qmltestplugin
- FILES ${qml_files}
-)
-
-
-#### Keys ignored in scope 1:.:.:testlib.pro:<TRUE>:
-# CXX_MODULE = "qml"
-# IMPORT_VERSION = "1.$$QT_MINOR_VERSION"
-# OTHER_FILES = "testlib.json"
-# _LOADED = "qml_plugin"