qt5base-lts/examples/widgets/tools
Alexandru Croitor 3c1125d9fe CMake: Create plugin initializers for static user plugins
Previously we only created object library static plugin initializers
for Qt plugins only, not user-project plugins.

The reason was that if a user tried to install the plugin target via
an export set, CMake would error out saying that the _init library is
not part of the same export set.

Introduce an OUTPUT_TARGETS option that would allow projects to get
the name of the generated _init target, so they can install it if
needed.
This was already done for qt6_add_qml_module, so we just introduce the
same option for qt6_add_plugin.

Now user static plugins will have an _init target created, which will
be propagated to consumers whenever the consumers link against the
plugin itself.

We also need an internal option to disable this propagation, because
it's handled a bit differently for Qt plugins which can be linked
either via finalizers or via usage requirements.

Amends 91c65dd80c

As a result of the implementation change, cleanup example projects
to ensure that they build successfully (the important part is
specifying the CLASS_NAME).

Only plugandpaint works properly with both shared and static Qt
builds.

echoplugin works with a shared Qt build, but not a static one due to
some assumptions in the C++ code about shared plugins.

styleplugin doesn't seem to work properly neither with shared Qt
builds nor static Qt builds, at least on macOS. But it builds fine.
For some reason even if the plugin is found, the style is not applied.

Amends 4caac1feea

Pick-to: 6.2
Task-number: QTBUG-80863
Task-number: QTBUG-92933
Change-Id: I6f631cda9566229b7a63992b23d7d7fa50303eeb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-24 16:10:31 +02:00
..
completer Raise cmake_minimum_required to VERSION 3.16 in examples 2021-08-17 19:18:54 +02:00
customcompleter Raise cmake_minimum_required to VERSION 3.16 in examples 2021-08-17 19:18:54 +02:00
echoplugin CMake: Create plugin initializers for static user plugins 2021-08-24 16:10:31 +02:00
i18n Raise cmake_minimum_required to VERSION 3.16 in examples 2021-08-17 19:18:54 +02:00
plugandpaint CMake: Create plugin initializers for static user plugins 2021-08-24 16:10:31 +02:00
regularexpression Raise cmake_minimum_required to VERSION 3.16 in examples 2021-08-17 19:18:54 +02:00
settingseditor Raise cmake_minimum_required to VERSION 3.16 in examples 2021-08-17 19:18:54 +02:00
styleplugin CMake: Create plugin initializers for static user plugins 2021-08-24 16:10:31 +02:00
treemodelcompleter Raise cmake_minimum_required to VERSION 3.16 in examples 2021-08-17 19:18:54 +02:00
undo Raise cmake_minimum_required to VERSION 3.16 in examples 2021-08-17 19:18:54 +02:00
undoframework Raise cmake_minimum_required to VERSION 3.16 in examples 2021-08-17 19:18:54 +02:00
.prev_CMakeLists.txt Move QTextCodec support out of QtCore 2020-06-20 02:04:38 +02:00
CMakeLists.txt Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
tools.pro Move QTextCodec support out of QtCore 2020-06-20 02:04:38 +02:00