cmake: sysbuild: Add support for recurive target cmake inclusion

Adds support for all sysbuild targets to have a sysbuild.cmake file
included and processed as part of sysbuild instead of just the main
application.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2022-10-11 09:40:12 +01:00 committed by Carles Cufí
parent 4fe3534a4f
commit b65699cc4a

View file

@ -68,6 +68,20 @@ add_subdirectory(bootloader)
# This allows for board and app specific images to be included.
include(${BOARD_DIR}/sysbuild.cmake OPTIONAL)
include(${APP_DIR}/sysbuild.cmake OPTIONAL)
# This allows image specific sysbuild.cmake to be processed.
list(LENGTH IMAGES images_length)
while(NOT "${images_length}" EQUAL "${processed_length}")
foreach(image ${IMAGES})
if(NOT image IN_LIST images_sysbuild_processed)
ExternalProject_Get_property(${image} SOURCE_DIR)
include(${SOURCE_DIR}/sysbuild.cmake OPTIONAL)
list(APPEND images_sysbuild_processed ${image})
endif()
endforeach()
list(LENGTH images_sysbuild_processed processed_length)
list(LENGTH IMAGES images_length)
endwhile()
include(cmake/domains.cmake)