diff --git a/src/platformsupport/wayland/CMakeLists.txt b/src/platformsupport/wayland/CMakeLists.txt index b804531aeff..c3219f9d293 100644 --- a/src/platformsupport/wayland/CMakeLists.txt +++ b/src/platformsupport/wayland/CMakeLists.txt @@ -4,13 +4,21 @@ # Generated from src.pro. # special case begin qt_find_package(WaylandScanner PROVIDED_TARGETS Wayland::Scanner) -if(TARGET Wayland::Client) - qt_internal_disable_find_package_global_promotion(Wayland::Client) -endif() -if(TARGET Wayland::Server) - qt_internal_disable_find_package_global_promotion(Wayland::Server) -endif() -qt_find_package(Wayland 1.15 PROVIDED_TARGETS Wayland::Client Wayland::Server) + +set(wayland_libs + Wayland::Client + Wayland::Server + Wayland::Cursor + Wayland::Egl +) + +foreach(lib IN LISTS wayland_libs) + if(TARGET ${lib}) + qt_internal_disable_find_package_global_promotion(${lib}) + endif() +endforeach() + +qt_find_package(Wayland 1.15 PROVIDED_TARGETS ${wayland_libs}) if (NOT WaylandScanner_FOUND OR NOT Wayland_FOUND) message(WARNING "QtWayland is missing required dependencies, nothing will be built. \