summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-07-27 11:35:50 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-07-27 15:43:18 +0200
commitf62412e6ec164e5e18292426152300d270b63905 (patch)
treec1f06aca9eab164c9efafa9f71a6689be849d056 /cmake
parent19507dc6788f252cd0795d80d9a39d22f1306882 (diff)
CMake: Add shared library plugin names to the QT_PLUGINS property
Otherwise we don't create a Qt6FooPlugins.cmake file in shared Qt builds. Adjust comment. Amends f68e2c92cc0ed2c1929140402c061359bc2363a5 Related to 7d6f1ee5a75cae9d122a3f0c7b3a6d03f380535e Change-Id: I9c66d81197a4867039d5c53daf1b7edf0391c701 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtPluginHelpers.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake
index 1fa6afccad..e94e3714f0 100644
--- a/cmake/QtPluginHelpers.cmake
+++ b/cmake/QtPluginHelpers.cmake
@@ -203,6 +203,12 @@ function(qt_internal_add_plugin target)
endif()
get_target_property(is_imported_qt_module ${qt_module_target} IMPORTED)
+ if(NOT is_imported_qt_module)
+ # This QT_PLUGINS assignment is only used by QtPostProcessHelpers to decide if a
+ # QtModulePlugins.cmake file should be generated.
+ set_property(TARGET "${qt_module_target}" APPEND PROPERTY QT_PLUGINS "${target}")
+ endif()
+
set(plugin_target_versioned "${QT_CMAKE_EXPORT_NAMESPACE}::${target}")
get_target_property(type "${plugin_target_versioned}" TYPE)
if(type STREQUAL STATIC_LIBRARY)
@@ -213,10 +219,6 @@ function(qt_internal_add_plugin target)
# is handled instead by the complicated genex logic in QtModulePlugins.cmake.in.
set(is_plugin_and_module_in_same_project FALSE)
if(NOT is_imported_qt_module)
- # This QT_PLUGINS assignment is only used by QtPostProcessHelpers to decide if a
- # QtModulePlugins.cmake file should be generated (which only happens in static builds).
- set_property(TARGET "${qt_module_target}" APPEND PROPERTY QT_PLUGINS "${target}")
-
get_target_property(module_source_dir ${qt_module_target} SOURCE_DIR)
get_directory_property(module_project_name
DIRECTORY ${module_source_dir}