Merge pull request #7762 from kaidokert/master

Add combined hex target to CMake
pull/7592/head
Martin Kojtal 2018-08-22 14:05:53 +02:00 committed by GitHub
commit d719c9e1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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