From 99ace38d22c640e37bb1a41095ee3b126169816a Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 25 Feb 2020 14:18:56 +0100 Subject: CMake: Also import Qt plugins that are not literally named *Plugin There are some plugins in qtlocation, qtdeclarative whose names are not suffixed with 'Plugin', so the current logic fails to load the corresponding QtModule_XXX.cmake file. Work around this by just searching for Qt5$${CMAKE_MODULE_NAME}}_*.cmake. Users can define QT5_STRICT_PLUGIN_GLOB or Qt5$${CMAKE_MODULE_NAME}_STRICT_PLUGIN_GLOB to change back to the old behavior. [ChangeLog][cmake] Fixed an issue where some Qt location and declarative plugins whose name did not end with "Plugin" where not imported by the corresponding Qt component package. You can force the old behavior by setting QT5_STRICT_PLUGIN_GLOB or Qt5ModuleName_STRICT_PLUGIN_GLOB before the find_package(Qt5 ...) call. Fixes: QTBUG-58812 Change-Id: Ic8adf9562841ed49eabc4f7fb2b5ae257ca606cd Reviewed-by: Alexandru Croitor --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mkspecs/features') diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 4c3086a1f6..6eda017d75 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -566,8 +566,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ENDIF // TEMPLATE != aux !!IF isEmpty(CMAKE_INTERNAL_MODULE) - - file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\") + # In Qt 5.15 the glob pattern was relaxed to also catch plugins not literally named "Plugin". + # Define QT5_STRICT_PLUGIN_GLOB or ModuleName_STRICT_PLUGIN_GLOB to revert to old behavior. + if (QT5_STRICT_PLUGIN_GLOB OR Qt5$${CMAKE_MODULE_NAME}_STRICT_PLUGIN_GLOB) + file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\") + else() + file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*.cmake\") + endif() macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION IsDebugAndRelease) -- cgit v1.2.3