Cleanup qt_internal_extend_target function
Extract function arguments to the corresponding variables and use variables when parsing arguments. Remove whitespace between if keyword and parentheses. Adjust size of code lines. Document function-specific arguments. Change-Id: I1c77fbf268618a844726683768575aff05894c70 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
720d5cc1a4
commit
ecc4250397
@ -3,6 +3,16 @@
|
||||
|
||||
# This function can be used to add sources/libraries/etc. to the specified CMake target
|
||||
# if the provided CONDITION evaluates to true.
|
||||
# One-value Arguments:
|
||||
# PRECOMPILED_HEADER
|
||||
# Name of the precompiled header that is used for the target.
|
||||
# Multi-value Arguments:
|
||||
# CONDITION
|
||||
# The condition under which the target will be extended.
|
||||
# COMPILE_FLAGS
|
||||
# Custom compilation flags.
|
||||
# NO_PCH_SOURCES
|
||||
# Skip the specified source files by PRECOMPILE_HEADERS feature.
|
||||
function(qt_internal_extend_target target)
|
||||
if(NOT TARGET "${target}")
|
||||
qt_internal_is_in_test_batch(in_batch ${target})
|
||||
@ -18,9 +28,27 @@ function(qt_internal_extend_target target)
|
||||
return()
|
||||
endif()
|
||||
|
||||
qt_parse_all_arguments(arg "qt_extend_target" "" "PRECOMPILED_HEADER"
|
||||
"CONDITION;${__default_public_args};${__default_private_args};${__default_private_module_args};COMPILE_FLAGS;NO_PCH_SOURCES" ${ARGN})
|
||||
if ("x${arg_CONDITION}" STREQUAL x)
|
||||
set(option_args "")
|
||||
set(single_args
|
||||
PRECOMPILED_HEADER
|
||||
)
|
||||
set(multi_args
|
||||
${__default_public_args}
|
||||
${__default_private_args}
|
||||
${__default_private_module_args}
|
||||
CONDITION
|
||||
COMPILE_FLAGS
|
||||
NO_PCH_SOURCES
|
||||
)
|
||||
|
||||
qt_parse_all_arguments(arg "qt_extend_target"
|
||||
"${option_args}"
|
||||
"${single_args}"
|
||||
"${multi_args}"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
if("x${arg_CONDITION}" STREQUAL "x")
|
||||
set(arg_CONDITION ON)
|
||||
endif()
|
||||
|
||||
@ -31,12 +59,20 @@ function(qt_internal_extend_target target)
|
||||
endif()
|
||||
set(dbus_sources "")
|
||||
foreach(adaptor ${arg_DBUS_ADAPTOR_SOURCES})
|
||||
qt_create_qdbusxml2cpp_command("${target}" "${adaptor}" ADAPTOR BASENAME "${arg_DBUS_ADAPTOR_BASENAME}" FLAGS "${arg_DBUS_ADAPTOR_FLAGS}")
|
||||
qt_create_qdbusxml2cpp_command("${target}" "${adaptor}"
|
||||
ADAPTOR
|
||||
BASENAME "${arg_DBUS_ADAPTOR_BASENAME}"
|
||||
FLAGS "${arg_DBUS_ADAPTOR_FLAGS}"
|
||||
)
|
||||
list(APPEND dbus_sources "${adaptor}")
|
||||
endforeach()
|
||||
|
||||
foreach(interface ${arg_DBUS_INTERFACE_SOURCES})
|
||||
qt_create_qdbusxml2cpp_command("${target}" "${interface}" INTERFACE BASENAME "${arg_DBUS_INTERFACE_BASENAME}" FLAGS "${arg_DBUS_INTERFACE_FLAGS}")
|
||||
qt_create_qdbusxml2cpp_command("${target}" "${interface}"
|
||||
INTERFACE
|
||||
BASENAME "${arg_DBUS_INTERFACE_BASENAME}"
|
||||
FLAGS "${arg_DBUS_INTERFACE_FLAGS}"
|
||||
)
|
||||
list(APPEND dbus_sources "${interface}")
|
||||
endforeach()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user