Skip to content

Commit

Permalink
CMake: De-duplicate list input handling code in QtProcessConfigureArgs
Browse files Browse the repository at this point in the history
Change-Id: I9fd77dd81f67fcc9a0306ab0d627257f209cdb08
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
jobor committed Aug 17, 2020
1 parent 584d4be commit f107713
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions cmake/QtProcessConfigureArgs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ macro(translate_path_input name cmake_var)
endif()
endmacro()

macro(translate_list_input name cmake_var)
if(DEFINED INPUT_${name})
list(JOIN INPUT_${name} "\\;" value)
list(APPEND cmake_args "-D${cmake_var}=${value}")
drop_input(${name})
endif()
endmacro()

foreach(feature ${commandline_known_features})
qt_feature_normalize_name("${feature}" cmake_feature)
translate_boolean_input(${feature} FEATURE_${cmake_feature})
Expand Down Expand Up @@ -590,19 +598,8 @@ elseif(nr_of_build_configs GREATER 1)
list(APPEND cmake_args "-DCMAKE_CONFIGURATION_TYPES=${escaped_build_configs}")
endif()

drop_input(device-option)
if(INPUT_device-option)
unset(escaped_device_options)
list(JOIN INPUT_device-option "\\;" escaped_device_options)
list(APPEND cmake_args "-DQT_QMAKE_DEVICE_OPTIONS=${escaped_device_options}")
endif()

drop_input(rpaths)
if(INPUT_rpaths)
unset(escaped_paths)
list(JOIN INPUT_rpaths "\\;" escaped_paths)
list(APPEND cmake_args "-DQT_EXTRA_RPATHS=${escaped_paths}")
endif()
translate_list_input(device-option QT_QMAKE_DEVICE_OPTIONS)
translate_list_input(rpaths QT_EXTRA_RPATHS)

foreach(input ${config_inputs})
push("-DINPUT_${input}=${INPUT_${input}}")
Expand Down

0 comments on commit f107713

Please sign in to comment.