build: add versioned firmware artifact

This commit is contained in:
chenjintao
2026-08-19 10:32:31 +08:00
parent 22a409973e
commit f5b4bd8110
+14
View File
@@ -6,3 +6,17 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# "Trim" the build. Include the minimal set of components, main, and anything it depends on. # "Trim" the build. Include the minimal set of components, main, and anything it depends on.
idf_build_set_property(MINIMAL_BUILD ON) idf_build_set_property(MINIMAL_BUILD ON)
project(TQ_Cat_Code) project(TQ_Cat_Code)
idf_build_get_property(TQ_PROJECT_VERSION PROJECT_VER)
set(TQ_VERSIONED_FIRMWARE
"${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${TQ_PROJECT_VERSION}.bin")
add_custom_target(versioned_firmware ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin"
"${TQ_VERSIONED_FIRMWARE}"
DEPENDS app
BYPRODUCTS "${TQ_VERSIONED_FIRMWARE}"
COMMENT "Creating versioned firmware ${CMAKE_PROJECT_NAME}-${TQ_PROJECT_VERSION}.bin"
VERBATIM
)