mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
CMake: Enable Kconfig generation for external directories
Currently, nuttx_generate_kconfig() can only parse subdirectories under apps/. This patch extends its capability to also parse external directories referenced from the apps tree. Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
parent
fd70e5f947
commit
c5f85f8275
1 changed files with 12 additions and 1 deletions
|
|
@ -117,6 +117,8 @@ function(nuttx_generate_kconfig)
|
|||
nuttx_generate_kconfig
|
||||
ONE_VALUE
|
||||
MENUDESC
|
||||
MULTI_VALUE
|
||||
EXTERNAL_DIRECTORIES
|
||||
REQUIRED
|
||||
ARGN
|
||||
${ARGN})
|
||||
|
|
@ -143,12 +145,21 @@ function(nuttx_generate_kconfig)
|
|||
LIST_DIRECTORIES false
|
||||
${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/*/CMakeLists.txt)
|
||||
|
||||
if(NOT MENUDESC)
|
||||
set(EXTERNAL_CMAKESCRIPTS)
|
||||
foreach(external_dir ${EXTERNAL_DIRECTORIES})
|
||||
if(EXISTS ${external_dir}/CMakeLists.txt)
|
||||
list(APPEND EXTERNAL_CMAKESCRIPTS "${external_dir}/CMakeLists.txt")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# we need to recursively generate the Kconfig menus of multi-level
|
||||
# directories.
|
||||
#
|
||||
# when generating a Kconfig file for the current directory, it should include
|
||||
# and invoke all the Kconfig files gathered from its subdirectories.
|
||||
foreach(SUB_CMAKESCRIPT ${SUB_CMAKESCRIPTS})
|
||||
foreach(SUB_CMAKESCRIPT ${SUB_CMAKESCRIPTS} ${EXTERNAL_CMAKESCRIPTS})
|
||||
string(REPLACE "CMakeLists.txt" "Kconfig" SUB_KCONFIG ${SUB_CMAKESCRIPT})
|
||||
string(REPLACE "/" "_" MENUCONFIG ${SUB_KCONFIG})
|
||||
if(WIN32)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue