Skip to content

Commit 1727627

Browse files
committed
Add combined hex target to CMake
1 parent 2a824a1 commit 1727627

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/export/cmake/CMakeLists.txt.tmpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ add_custom_command(TARGET {{name}} POST_BUILD
7171
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:{{name}}>.hex"
7272
)
7373

74+
{% if hex_files %}
75+
add_custom_command(TARGET {{name}} POST_BUILD
76+
COMMAND ${SREC_CAT}
77+
{% for f in hex_files %}${CMAKE_CURRENT_SOURCE_DIR}/{{f}} {% endfor %}
78+
-intel $<TARGET_FILE:{{name}}>.hex
79+
-intel -o $<TARGET_FILE:{{name}}>-combined.hex -intel --line-length=44
80+
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:{{name}}>-combined.hex"
81+
)
82+
{% endif %}
83+
7484

7585
##########################################################################
7686
# mbed-cli specific targets

0 commit comments

Comments
 (0)