Executing a Post Build Batch File using CMake
Build Environment Details
What I am Trying to Achieve
At the end of my build process, I would like to execute a batch file on the zephyr_final target that signs the final image. This is different than the MCU Boot signature and is a custom proprietary signature. I am unable to change the way in which this image is signed as it must be compatible with existing tools used with my product.
Method in Which I am trying to Achieve
Normally, I would do this using add_custom_command(TARGET target_name POST_BUILD
COMMAND "batchfile.bat" batchfile_arguments)
However, I don't believe that the final zephyr target is within the scope of the top-level CMakeLists.txt file. That said, I do not have a lot of experience with CMake as most of my past development was within the IAR toolchain. It's very possible that I am misinterpreting this.
1. Will I be able to use the add_custom_command() CMake function to execute the batch file? If so, can someone provide an example as to how I would do this and what Target I should be using.
2. Is there a better, more appropriate method for doing this within the Zephyr environment.
Any help or guidance is much appreciated!