summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt55
1 files changed, 32 insertions, 23 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8e60f0ba8..a38d95512 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,24 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# Generated from src.pro.
# special case begin
qt_find_package(WaylandScanner PROVIDED_TARGETS Wayland::Scanner)
-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. \
@@ -11,29 +28,20 @@ configure the module on targets that are missing dependencies.")
return()
endif()
-# We conditionally add_subdirectory(client) based on a feature that is defined
-# in client/configure.cmake, so we need this hack to make sure the feature is
-# defined on this level as well.
-# TODO: when we remove configure.json support and stop generating
-# configure.cmake, we should move the features up one level and deduplicate the
-# features shared with the compositor.
-qt_feature_module_begin(
- NO_MODULE
- PUBLIC_FILE "qtwayland-client-config.h"
- PRIVATE_FILE "qtwayland-client-config_p.h"
-)
-include("${CMAKE_CURRENT_SOURCE_DIR}/client/configure.cmake")
-qt_feature_module_end(NO_MODULE)
-
-# Similar hack as above, but for the compositor
-qt_feature_module_begin(
- NO_MODULE
- PUBLIC_FILE "qtwayland-compositor-config.h"
- PRIVATE_FILE "qtwayland-compositor-config_p.h"
+# See global/README for a description of the following module.
+qt_internal_add_module(WaylandGlobalPrivate
+ INTERNAL_MODULE
+ HEADER_MODULE
+ NO_GENERATE_CPP_EXPORTS
)
-include("${CMAKE_CURRENT_SOURCE_DIR}/compositor/configure.cmake")
-qt_feature_module_end(NO_MODULE)
-# special case end
+
+# Work around 115101.
+# If nothing depends on the WaylandGlobalPrivate target it doesn't run custom commands that the
+# target depends on. WaylandGlobalPrivate_ensure_sync_headers makes sure that 'all' depends on
+# WaylandGlobalPrivate_sync_headers.
+# TODO: This needs to be removed once the fix for QTBUG-115101 is merged in qtbase.
+add_custom_target(WaylandGlobalPrivate_ensure_sync_headers ALL)
+add_dependencies(WaylandGlobalPrivate_ensure_sync_headers WaylandGlobalPrivate_sync_headers)
add_subdirectory(qtwaylandscanner)
@@ -52,6 +60,7 @@ if (QT_FEATURE_wayland_server)
endif()
if (QT_FEATURE_wayland_server OR QT_FEATURE_wayland_client)
+ add_subdirectory(hardwareintegration)
add_subdirectory(plugins)
add_subdirectory(imports)
endif()