summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-02-02 17:04:44 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-02-03 21:21:28 +0100
commit40155ddd0ebec827b315549c5d528d8d3070f5fb (patch)
tree4015319b1153461d35b9b4b65a9179e54c87a0e9 /cmake
parentb43528ea0089db3d1cefc2023babeeb3823f5cb9 (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 Pick-to: 6.2 6.3 Change-Id: I6a48828b2fd7cec9f6e19988f7b4033333768abb Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtProcessConfigureArgs.cmake17
-rw-r--r--cmake/configure-cmake-mapping.md2
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 |