@@ -801,6 +801,46 @@ debug the application.
801801.. _MCUboot with Zephyr : https://docs.mcuboot.com/readme-zephyr
802802.. _ExternalProject : https://cmake.org/cmake/help/latest/module/ExternalProject.html
803803
804+ .. _sysbuild_var_override :
805+
806+ Configuring sysbuild internal state
807+ ***********************************
808+
809+ Because sysbuild is a CMake project in it's own right, it runs and sets up itself similar to a
810+ Zephyr application but using it's own CMake code. This means that some features, for example
811+ specifying variables in an application ``CMakeLists.txt `` (such as ``BOARD_ROOT ``) will not work,
812+ instead these must be set by using a :ref: `a module <modules_build_settings >` or by using a custom
813+ sysbuild project file as ``<application>/sysbuild/CMakeLists.txt ``, for example:
814+
815+ .. code-block :: cmake
816+
817+ # Place pre-sysbuild configuration items here
818+
819+ # For changing configuration that sysbuild itself uses:
820+ # set(<var> <value>)
821+ # list(APPEND <list> <value>)
822+
823+ # For changing configuration of other images:
824+ # set(<image>_<var> <value> CACHE INTERNAL "<description>")
825+
826+ # Finds the sysbuild project and includes it with the new configuration
827+ find_package(Sysbuild REQUIRED HINTS $ENV{ZEPHYR_BASE})
828+
829+ project(sysbuild LANGUAGES)
830+
831+ An example of adding a ``BOARD_ROOT ``:
832+
833+ .. code-block :: cmake
834+
835+ list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../<extra-board-root>)
836+
837+ find_package(Sysbuild REQUIRED HINTS $ENV{ZEPHYR_BASE})
838+
839+ project(sysbuild LANGUAGES)
840+
841+ This will pass the board root on to all images as part of a project, it does not need to be
842+ repeated in each image's ``CMakeLists.txt `` file.
843+
804844Extending sysbuild
805845******************
806846
0 commit comments