From 1291e8d09404716b5ade2ac283f8f30efba93187 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 15 Aug 2019 19:12:31 +0200 Subject: [PATCH] Fix developer warnings that a plugin does not belong to a Qt module When building qtsvg or qtimageformats there are a bunch of configuration warnings like: The plug-in 'qtiff' does not belong to any Qt module. This happens because qt_get_module_for_plugin() checks for modules only in the QT_KNOWN_MODULES variable. find_package()'d modules will not appear there though, but only in QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE. Change the function to check for Qt modules in both variables. This fixes all the warnings regarding plugins not belonging to a module. Change-Id: I39e668801a93794b62888cf868b97c55f57dccdd Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 3aa0c30268..87c126459d 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1521,8 +1521,12 @@ endfunction() # Utility function to find the module to which a plug-in belongs. # This will set the QT_MODULE target property on the plug-in - e.g. "Gui", "Sql"... function(qt_get_module_for_plugin target target_type) - foreach(qt_module ${QT_KNOWN_MODULES}) - get_target_property(plugin_types "${qt_module}" MODULE_PLUGIN_TYPES) + set(known_modules ${QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE} ${QT_KNOWN_MODULES}) + list(REMOVE_DUPLICATES known_modules) + foreach(qt_module ${known_modules}) + get_target_property(plugin_types + "${QT_CMAKE_EXPORT_NAMESPACE}::${qt_module}" + MODULE_PLUGIN_TYPES) if(plugin_types) foreach(plugin_type ${plugin_types}) if("${target_type}" STREQUAL "${plugin_type}")