This commit refactors sysbuild entry code by creating a CMake sysbuild module for image processing and place sysbuild entry code in a <app>/sysbuild/CMakeLists.txt file. A template/CMakeLists.txt file will be use as template for applications which doesn't provide their own entry file. An application may create a sysbuild/CMakeLists.txt file. The sysbuild/CMakeLists.txt file is similar in nature to the toplevel CMakeLists.txt file but intended to used by sysbuild. This allows application developers to adjust how an application is built with sysbuild. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
24 lines
751 B
CMake
24 lines
751 B
CMake
# Copyright (c) 2021-2023 Nordic Semiconductor
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
cmake_minimum_required(VERSION 3.20)
|
|
|
|
if(NOT DEFINED APP_DIR)
|
|
message(FATAL_ERROR "No main application specified")
|
|
endif()
|
|
|
|
# This will update the APP_DIR cache variable to PATH type and apply a comment.
|
|
# If APP_DIR is a relative path, then CMake will adjust to absolute path based
|
|
# on current working dir.
|
|
set(APP_DIR ${APP_DIR} CACHE PATH "Main Application Source Directory")
|
|
set(Sysbuild_DIR ${CMAKE_CURRENT_LIST_DIR}/../sysbuild-package/cmake)
|
|
|
|
project(sysbuild_toplevel LANGUAGES)
|
|
|
|
if(EXISTS ${APP_DIR}/sysbuild/CMakeLists.txt)
|
|
add_subdirectory(${APP_DIR}/sysbuild sysbuild/application)
|
|
else()
|
|
add_subdirectory(template sysbuild/application)
|
|
endif()
|