~aleteoryx/muditaos

ref: 80c5d5b4ef5ff35886b503afe026d135c675015c muditaos/cmake/modules/GenUpdateVersionJson.cmake -rw-r--r-- 676 bytes
80c5d5b4 — Radoslaw Wicik [EGD-6642] Fix googletest gui 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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}/cmake/modules")
include(Version)

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

message("preparing version file")
configure_file(
    ${SRC_DIR}/config/version.json.cmake_template
    ${CMAKE_BINARY_DIR}/version.json
    @ONLY
    )