Adding extra_post_build step from out of tree application

I'm using NCS v2.3.0.

I am trying to add an additional step for post build processing.  My application is out of tree, and if possible I'm trying to keep my changes limited to the application folder.

I found other tickets recommending extra_post_build_commands, however I do not find any examples of using this extra_post_build_command from the application directory.

As a test I inserted my commands into zephyr/modules/trusted-firmware-m/CmakeLists.txt  and found that it was running but not at the conclusion of building the application.  It was being run during mcuboot generation.

Is there a way to add post build steps from an out of tree application?

Is it necessary to modify the NCS repo/source to use the extra_post_build_commands?  

If so, which CMakeLists.txt should I change to run a step after all child images are built?

Related