Retire the qt_parse_all_arguments

This replaces the qt_parse_all_arguments macro with the built-in
`cmake_parse_arguments(PARSE_ARGV`. In addition, a new function,
_qt_internal_validate_all_args_are_parsed, can be used to check whether
any _UNPARSED_ARGUMENTS have been passed to the function.

Fixes: QTBUG-99238
Change-Id: I8cee83dc92dc6acdaaf747ea6ff9084c11dc649b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Amir Masoud Abdol 2023-01-11 15:36:18 +01:00
parent 5686824229
commit 7e82577680
18 changed files with 141 additions and 96 deletions

View File

@ -14,12 +14,12 @@ endmacro()
# Everything else is just prepation for option validating.
function(qt_internal_add_common_qt_library_helper target)
qt_internal_get_add_library_option_args(option_args)
qt_parse_all_arguments(arg "qt_internal_add_common_qt_library_helper"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${option_args}"
""
""
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
if(arg_SHARED)
set(arg_SHARED SHARED)
@ -67,12 +67,12 @@ function(qt_internal_add_cmake_library target)
${__default_public_args}
)
qt_parse_all_arguments(arg "qt_add_cmake_library"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${option_args}"
"${single_args}"
"${multi_args}"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
qt_remove_args(library_helper_args
ARGS_TO_REMOVE
@ -141,12 +141,12 @@ function(qt_internal_add_3rdparty_library target)
${__default_public_args}
)
qt_parse_all_arguments(arg "qt_internal_add_3rdparty_library"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${library_option_args};${option_args}"
"${single_args}"
"${multi_args}"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
qt_remove_args(library_helper_args
ARGS_TO_REMOVE
@ -349,12 +349,13 @@ function(qt_internal_add_3rdparty_header_module target)
set(multi_args
EXTERNAL_HEADERS
)
qt_parse_all_arguments(arg "qt_internal_add_header_module"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${option_args}"
"${single_args}"
"${multi_args}"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
qt_internal_add_module(${target}
INTERNAL_MODULE
HEADER_MODULE

View File

@ -4,12 +4,12 @@
# This function creates a CMake target for a Qt internal app.
# Such projects had a load(qt_app) command.
function(qt_internal_add_app target)
qt_parse_all_arguments(arg
"qt_internal_add_app"
cmake_parse_arguments(PARSE_ARGV 1 arg
"NO_INSTALL;INSTALL_VERSIONED_LINK;EXCEPTIONS"
"${__default_target_info_args};INSTALL_DIR"
"${__default_private_args};PUBLIC_LIBRARIES"
${ARGN})
)
_qt_internal_validate_all_args_are_parsed(arg)
set(exceptions "")
if(arg_EXCEPTIONS)

View File

@ -61,7 +61,8 @@ endfunction()
# This function adds or removes additional AUTOGEN tools to a target: AUTOMOC/UIC/RCC
function(qt_autogen_tools target)
qt_parse_all_arguments(arg "qt_autogen_tools" "" "" "${__default_private_args}" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 1 arg "" "" "${__default_private_args}")
_qt_internal_validate_all_args_are_parsed(arg)
if(arg_ENABLE_AUTOGEN_TOOLS)
foreach(tool ${arg_ENABLE_AUTOGEN_TOOLS})

View File

@ -60,9 +60,11 @@ endif()
# to each destination, and sets the computed install target destination arguments in OUT_VAR.
# Defaults used for each of the destination types, and can be configured per destination type.
function(qt_get_install_target_default_args)
qt_parse_all_arguments(arg "qt_get_install_target_default_args"
"" "OUT_VAR;CMAKE_CONFIG;RUNTIME;LIBRARY;ARCHIVE;INCLUDES;BUNDLE"
"ALL_CMAKE_CONFIGS" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 0 arg
""
"OUT_VAR;CMAKE_CONFIG;RUNTIME;LIBRARY;ARCHIVE;INCLUDES;BUNDLE"
"ALL_CMAKE_CONFIGS")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_CMAKE_CONFIG)
message(FATAL_ERROR "No value given for CMAKE_CONFIG.")

View File

@ -313,9 +313,11 @@ function(qt_configure_add_summary_entry)
endfunction()
function(qt_configure_process_add_summary_entry)
qt_parse_all_arguments(arg "qt_configure_add_summary_entry"
cmake_parse_arguments(PARSE_ARGV 0 arg
""
"ARGS;TYPE;MESSAGE" "CONDITION" ${ARGN})
"ARGS;TYPE;MESSAGE"
"CONDITION")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_TYPE)
set(arg_TYPE "feature")
@ -472,8 +474,11 @@ function(qt_configure_add_summary_section)
endfunction()
function(qt_configure_process_add_summary_section)
qt_parse_all_arguments(arg "qt_configure_add_summary_section"
"" "NAME" "" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 0 arg
""
"NAME"
"")
_qt_internal_validate_all_args_are_parsed(arg)
qt_configure_add_report("${__qt_configure_indent}${arg_NAME}:")
if(NOT DEFINED __qt_configure_indent)
@ -505,9 +510,11 @@ function(qt_configure_add_report_error error)
endfunction()
function(qt_configure_process_add_report_entry)
qt_parse_all_arguments(arg "qt_configure_add_report_entry"
cmake_parse_arguments(PARSE_ARGV 0 arg
""
"TYPE;MESSAGE" "CONDITION" ${ARGN})
"TYPE;MESSAGE"
"CONDITION")
_qt_internal_validate_all_args_are_parsed(arg)
set(possible_types NOTE WARNING ERROR FATAL_ERROR)
if(NOT "${arg_TYPE}" IN_LIST possible_types)

View File

@ -51,6 +51,9 @@ endfunction()
# A version of cmake_parse_arguments that makes sure all arguments are processed and errors out
# with a message about ${type} having received unknown arguments.
#
# TODO: Remove when all usage of qt_parse_all_arguments were replaced by
# cmake_parse_all_arguments(PARSEARGV) instances
macro(qt_parse_all_arguments result type flags options multiopts)
cmake_parse_arguments(${result} "${flags}" "${options}" "${multiopts}" ${ARGN})
if(DEFINED ${result}_UNPARSED_ARGUMENTS)
@ -58,6 +61,14 @@ macro(qt_parse_all_arguments result type flags options multiopts)
endif()
endmacro()
# Checks whether any unparsed arguments have been passed to the function at the call site.
# Use this right after `cmake_parse_arguments`.
function(_qt_internal_validate_all_args_are_parsed prefix)
if(DEFINED ${prefix}_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown arguments: (${${prefix}_UNPARSED_ARGUMENTS})")
endif()
endfunction()
# Print all variables defined in the current scope.
macro(qt_debug_print_variables)
cmake_parse_arguments(__arg "DEDUP" "" "MATCH;IGNORE" ${ARGN})
@ -114,8 +125,7 @@ endfunction()
# Parameters:
# out_var: result of remove all arguments specified by ARGS_TO_REMOVE from ALL_ARGS
# ARGS_TO_REMOVE: Arguments to remove.
# ALL_ARGS: All arguments supplied to cmake_parse_arguments or
# qt_parse_all_arguments
# ALL_ARGS: All arguments supplied to cmake_parse_arguments
# from which ARGS_TO_REMOVE should be removed from. We require all the
# arguments or we can't properly identify the range of the arguments detailed
# in ARGS_TO_REMOVE.
@ -129,7 +139,7 @@ endfunction()
# bar(target BAR.... WWW...)
#
# function(foo target)
# qt_parse_all_arguments(arg "" "" "BAR;ZZZ;WWW ${ARGV})
# cmake_parse_arguments(PARSE_ARGV 1 arg "" "" "BAR;ZZZ;WWW")
# qt_remove_args(forward_args
# ARGS_TO_REMOVE ${target} ZZZ
# ALL_ARGS ${target} BAR ZZZ WWW

View File

@ -3,7 +3,12 @@
# helper to set up a qdbusxml2cpp rule
function(qt_create_qdbusxml2cpp_command target infile)
qt_parse_all_arguments(arg "qt_create_qdbusxml2cpp_command" "ADAPTOR;INTERFACE" "BASENAME" "FLAGS" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 2 arg
"ADAPTOR;INTERFACE"
"BASENAME"
"FLAGS")
_qt_internal_validate_all_args_are_parsed(arg)
if((arg_ADAPTOR AND arg_INTERFACE) OR (NOT arg_ADAPTOR AND NOT arg_INTERFACE))
message(FATAL_ERROR "qt_create_dbusxml2cpp_command needs either ADAPTOR or INTERFACE.")
endif()
@ -55,6 +60,7 @@ function(qt_create_qdbusxml2cpp_command target infile)
"${header_file}:${source_file}" "${absolute_in_file_path}"
DEPENDS "${absolute_in_file_path}" ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND_EXPAND_LISTS
VERBATIM)
target_sources("${target}" PRIVATE

View File

@ -12,11 +12,11 @@
# Qt::Core or Qt::Bootstrap libraries. Otherwise the Qt::Core library will be publicly
# linked to the executable target by default.
function(qt_internal_add_executable name)
qt_parse_all_arguments(arg "qt_internal_add_executable"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${__qt_internal_add_executable_optional_args}"
"${__qt_internal_add_executable_single_args}"
"${__qt_internal_add_executable_multi_args}"
${ARGN})
"${__qt_internal_add_executable_multi_args}")
_qt_internal_validate_all_args_are_parsed(arg)
if ("x${arg_OUTPUT_DIRECTORY}" STREQUAL "x")
set(arg_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_BINDIR}")

View File

@ -5,9 +5,11 @@ include(QtFeatureCommon)
include(CheckCXXCompilerFlag)
function(qt_feature_module_begin)
qt_parse_all_arguments(arg "qt_feature_module_begin"
cmake_parse_arguments(PARSE_ARGV 0 arg
"NO_MODULE;ONLY_EVALUATE_FEATURES"
"LIBRARY;PRIVATE_FILE;PUBLIC_FILE" "PUBLIC_DEPENDENCIES;PRIVATE_DEPENDENCIES" ${ARGN})
"LIBRARY;PRIVATE_FILE;PUBLIC_FILE"
"PUBLIC_DEPENDENCIES;PRIVATE_DEPENDENCIES")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_ONLY_EVALUATE_FEATURES)
if ("${arg_LIBRARY}" STREQUAL "" AND (NOT ${arg_NO_MODULE}))
@ -46,9 +48,11 @@ function(qt_feature feature)
qt_feature_normalize_name("${feature}" feature)
set_property(GLOBAL PROPERTY QT_FEATURE_ORIGINAL_NAME_${feature} "${original_name}")
qt_parse_all_arguments(arg "qt_feature"
cmake_parse_arguments(PARSE_ARGV 1 arg
"PRIVATE;PUBLIC"
"LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${ARGN})
"LABEL;PURPOSE;SECTION"
"AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF")
_qt_internal_validate_all_args_are_parsed(arg)
set(_QT_FEATURE_DEFINITION_${feature} ${ARGN} PARENT_SCOPE)
@ -412,7 +416,11 @@ endfunction()
function(qt_feature_config feature config_var_name)
qt_feature_normalize_name("${feature}" feature)
qt_parse_all_arguments(arg "qt_feature_config" "NEGATE" "NAME" "" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 2 arg
"NEGATE"
"NAME"
"")
_qt_internal_validate_all_args_are_parsed(arg)
# Store all the config related info in a unique variable key.
set(key_name "_QT_FEATURE_CONFIG_DEFINITION_${feature}_${config_var_name}")
@ -472,7 +480,11 @@ endfunction()
function(qt_feature_definition feature name)
qt_feature_normalize_name("${feature}" feature)
qt_parse_all_arguments(arg "qt_feature_definition" "NEGATE" "VALUE;PREREQUISITE" "" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 2 arg
"NEGATE"
"VALUE;PREREQUISITE"
"")
_qt_internal_validate_all_args_are_parsed(arg)
# Store all the define related info in a unique variable key.
set(key_name "_QT_FEATURE_DEFINE_DEFINITION_${feature}_${name}")
@ -528,7 +540,11 @@ function(qt_evaluate_feature_definition key)
endfunction()
function(qt_extra_definition name value)
qt_parse_all_arguments(arg "qt_extra_definition" "PUBLIC;PRIVATE" "" "" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 2 arg
"PUBLIC;PRIVATE"
""
"")
_qt_internal_validate_all_args_are_parsed(arg)
if (arg_PUBLIC)
string(APPEND __QtFeature_public_extra "\n#define ${name} ${value}\n")

View File

@ -11,12 +11,12 @@ function(qt_internal_add_linker_version_script target)
return()
endif()
qt_parse_all_arguments(arg "qt_internal_add_linker_version_script"
cmake_parse_arguments(PARSE_ARGV 1 arg
""
"PRIVATE_CONTENT_FILE"
"PRIVATE_HEADERS"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
if(arg_PRIVATE_CONTENT_FILE AND arg_PRIVATE_HEADERS)
message(FATAL_ERROR "Both PRIVATE_CONTENT_FILE and PRIVATE_HEADERS are specified.")
@ -526,13 +526,11 @@ endfunction()
# LANGUAGES - optional list of languages like 'C', 'CXX', for which to remove the flags
# if not provided, defaults to the list of enabled C-like languages
function(qt_internal_remove_known_optimization_flags)
qt_parse_all_arguments(
arg
"qt_internal_remove_known_optimization_flags"
cmake_parse_arguments(PARSE_ARGV 0 arg
"IN_CACHE"
""
"CONFIGS;LANGUAGES"
${ARGN})
"CONFIGS;LANGUAGES")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_CONFIGS)
message(FATAL_ERROR
@ -566,13 +564,12 @@ endfunction()
# specified.
# REGEX enables the flag processing as a regular expression.
function(qt_internal_remove_compiler_flags flags)
qt_parse_all_arguments(arg
"qt_internal_remove_compiler_flags"
cmake_parse_arguments(PARSE_ARGV 1 arg
"IN_CACHE;REGEX"
""
"CONFIGS;LANGUAGES"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
if("${flags}" STREQUAL "")
message(WARNING "qt_internal_remove_compiler_flags was called without any flags specified.")
@ -627,13 +624,11 @@ endfunction()
# LANGUAGES - optional list of languages like 'C', 'CXX', for which to add the flags
# if not provided, defaults to the list of enabled C-like languages
function(qt_internal_add_compiler_flags)
qt_parse_all_arguments(
arg
"qt_internal_add_compiler_flags"
cmake_parse_arguments(PARSE_ARGV 0 arg
"IN_CACHE"
"FLAGS"
"CONFIGS;LANGUAGES"
${ARGN})
"CONFIGS;LANGUAGES")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_CONFIGS)
message(FATAL_ERROR
@ -670,13 +665,11 @@ endfunction()
# LANGUAGES - optional list of languages like 'C', 'CXX', for which to add the flags
# if not provided, defaults to the list of enabled C-like languages
function(qt_internal_add_compiler_flags_for_release_configs)
qt_parse_all_arguments(
arg
"qt_internal_add_compiler_flags_for_release_configs"
cmake_parse_arguments(PARSE_ARGV 0 arg
"IN_CACHE"
"FLAGS"
"LANGUAGES"
${ARGN})
"LANGUAGES")
_qt_internal_validate_all_args_are_parsed(arg)
set(args "")
@ -716,13 +709,11 @@ endfunction()
# It is meant to be called in a subdirectory scope to enable full optimizations for a particular
# Qt module, like Core or Gui.
function(qt_internal_add_optimize_full_flags)
qt_parse_all_arguments(
arg
"qt_internal_add_optimize_full_flags"
cmake_parse_arguments(PARSE_ARGV 0 arg
"IN_CACHE"
""
""
${ARGN})
"")
_qt_internal_validate_all_args_are_parsed(arg)
# QT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS disables forced full optimization.
if(QT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS)
@ -778,13 +769,11 @@ endfunction()
# LANGUAGES - optional list of languages like 'C', 'CXX', for which to replace the flags
# if not provided, defaults to the list of enabled C-like languages
function(qt_internal_replace_compiler_flags match_string replace_string)
qt_parse_all_arguments(
arg
"qt_internal_replace_compiler_flags"
cmake_parse_arguments(PARSE_ARGV 2 arg
"IN_CACHE"
""
"CONFIGS;LANGUAGES"
${ARGN})
"CONFIGS;LANGUAGES")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_CONFIGS)
message(FATAL_ERROR
@ -819,13 +808,11 @@ endfunction()
# CMAKE_<LINKER_TYPE>_LINKER_FLAGS_<CONFIG> cache variable.
# e.g EXE, MODULE, SHARED, STATIC.
function(qt_internal_add_linker_flags)
qt_parse_all_arguments(
arg
"qt_internal_add_linker_flags"
cmake_parse_arguments(PARSE_ARGV 0 arg
"IN_CACHE"
"FLAGS"
"CONFIGS;TYPES"
${ARGN})
"CONFIGS;TYPES")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_TYPES)
message(FATAL_ERROR
@ -866,13 +853,11 @@ endfunction()
# CMAKE_<LINKER_TYPE>_LINKER_FLAGS_<CONFIG> cache variable.
# e.g EXE, MODULE, SHARED, STATIC.
function(qt_internal_replace_linker_flags match_string replace_string)
qt_parse_all_arguments(
arg
"qt_internal_replace_compiler_flags"
cmake_parse_arguments(PARSE_ARGV 2 arg
"IN_CACHE"
""
"CONFIGS;TYPES"
${ARGN})
"CONFIGS;TYPES")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_TYPES)
message(FATAL_ERROR

View File

@ -127,12 +127,12 @@ function(qt_internal_add_module target)
module_multi_args
)
qt_parse_all_arguments(arg "qt_internal_add_module"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${module_option_args}"
"${module_single_args}"
"${module_multi_args}"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
set(is_internal_module FALSE)
if(arg_INTERNAL_MODULE)

View File

@ -43,12 +43,12 @@ function(qt_internal_add_plugin target)
set(single_args ${public_single_args} ${internal_single_args})
set(multi_args ${public_multi_args} ${internal_multi_args})
qt_parse_all_arguments(arg "qt_internal_add_plugin"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${option_args}"
"${single_args}"
"${multi_args}"
"${ARGN}"
)
_qt_internal_validate_all_args_are_parsed(arg)
# Put this behind a cache option for now. It's too noisy for general use
# until most repos are updated.

View File

@ -17,7 +17,11 @@ function(qt_internal_add_resource target resourceName)
return()
endif()
qt_parse_all_arguments(arg "qt_add_resource" "" "PREFIX;LANG;BASE;OUTPUT_TARGETS" "FILES" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 2 arg
""
"PREFIX;LANG;BASE;OUTPUT_TARGETS"
"FILES")
_qt_internal_validate_all_args_are_parsed(arg)
_qt_internal_process_resource(${target} ${resourceName}
PREFIX "${arg_PREFIX}"

View File

@ -82,7 +82,12 @@ function(qt_apply_rpaths)
return()
endif()
qt_parse_all_arguments(arg "qt_apply_rpaths" "RELATIVE_RPATH" "TARGET;INSTALL_PATH" "" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 0 arg
"RELATIVE_RPATH"
"TARGET;INSTALL_PATH"
"")
_qt_internal_validate_all_args_are_parsed(arg)
if(NOT arg_TARGET)
message(FATAL_ERROR "No target given to qt_apply_rpaths.")
else()

View File

@ -16,8 +16,12 @@
# SIMD compiler flags. This is mostly relevant for fat / universal builds
#
function(qt_internal_add_simd_part target)
qt_parse_all_arguments(arg "qt_add_simd_part" "" "NAME;SIMD"
"${__default_private_args};COMPILE_FLAGS;EXCLUDE_OSX_ARCHITECTURES" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 1 arg
""
"NAME;SIMD"
"${__default_private_args};COMPILE_FLAGS;EXCLUDE_OSX_ARCHITECTURES")
_qt_internal_validate_all_args_are_parsed(arg)
if ("x${arg_SIMD}" STREQUAL x)
message(FATAL_ERROR "qt_add_simd_part needs a SIMD type to be set.")
endif()

View File

@ -45,12 +45,12 @@ function(qt_internal_extend_target target)
NO_PCH_SOURCES
)
qt_parse_all_arguments(arg "qt_extend_target"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${option_args}"
"${single_args}"
"${multi_args}"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
if("x${arg_CONDITION}" STREQUAL "x")
set(arg_CONDITION ON)

View File

@ -9,12 +9,12 @@ function(qt_internal_add_benchmark target)
message(WARNING "Benchmarks won't be batched - unsupported (yet)")
endif()
qt_parse_all_arguments(arg "qt_add_benchmark"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${__qt_internal_add_executable_optional_args}"
"${__qt_internal_add_executable_single_args}"
"${__qt_internal_add_executable_multi_args}"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
qt_remove_args(exec_args
ARGS_TO_REMOVE
@ -93,12 +93,12 @@ endfunction()
# See qt_internal_add_executable() for more details.
function(qt_internal_add_manual_test target)
qt_parse_all_arguments(arg "qt_add_manual_test"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${__qt_internal_add_executable_optional_args}"
"${__qt_internal_add_executable_single_args}"
"${__qt_internal_add_executable_multi_args}"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
qt_remove_args(exec_args
ARGS_TO_REMOVE
@ -427,12 +427,12 @@ endfunction()
function(qt_internal_add_test name)
qt_internal_get_test_arg_definitions(optional_args single_value_args multi_value_args)
qt_parse_all_arguments(arg "qt_add_test"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${optional_args};NO_BATCH"
"${single_value_args}"
"${multi_value_args}"
${ARGN}
)
_qt_internal_validate_all_args_are_parsed(arg)
if (NOT arg_OUTPUT_DIRECTORY)
set(arg_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
@ -836,11 +836,12 @@ function(qt_internal_add_test_helper name)
"OVERRIDE_OUTPUT_DIRECTORY"
)
qt_parse_all_arguments(arg "qt_add_test_helper"
cmake_parse_arguments(PARSE_ARGV 1 arg
"${qt_add_test_helper_optional_args};${__qt_internal_add_executable_optional_args}"
"${__qt_internal_add_executable_single_args}"
"${__qt_internal_add_executable_multi_args}"
${ARGN})
)
_qt_internal_validate_all_args_are_parsed(arg)
qt_remove_args(forward_args
ARGS_TO_REMOVE

View File

@ -48,9 +48,12 @@ function(qt_internal_add_tool target_name)
EXTRA_CMAKE_INCLUDES
PUBLIC_LIBRARIES
${__default_private_args})
qt_parse_all_arguments(arg "qt_internal_add_tool" "${option_keywords}"
"${one_value_keywords}"
"${multi_value_keywords}" ${ARGN})
cmake_parse_arguments(PARSE_ARGV 1 arg
"${option_keywords}"
"${one_value_keywords}"
"${multi_value_keywords}")
_qt_internal_validate_all_args_are_parsed(arg)
qt_internal_find_tool(will_build_tools ${target_name} "${arg_TOOLS_TARGET}")