From 759a2ecc6655e4bacbf5c09cfde99be34b66ae6f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 6 Mar 2023 11:24:30 +0100 Subject: CMake: Add docs for NO_PLUGIN and clarify NO_GENERATE_PLUGIN_SOURCE Fixes: QTBUG-111577 Change-Id: I7f259c3b710d0be16844d159e3204ee2e51f2a06 Reviewed-by: Fabian Kosmale Reviewed-by: Sze Howe Koh (cherry picked from commit f0f274e354820affbad5331868191824c834a99d) --- src/qml/doc/src/cmake/qt_add_qml_module.qdoc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/qml') diff --git a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc index d0f9a9deff..b81a0c80ea 100644 --- a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc +++ b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc @@ -59,6 +59,7 @@ qt_add_qml_module( [RESOURCES ...] [OUTPUT_TARGETS out_targets_var] [DESIGNER_SUPPORTED] + [NO_PLUGIN] [NO_PLUGIN_OPTIONAL] [NO_CREATE_PLUGIN_TARGET] [NO_GENERATE_PLUGIN_SOURCE] @@ -416,7 +417,21 @@ plugin class, the \c NO_GENERATE_PLUGIN_SOURCE option should be given. Where no \c CLASS_NAME is provided, it defaults to the \c URI with dots replaced by underscores, then \c Plugin appended. Unless the QML module has no plugin, the class name will be recorded as a \c classname line in the generated -\l{Module Definition qmldir Files}{qmldir} file. +\l{Module Definition qmldir Files}{qmldir} file. You need to add any C++ files +with custom plugin code to the plugin target. Since the plugin then likely +contains functionality that goes beyond simply loading the backing library, you +will probably want to add \l{NO_PLUGIN_OPTIONAL}, too. Otherwise the QML engine +may skip loading the plugin if it detects that the backing library is already +linked. + +\target NO_PLUGIN +If the \c NO_PLUGIN keyword is given, then no plugin will be built. This +keyword is thus incompatible with all the options that customize the plugin +target, in particular \l{NO_GENERATE_PLUGIN_SOURCE}, \l{NO_PLUGIN_OPTIONAL}, +\l{PLUGIN_TARGET}, \l{NO_CREATE_PLUGIN_TARGET}, and \l{CLASS_NAME}. If you do +not provide a plugin for your module, it will only be fully usable if its +backing library has been linked into the executable. It is generally hard to +guarantee that a linker preserves the linkage to a library it considers unused. \target NO_PLUGIN_OPTIONAL If the \c NO_PLUGIN_OPTIONAL keyword is given, then the plugin is recorded in -- cgit v1.2.3