aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlimportscanner/Qt5QmlImportScannerTemplate.cpp.in
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-07-16 15:07:51 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-08-17 12:03:45 +0200
commit527687a866d1a155314c1b6d4b8a09533cf8211a (patch)
tree6959a67af694f5e286d1de7a164b32b35035d69e /tools/qmlimportscanner/Qt5QmlImportScannerTemplate.cpp.in
parent412be2096cea12ca480cbbd419f3531a41dac3ae (diff)
CMake: Provide API to allow handling of QML static plugins
This change adds a new -cmake-output command line argument to qmlimportscanner which outputs its result in a format which is consumable by CMake. This change also adds a new CMake package called Qt5QmlImportScanner. It provides a function called QT5_IMPORT_QML_PLUGINS() which is useful for projects that use a static build of Qt and which also use QML plugins. Calling it with the target name of your application does the following: - Runs qmlimportscanner at configure time to find out which QML / QtQuick plugins are used by your project - Links the imported QML plugins into the target - Links the static dependencies of the QML plugins into the target - Generates a .cpp file that initializes imported QML plugins, which is subsequently compiled and linked into the given target When Qt is built in a shared library config, the introduced function is a no-op. [ChangeLog][CMake] Added ability to import static qml plugins with CMake builds using the new QT5_IMPORT_QML_PLUGINS function. Task-number: QTBUG-38913 Change-Id: Ib9b9a69654eab13dfbe12d10f5cb28ba3c307d1b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools/qmlimportscanner/Qt5QmlImportScannerTemplate.cpp.in')
-rw-r--r--tools/qmlimportscanner/Qt5QmlImportScannerTemplate.cpp.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/qmlimportscanner/Qt5QmlImportScannerTemplate.cpp.in b/tools/qmlimportscanner/Qt5QmlImportScannerTemplate.cpp.in
new file mode 100644
index 0000000000..4ed747a555
--- /dev/null
+++ b/tools/qmlimportscanner/Qt5QmlImportScannerTemplate.cpp.in
@@ -0,0 +1,5 @@
+// This file is autogenerated by CMake. It imports static plugin classes for
+// static plugins used by QML imports.
+#include <QtPlugin>
+
+@qt5_qml_import_cpp_file_content@