From bf224b4c67841a5c2f4bb8a787b40566a871e09b Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 30 Oct 2020 07:42:17 +0100 Subject: Stop depending on private API in user-facing cmake code The qt_parse_all_arguments() macro is not available as part of the public API, but it was used to generate code for extensions, which users need to be able to do. The result was that top-level builds would work because they could access the functions, but when our examples were built as stand-alone, it failed to find the function. The fix is just to copy-paste the contents of the macro. Fixes: QTBUG-87445 Fixes: QTBUG-87446 Change-Id: Id5a583358be4163d3cdab72d7c23804f66f45500 Reviewed-by: Alexandru Croitor --- src/client/Qt6WaylandClientMacros.cmake | 6 +++++- src/compositor/Qt6WaylandCompositorMacros.cmake | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/Qt6WaylandClientMacros.cmake b/src/client/Qt6WaylandClientMacros.cmake index 89430b242..408cf2379 100644 --- a/src/client/Qt6WaylandClientMacros.cmake +++ b/src/client/Qt6WaylandClientMacros.cmake @@ -1,5 +1,9 @@ function(qt6_generate_wayland_protocol_client_sources target) - qt_parse_all_arguments(arg "qt6_generate_wayland_protocol_client_sources" "" "" "FILES" ${ARGN}) + cmake_parse_arguments(arg "" "" "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() + get_target_property(target_binary_dir ${target} BINARY_DIR) if(NOT TARGET Wayland::Scanner) diff --git a/src/compositor/Qt6WaylandCompositorMacros.cmake b/src/compositor/Qt6WaylandCompositorMacros.cmake index 4e25916d4..51edbb319 100644 --- a/src/compositor/Qt6WaylandCompositorMacros.cmake +++ b/src/compositor/Qt6WaylandCompositorMacros.cmake @@ -1,5 +1,9 @@ function(qt6_generate_wayland_protocol_server_sources target) - qt_parse_all_arguments(arg "qt6_generate_wayland_protocol_server_sources" "" "" "FILES" ${ARGN}) + cmake_parse_arguments(arg "" "" "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() + get_target_property(target_binary_dir ${target} BINARY_DIR) if(NOT TARGET Wayland::Scanner) -- cgit v1.2.3