-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
29 lines (23 loc) · 1.08 KB
/
CMakeLists.txt
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
# The following lines of boilerplate must be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ZigUSB)
# Add a custom command that will be executed before building the main target
add_custom_target(PreBuildCommand
COMMAND ${CMAKE_COMMAND} -E echo "Executing update version script..."
COMMAND bash ${CMAKE_SOURCE_DIR}/tools/update_version.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Update version script finish!"
)
# Add a dependency of the main project on PreBuildCommand build target
add_dependencies(${CMAKE_PROJECT_NAME}.elf PreBuildCommand)
# Define a custom target for the OTA script
add_custom_target(make_ota ALL
COMMAND ${CMAKE_COMMAND} -E echo "Executing make OTA script..."
COMMAND bash ${CMAKE_SOURCE_DIR}/tools/make_ota.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Make OTA script finish!"
)
# Add a dependency of make_ota target on the main project build target
add_dependencies(make_ota ${CMAKE_PROJECT_NAME}.elf)