diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-02-02 17:04:44 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-04 02:49:13 +0000 |
commit | a77c2694bdfaf6c9922511aa6a0703f246d8b2cd (patch) | |
tree | 1281a76fcb993420d392d3b2a57a01935a15b9b6 /cmake | |
parent | 35aa62cea30d2f3901c51d119d731ce3b152759c (diff) |
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
Change-Id: I6a48828b2fd7cec9f6e19988f7b4033333768abb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 40155ddd0ebec827b315549c5d528d8d3070f5fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtProcessConfigureArgs.cmake | 17 | ||||
-rw-r--r-- | cmake/configure-cmake-mapping.md | 2 |
2 files changed, 16 insertions, 3 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 2440f63627..2a92ba6f83 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -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}") diff --git a/cmake/configure-cmake-mapping.md b/cmake/configure-cmake-mapping.md index 118371518d..7fd0efda17 100644 --- a/cmake/configure-cmake-mapping.md +++ b/cmake/configure-cmake-mapping.md @@ -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 | |