configure: Allow specifying a comma separated list to -skip option

This makes skipping a list of submodules more concise.

e.g. instead of passing

 -skip qtsvg -skip qtimageformats -skip qtmultimedia

pass

 -skip qtsvg,qtimageformats,qtmultimedia

Pick-to: 6.2 6.3
Change-Id: I6a48828b2fd7cec9f6e19988f7b4033333768abb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Alexandru Croitor 2022-02-02 17:04:44 +01:00
parent b43528ea00
commit 40155ddd0e
3 changed files with 19 additions and 4 deletions

View File

@ -25,6 +25,15 @@ macro(pop_path_argument)
file(TO_CMAKE_PATH "${path}" path)
endmacro()
function(is_non_empty_valid_arg arg value)
if(value STREQUAL "")
message(FATAL_ERROR "Value supplied to command line option '${arg}' is empty.")
elseif(value MATCHES "^-.*")
message(FATAL_ERROR
"Value supplied to command line option '${arg}' is invalid: ${value}")
endif()
endfunction()
if("${MODULE_ROOT}" STREQUAL "")
# If MODULE_ROOT is not set, assume that we want to build qtbase or top-level.
get_filename_component(MODULE_ROOT ".." ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
@ -76,8 +85,12 @@ while(NOT "${configure_args}" STREQUAL "")
elseif(arg STREQUAL "-write-options-for-conan")
list(POP_FRONT configure_args options_json_file)
elseif(arg STREQUAL "-skip")
list(POP_FRONT configure_args qtrepo)
push("-DBUILD_${qtrepo}=OFF")
list(POP_FRONT configure_args qtrepos)
is_non_empty_valid_arg("${arg}" "${qtrepos}")
list(TRANSFORM qtrepos REPLACE "," ";")
foreach(qtrepo IN LISTS qtrepos)
push("-DBUILD_${qtrepo}=OFF")
endforeach()
elseif(arg STREQUAL "-qt-host-path")
pop_path_argument()
push("-DQT_HOST_PATH=${path}")

View File

@ -95,7 +95,7 @@ The following table describes the mapping of configure options to CMake argument
| -android-style-assets | -DFEATURE_android_style_assets=ON | |
| -android-javac-source | -DQT_ANDROID_JAVAC_SOURCE=7 | Set the javac build source version. |
| -android-javac-target | -DQT_ANDROID_JAVAC_TARGET=7 | Set the javac build target version. |
| -skip <repo> | -DBUILD_<repo>=OFF | |
| -skip <repo>,...,<repo_n> | -DBUILD_<repo>=OFF | |
| -make <part> | -DQT_BUILD_TESTS=ON | A way to turn on tools explicitly is missing. If tests/examples |
| | -DQT_BUILD_EXAMPLES=ON | are enabled, you can disable their building as part of the |
| | | 'all' target by also passing -DQT_BUILD_TESTS_BY_DEFAULT=OFF or |

View File

@ -167,7 +167,9 @@ Build environment:
Component selection:
-skip <repo> ......... Exclude an entire repository from the build.
-skip <repo>[,<repo>] Exclude one or more entire repositories from the
build. The list should be separated with commas.
e.g. -skip qtimageformats,qtsvg
-make <part> ......... Add <part> to the list of parts to be built.
Specifying this option clears the default list first.
(allowed values: libs, tools, examples, tests,