diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/CMakeLists.txt b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/CMakeLists.txt index 0a0a83d1bd0..d7c052fa438 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/CMakeLists.txt +++ b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/CMakeLists.txt @@ -17,6 +17,8 @@ qt_internal_add_module(WlShellIntegrationPrivate ) qt6_generate_wayland_protocol_client_sources(WlShellIntegrationPrivate + # this is just a helper module and still part of the QtWaylandClient build + WAYLAND_INCLUDE_DIR QtWaylandClient/private FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../3rdparty/protocol/wayland.xml ) diff --git a/src/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake b/src/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake index 5eab19d896f..6bda08e70fc 100644 --- a/src/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake +++ b/src/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake @@ -1,5 +1,5 @@ function(qt6_generate_wayland_protocol_client_sources target) - cmake_parse_arguments(arg "" "" "FILES" ${ARGN}) + cmake_parse_arguments(arg "" "WAYLAND_INCLUDE_DIR" "FILES" ${ARGN}) if(DEFINED arg_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown arguments were passed to qt6_generate_wayland_protocol_client_sources: (${arg_UNPARSED_ARGUMENTS}).") endif() @@ -34,11 +34,17 @@ function(qt6_generate_wayland_protocol_client_sources target) COMMAND Wayland::Scanner --strict --include-core-only public-code < "${protocol_file}" > "${waylandscanner_code_output}" ) - # TODO: Make this less hacky set(wayland_include_dir "") - get_target_property(is_for_module "${target}" INTERFACE_MODULE_HAS_HEADERS) - if (is_for_module) - set(wayland_include_dir "QtWaylandClient/private") + if(arg_WAYLAND_INCLUDE_DIR) + set(wayland_include_dir "${arg_WAYLAND_INCLUDE_DIR}") + else() + get_target_property(qt_module ${target} _qt_module_interface_name) + get_target_property(is_for_module "${target}" INTERFACE_MODULE_HAS_HEADERS) + if (qt_module) + set(wayland_include_dir "Qt${qt_module}/private") + elseif (is_for_module) + set(wayland_include_dir "QtWaylandClient/private") + endif() endif() add_custom_command( diff --git a/src/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake b/src/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake index b8771b95487..3fb08b3a743 100644 --- a/src/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake +++ b/src/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake @@ -1,5 +1,5 @@ function(qt6_generate_wayland_protocol_server_sources target) - cmake_parse_arguments(arg "" "" "FILES" ${ARGN}) + cmake_parse_arguments(arg "" "WAYLAND_INCLUDE_DIR" "FILES" ${ARGN}) if(DEFINED arg_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown arguments were passed to qt6_generate_wayland_protocol_server_sources: (${arg_UNPARSED_ARGUMENTS}).") endif() @@ -32,14 +32,17 @@ function(qt6_generate_wayland_protocol_server_sources target) COMMAND Wayland::Scanner --strict --include-core-only public-code < "${protocol_file}" > "${waylandscanner_code_output}" ) - # TODO: make this less hacky set(wayland_include_dir "") - get_target_property(qt_module ${target} _qt_module_interface_name) - get_target_property(is_for_module "${target}" INTERFACE_MODULE_HAS_HEADERS) - if (qt_module) - set(wayland_include_dir "Qt${qt_module}/private") - elseif (is_for_module) - set(wayland_include_dir "QtWaylandCompositor/private") + if(arg_WAYLAND_INCLUDE_DIR) + set(wayland_include_dir "${arg_WAYLAND_INCLUDE_DIR}") + else() + get_target_property(qt_module ${target} _qt_module_interface_name) + get_target_property(is_for_module "${target}" INTERFACE_MODULE_HAS_HEADERS) + if (qt_module) + set(wayland_include_dir "Qt${qt_module}/private") + elseif (is_for_module) + set(wayland_include_dir "QtWaylandCompositor/private") + endif() endif() add_custom_command(