~aleteoryx/muditaos

ref: 1a26cdb407c14dd46d4232e61095999b7bd032e7 muditaos/config/GenUpdateVersionJson.cmake -rw-r--r-- 663 bytes
1a26cdb4 — Borys Jelenski [EGD-4527] Add creating update package as CMake target 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# This script generates the version.json file which contains project
# and bootloader version information for update packages . It is meant to be run
# at build time by running CMake as a target.

list(APPEND CMAKE_MODULE_PATH "${SRC_DIR}/config")
include(Version)

set(BOOTLOADER_INCLUDED "true")
set(BOOTLOADER_FILENAME "ecoboot.bin")
execute_process(
    COMMAND grep "release:" "${CMAKE_BINARY_DIR}/update/download_info.txt"
    COMMAND awk "{print $2}"
    OUTPUT_VARIABLE BOOTLOADER_VERSION
    OUTPUT_STRIP_TRAILING_WHITESPACE
)

configure_file(
    ${SRC_DIR}/config/version.json.cmake_template
    ${CMAKE_BINARY_DIR}/update/version.json
    @ONLY
    )