sysbuild: set APPLICATION_BINARY_DIR to sysbuild CMake folder

If not defined by caller, then set APPLICATION_BINARY_DIR to
CMAKE_CURRENT_BINARY_DIR. This is normally be done by
`find_package(Zephyr)`, but due to the indirection introduced with
fc1884ecf5 to allow applications to
provide their own sysbuild entry point, then the APPLICATION_BINARY_DIR
is unexpectedly set to the bin dir of the entry point.

Restore the old behavior so that APPLICATION_BINARY_DIR per default
again points to top-level sysbuild binary dir.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2024-06-13 09:09:36 +02:00 committed by Anas Nashif
commit a54c117223

View file

@ -16,6 +16,10 @@ set(Sysbuild_DIR ${CMAKE_CURRENT_LIST_DIR}/../sysbuild-package/cmake)
project(sysbuild_toplevel LANGUAGES)
if(NOT DEFINED APPLICATION_BINARY_DIR)
set(APPLICATION_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Application Binary Directory")
endif()
if(EXISTS ${APP_DIR}/sysbuild/CMakeLists.txt)
add_subdirectory(${APP_DIR}/sysbuild sysbuild/application)
else()