From a54c117223dd24e13e3324db1fd58a2afd599027 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Thu, 13 Jun 2024 09:09:36 +0200 Subject: [PATCH] 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 fc1884ecf59000aa6e4a40bb4bd772bd5e947415 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 --- share/sysbuild/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/sysbuild/CMakeLists.txt b/share/sysbuild/CMakeLists.txt index f4d5178448b29b..f856b99411ef5a 100644 --- a/share/sysbuild/CMakeLists.txt +++ b/share/sysbuild/CMakeLists.txt @@ -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()