1#
2# Copyright (c) 2022 Nordic Semiconductor ASA
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7cmake_minimum_required(VERSION 3.20.0)
8
9set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/log_multidomain_remote-prefix/src/log_multidomain_remote-build/zephyr)
10
11if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpuapp")
12  set(BOARD_REMOTE "nrf5340dk_nrf5340_cpunet")
13else()
14  message(FATAL_ERROR "${BOARD} is not supported for this sample")
15endif()
16
17find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
18project(log_multidomain)
19
20target_sources(app PRIVATE src/main.c)
21
22if (CONFIG_IPC_SERVICE)
23  target_sources(app PRIVATE src/ipc_service.c)
24endif()
25
26include(ExternalProject)
27
28ExternalProject_Add(
29  log_multidomain_remote
30  SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
31  INSTALL_COMMAND ""      # This particular build system has no install command
32  CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
33  BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
34  BUILD_ALWAYS True
35)
36