diff --git a/cmake/QtIRHelpers.cmake b/cmake/QtIRHelpers.cmake index 3b20fa1e..7327ed18 100644 --- a/cmake/QtIRHelpers.cmake +++ b/cmake/QtIRHelpers.cmake @@ -102,6 +102,8 @@ endfunction() # into the final list of submodules to be included and excluded, which are then translated # to configure -submodules and -skip options. function(qt_ir_get_args_from_optfile_configure_filtered optfile_path out_var) + cmake_parse_arguments(arg "ALREADY_INITIALIZED" "" "" ${ARGV}) + # Get args unknown to init-repository, and pass them to configure as-is. qt_ir_get_unknown_args(unknown_args) @@ -114,6 +116,9 @@ function(qt_ir_get_args_from_optfile_configure_filtered optfile_path out_var) qt_ir_get_option_value(module-subset submodules) if(submodules) qt_ir_get_top_level_submodules(include_submodules exclude_submodules) + if(NOT include_submodules AND arg_ALREADY_INITIALIZED) + set(include_submodules "${submodules}") + endif() # qtrepotools is always implicitly cloned, but it doesn't actually # have a CMakeLists.txt, so remove it. diff --git a/cmake/QtTopLevelHelpers.cmake b/cmake/QtTopLevelHelpers.cmake index c7058efb..1198771e 100644 --- a/cmake/QtTopLevelHelpers.cmake +++ b/cmake/QtTopLevelHelpers.cmake @@ -7,10 +7,14 @@ macro(qt_tl_include_all_helpers) endmacro() function(qt_tl_run_toplevel_configure top_level_src_path) + cmake_parse_arguments(arg "ALREADY_INITIALIZED" "" "" ${ARGV}) + + qt_ir_get_cmake_flag(ALREADY_INITIALIZED arg_ALREADY_INITIALIZED) + # Filter out init-repository specific arguments before passing them to # configure. - qt_ir_get_args_from_optfile_configure_filtered("${OPTFILE}" configure_args) - + qt_ir_get_args_from_optfile_configure_filtered("${OPTFILE}" configure_args + ${arg_ALREADY_INITIALIZED}) # Get the path to the qtbase configure script. set(qtbase_dir_name "qtbase") set(configure_path "${top_level_src_path}/${qtbase_dir_name}/configure") @@ -50,7 +54,7 @@ function(qt_tl_run_main_script) endif() # Then run configure out-of-process. - qt_tl_run_toplevel_configure("${TOP_LEVEL_SRC_PATH}") + qt_tl_run_toplevel_configure("${TOP_LEVEL_SRC_PATH}" ${exit_reason}) endfunction() # Populates $out_module_list with all subdirectories that have a CMakeLists.txt file