1# SPDX-License-Identifier: Apache-2.0
2
3cmake_minimum_required(VERSION 3.20.0)
4find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5project(gen_inc_file)
6
7FILE(GLOB app_sources src/*.c)
8target_sources(app PRIVATE ${app_sources})
9
10# Write the generated file into the include/generated directory, which
11# is already in the system path
12set(gen_dir ${ZEPHYR_BINARY_DIR}/include/generated/)
13set(source_file src/file.bin)
14
15generate_inc_file_for_target(app ${source_file} ${gen_dir}/file.bin.inc)
16generate_inc_file_for_target(app ${source_file} ${gen_dir}/file.bin.partial.inc
17  --offset=100 --length=42)
18generate_inc_file_for_target(app ${source_file} ${gen_dir}/file.bin.gz.inc --gzip)
19generate_inc_file_for_target(app ${source_file} ${gen_dir}/file.bin.mtime.gz.inc
20  --gzip --gzip-mtime=42)
21generate_inc_file_for_target(app ${source_file} ${gen_dir}/file.bin.partial.gz.inc
22  --gzip --offset=100 --length=42)
23