CMake: use a robuster way to check for WebEngineWidgets

By using find_package(Qt5 COMPONENTS WebEngineWidgets) we make
sure that the WebEngineWidgetsConfig.cmake from the same Qt5
package would be marked as found.

Otherwise CMake would look around after a Qt5WebEngineWidgets
package, which on Windows if you have a MSVC Qt Creator trying
to build a MinGW Qt Creator could end up in a failed build.

Change-Id: Ibd30c36231577ef111d9163cc1c87a09443d3cb9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-06-09 13:45:58 +02:00
parent 38bbd6eb8c
commit 370410aca0

View File

@@ -49,7 +49,7 @@ extend_qtc_plugin(Help
macwebkithelpviewer.mm macwebkithelpviewer.mm
) )
find_package(Qt5WebEngineWidgets QUIET) find_package(Qt5 COMPONENTS WebEngineWidgets QUIET)
extend_qtc_plugin(Help extend_qtc_plugin(Help
CONDITION TARGET Qt5::WebEngineWidgets CONDITION TARGET Qt5::WebEngineWidgets
FEATURE_INFO "QtWebEngine help viewer" FEATURE_INFO "QtWebEngine help viewer"