From 486da5a84d467806a78247ad988de3fb01530043 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 28 Aug 2019 11:54:25 +0200 Subject: [PATCH] Fix qt_get_module_for_plugin to work with interface libraries Assume that interface libraries can't have plugins for now, otherwise we'll need to change the "MODULE_PLUGIN_TYPES" property name to include INTERFACE_ as a prefix. Change-Id: I21b64179ded5fd10216d843a21ee149e002793f3 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 5f00306248..a587ff8d4a 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1596,6 +1596,13 @@ endfunction() function(qt_get_module_for_plugin target target_type) qt_internal_get_qt_all_known_modules(known_modules) foreach(qt_module ${known_modules}) + get_target_property(module_type "${QT_CMAKE_EXPORT_NAMESPACE}::${qt_module}" TYPE) + # Assuming interface libraries can't have plugins. Otherwise we'll need to fix the property + # name, because the current one would be invalid for interface libraries. + if(module_type STREQUAL "INTERFACE_LIBRARY") + continue() + endif() + get_target_property(plugin_types "${QT_CMAKE_EXPORT_NAMESPACE}::${qt_module}" MODULE_PLUGIN_TYPES)