From edbc9697b6a0dbaebff9bd70e6016668b670ca63 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 30 Oct 2020 07:42:17 +0100 Subject: [PATCH] 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/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake | 6 +++++- src/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake b/src/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake index 89430b2427e..408cf237965 100644 --- a/src/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake +++ b/src/tools/qtwaylandscanner/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/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake b/src/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake index 4e25916d469..51edbb319cd 100644 --- a/src/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake +++ b/src/tools/qtwaylandscanner/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)