From: Renz Christian Bagaporo Date: Tue, 11 Dec 2018 02:33:09 +0000 (+0800) Subject: cmake: list items in component config via alphabetical component name X-Git-Tag: v3.3-beta2~149^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16c88bf32061e5c1d6e36e1258b450d99b7e5610;p=esp-idf cmake: list items in component config via alphabetical component name --- diff --git a/tools/cmake/kconfig.cmake b/tools/cmake/kconfig.cmake index 05976aca66..e2e05c107b 100644 --- a/tools/cmake/kconfig.cmake +++ b/tools/cmake/kconfig.cmake @@ -77,9 +77,20 @@ function(kconfig_process_config) set(kconfigs) set(kconfigs_projbuild) + # Components are usually sorted (somewhat) topologically via their dependencies. This extends to the component + # paths list. Obtain an alphabetical list in order to present menus also in the same order. + set(components ${BUILD_COMPONENTS}) + list(SORT components) + + foreach(component ${components}) + list(FIND BUILD_COMPONENTS ${component} idx) + list(GET BUILD_COMPONENT_PATHS ${idx} component_path) + list(APPEND component_paths ${component_path}) + endforeach() + # Find Kconfig and Kconfig.projbuild for each component as applicable # if any of these change, cmake should rerun - foreach(dir ${BUILD_COMPONENT_PATHS}) + foreach(dir ${component_paths}) file(GLOB kconfig "${dir}/Kconfig") if(kconfig) set(kconfigs "${kconfigs} ${kconfig}")