Skip to content

Commit ad27a3e

Browse files
committed
CMake: pass application name to post-build hook
Pass the exact name to the post-build hook, when an application's or test's `CMakeLists.txt` calls `mbed_set_post_build()`. The interface is CMake's built-in mechanism: * `set_target_properties()` to set a property, e.g. application name * `$<TARGET_PROPERTY:target,property>` to query a property at run time
1 parent 3579bb6 commit ad27a3e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ function(mbed_generate_bin_hex target)
177177
# through the post-build process once.
178178
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${target}.elf)
179179

180+
# Pass the application's name to the Mbed target's post build operation
181+
set_target_properties(mbed-post-build-bin-${MBED_TARGET}
182+
PROPERTIES
183+
application ${target}
184+
)
185+
180186
# The artefacts must be created before they can be further manipulated
181187
add_dependencies(mbed-post-build-bin-${MBED_TARGET} ${target})
182188

0 commit comments

Comments
 (0)