summaryrefslogtreecommitdiffstats
path: root/src/interfaceframework/doc/snippets
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2024-05-28 13:06:12 +0200
committerDominik Holland <dominik.holland@qt.io>2024-05-29 15:26:15 +0200
commit16f1705b1dfa7bccc4e14883eb4ff01a4a378117 (patch)
treeba9dc9c5846c9bc21ae75366cd0f61ecd53a0518 /src/interfaceframework/doc/snippets
parent40412cccc85b9d63a7324d38312ac52b6b36e8db (diff)
CMake: Add a new qt_ifcodegen_add_plugin function
This makes it easier to generate backend plugins while making sure those plugins are of the correct type and use the correct class name to support static linking. Fixes: QTBUG-123370 Change-Id: I4f32cce7df308bbe320a2063b5a9840de77a050f Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'src/interfaceframework/doc/snippets')
-rw-r--r--src/interfaceframework/doc/snippets/cmake-macros/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/interfaceframework/doc/snippets/cmake-macros/CMakeLists.txt b/src/interfaceframework/doc/snippets/cmake-macros/CMakeLists.txt
index fa858714..c7e2f0dc 100644
--- a/src/interfaceframework/doc/snippets/cmake-macros/CMakeLists.txt
+++ b/src/interfaceframework/doc/snippets/cmake-macros/CMakeLists.txt
@@ -49,3 +49,16 @@ target_link_libraries(AdressBook PUBLIC
Qt::Quick
)
#! [ifcodegen_import_variables]
+
+#! [ifcodegen_add_plugin]
+find_package(Qt6 COMPONENTS InterfaceFramework)
+
+# Generates a plugin using the backend_simulator template
+# and sets the MANUAL_FINALIZATION option, which is passed
+# directly to qt_add_plugin.
+qt_ifcodegen_add_plugin(addressbook_plugin
+ IDL_FILES addressbook.qface
+ TEMPLATE backend_simulator
+ MANUAL_FINALIZATION
+)
+#! [ifcodegen_add_plugin]