From c746f27e17d255e197e68b6d65c509865d3b9108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 16 Mar 2021 16:18:44 +0100 Subject: [PATCH] cmake: Allow specifying list of submodules using environment The variable now has a QT prefix to make it less likely to clash with other environment variables. For simplicity we use the same variable name internally. Change-Id: I4c8b1a43ae1facc2e33ae3cd21a8f6b43a437a9b Reviewed-by: Joerg Bornemann Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb092c7d..8e894cb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,15 +38,19 @@ endif() set(QT_SUPERBUILD TRUE) # Get submodule list if not already defined -if (NOT BUILD_SUBMODULES) - qt_internal_find_modules(BUILD_SUBMODULES) +if(NOT QT_BUILD_SUBMODULES) + if(DEFINED ENV{QT_BUILD_SUBMODULES}) + set(QT_BUILD_SUBMODULES "$ENV{QT_BUILD_SUBMODULES}") + else() + qt_internal_find_modules(QT_BUILD_SUBMODULES) + endif() endif() set(qt_module_dependency_map_prefix "__qt_module_dependencies_") -qt_internal_sort_module_dependencies("${BUILD_SUBMODULES}" BUILD_SUBMODULES +qt_internal_sort_module_dependencies("${QT_BUILD_SUBMODULES}" QT_BUILD_SUBMODULES "${qt_module_dependency_map_prefix}") -foreach(module IN LISTS BUILD_SUBMODULES) +foreach(module IN LISTS QT_BUILD_SUBMODULES) # Check for unmet dependencies if(NOT DEFINED BUILD_${module} OR BUILD_${module}) message(NOTICE "Checking dependencies of '${module}'") @@ -83,7 +87,7 @@ foreach(module IN LISTS BUILD_SUBMODULES) endif() endforeach() -foreach(module IN LISTS BUILD_SUBMODULES) +foreach(module IN LISTS QT_BUILD_SUBMODULES) message(NOTICE "Configuring '${module}'") ecm_optional_add_subdirectory("${module}")