-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
mesh_dfu_metadata.cmake
47 lines (40 loc) · 1.1 KB
/
mesh_dfu_metadata.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
find_package(Python3 REQUIRED)
function(mesh_dfu_metadata)
if(SYSBUILD)
set(metadata_dir ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr)
else()
set(metadata_dir ${PROJECT_BINARY_DIR})
endif()
set(metadata_depends ${CMAKE_BINARY_DIR}/dfu_application.zip)
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/dfu_application.zip_ble_mesh_metadata.json
COMMAND
${PYTHON_EXECUTABLE}
${ZEPHYR_NRF_MODULE_DIR}/scripts/bluetooth/mesh/mesh_dfu_metadata.py
--bin-path ${metadata_dir}
DEPENDS ${metadata_depends}
)
add_custom_target(
parse_mesh_metadata
ALL
DEPENDS ${PROJECT_BINARY_DIR}/dfu_application.zip_ble_mesh_metadata.json
)
add_custom_target(
# Prints already generated metadata
ble_mesh_dfu_metadata
COMMAND
${PYTHON_EXECUTABLE}
${ZEPHYR_NRF_MODULE_DIR}/scripts/bluetooth/mesh/mesh_dfu_metadata.py
--bin-path ${PROJECT_BINARY_DIR}
--print-metadata
COMMAND_EXPAND_LISTS
)
endfunction()
if(SYSBUILD)
mesh_dfu_metadata()
endif()