2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-12-11 23:33:23 +08:00
|
|
|
cmake_minimum_required(VERSION 3.13.1)
|
2020-05-29 08:58:50 +08:00
|
|
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
2018-10-25 22:54:09 +08:00
|
|
|
project(gen_inc_file)
|
2017-10-27 21:43:34 +08:00
|
|
|
|
|
|
|
FILE(GLOB app_sources src/*.c)
|
|
|
|
target_sources(app PRIVATE ${app_sources})
|
|
|
|
|
|
|
|
# Write the generated file into the include/generated directory, which
|
|
|
|
# is already in the system path
|
|
|
|
set(gen_dir ${ZEPHYR_BINARY_DIR}/include/generated/)
|
|
|
|
set(source_file src/file.bin)
|
|
|
|
|
|
|
|
generate_inc_file_for_target(app ${source_file} ${gen_dir}/file.bin.inc)
|
|
|
|
generate_inc_file_for_target(app ${source_file} ${gen_dir}/file.bin.gz.inc --gzip)
|
2019-03-22 05:40:45 +08:00
|
|
|
generate_inc_file_for_target(app ${source_file} ${gen_dir}/file.bin.mtime.gz.inc
|
|
|
|
--gzip --gzip-mtime=42)
|