summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2020-02-25 14:18:56 +0100
committerKai Koehne <kai.koehne@qt.io>2020-03-24 17:40:40 +0100
commit99ace38d22c640e37bb1a41095ee3b126169816a (patch)
tree23b71bceec215cb56609e302e3adb5899d0cd07b /mkspecs/features
parent6a972f44f3f88d6179e8e4eef54396b5808b3f4d (diff)
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 <alexandru.croitor@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in9
1 files changed, 7 insertions, 2 deletions
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)