Add combined hex target to CMake

pull/7762/head
kert 2018-08-11 10:54:20 -07:00
parent 2a824a1ceb
commit 17276275fc
1 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,16 @@ add_custom_command(TARGET {{name}} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:{{name}}>.hex"
)
{% if hex_files %}
add_custom_command(TARGET {{name}} POST_BUILD
COMMAND ${SREC_CAT}
{% for f in hex_files %}${CMAKE_CURRENT_SOURCE_DIR}/{{f}} {% endfor %}
-intel $<TARGET_FILE:{{name}}>.hex
-intel -o $<TARGET_FILE:{{name}}>-combined.hex -intel --line-length=44
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:{{name}}>-combined.hex"
)
{% endif %}
##########################################################################
# mbed-cli specific targets