1#
2# Copyright (c) 2023 Nordic Semiconductor ASA
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7cmake_minimum_required(VERSION 3.20.0)
8find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
9project(mcuboot_recovery_retention)
10
11if(NOT (DEFINED SYSBUILD))
12  message(FATAL_ERROR "This test must be built with sysbuild.")
13endif()
14
15FILE(GLOB app_sources
16	src/*.c
17)
18
19target_sources(app PRIVATE ${app_sources})
20
21# Get MCUboot version from the VERSION file in the repository and create a local output header
22# version file so that it can be compared against in the test
23set(VERSION_FILE ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/VERSION)
24set(VERSION_TYPE MCUBOOT)
25set(BUILD_VERSION_NAME MCUBOOT_BUILD_VERSION)
26include(${ZEPHYR_BASE}/cmake/modules/version.cmake)
27file(READ ${ZEPHYR_BASE}/version.h.in version_content)
28string(CONFIGURE "${version_content}" version_content)
29string(CONFIGURE "${version_content}" version_content)
30file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/zephyr/include/generated/mcuboot_version.h "${version_content}")
31