From af184fdd4c5e77048bf876f18ed8355fff5595e1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 11 Mar 2021 10:05:55 +0100 Subject: [PATCH] CMake Wizards: Add Qt 6 specific static qml plugin importing For Qml / Qt Quick projects to work with static Qt builds, the application targets need to link to the static Qml plugins, which is done by calling qt_import_qml_plugins. Starting with Qt 6.1 and CMake 3.18+ that will be done automatically in qt_add_application via qt_finalize_executable, as per c71c48f5125c116f01f615f51f10e4f2877b2b1d But for Qt 6.0 and lower CMake versions, we need to call qt_import_qml_plugins manually, thus we include it in the Qt Quick wizard template so that it works with all Qt 6 versions and lower CMake versions. Amends b72c1d11e610340ef86188c964f3a7f8adda1ae9. Task-number: QTCREATORBUG-23574 Change-Id: Id8db3352ecbb8441eda9f5c9638c7ea6ac1fee96 Reviewed-by: Eike Ziller --- .../wizards/projects/qtquickapplication/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt index aeefa3af1f8..067ecb4f0a8 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt @@ -76,3 +76,7 @@ set_target_properties(%{ProjectName} PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} ) + +if(QT_VERSION_MAJOR EQUAL 6) + qt_import_qml_plugins(%{ProjectName}) +endif()