summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-02-02 16:46:49 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-04 10:16:16 +0000
commit9c4b0a7c0fa80a0f541834848a1da13e8f58d985 (patch)
treeb9b09a6a98237bb2b60ce7958dd4d71b7dad041c /cmake
parentbcc1ca6ee3870ffeecf950bb45230dd43b2d5162 (diff)
configure: Introduce -submodules option
The option is used to specify a list of Qt repos (git submodules) that should be included in the configuration of a top-level Qt build. The option takes a comma-separated list of qt submodule names e.g. 'qtbase,qtsvg,qtdeclarative' It can also take a single value like 'qtbase' or 'qtquick3d'. Each specified submodule and all of its transitive dependencies will be included when configuring the top-level Qt build (assuming that the submodules have previously been already checked out). Any missing submodules or dependencies will not be automatically checked out, but rather skipped. This can result in a failed configuration if a required submodule is missing. If some optional transitive submodule dependency is not desired in the build, you can combine the -submodules option together with -skip options. E.g. configuring with -submodules qtdoc,qtnetworkauth -skip qtmultimedia,qtimageformats will result in a top-level build with the following submodules: - qtbase (common dependency) - qttools (dependency of qtdoc) - qtactiveqt dependency of qttools) - qshadertools (dependency of qtdeclarative) - qtdeclarative (explicit) - qtnetworkauth (explicit) - qtdoc (explicit) Fixes: QTBUG-100388 Change-Id: Ie8c47cfd1d1e0e44a27260bf9ddf968531cc1cc0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7cb2bbd9e765bd90a2df06c7256d0306d669fbe6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtProcessConfigureArgs.cmake5
-rw-r--r--cmake/configure-cmake-mapping.md1
2 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index 280e561791..fecd28b509 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -91,6 +91,11 @@ while(NOT "${configure_args}" STREQUAL "")
foreach(qtrepo IN LISTS qtrepos)
push("-DBUILD_${qtrepo}=OFF")
endforeach()
+ elseif(arg STREQUAL "-submodules")
+ list(POP_FRONT configure_args submodules)
+ is_non_empty_valid_arg("${arg}" "${submodules}")
+ list(TRANSFORM submodules REPLACE "," "[[;]]")
+ push("-DQT_BUILD_SUBMODULES=${submodules}")
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 7fd0efda17..2470ff9096 100644
--- a/cmake/configure-cmake-mapping.md
+++ b/cmake/configure-cmake-mapping.md
@@ -96,6 +96,7 @@ The following table describes the mapping of configure options to CMake argument
| -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>,...,<repo_n> | -DBUILD_<repo>=OFF | |
+| -submodules <repo>,...,<repo_n> | -QT_BUILD_SUBMODULES=<repo>;...;<repo> | |
| -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 |