Skip to content

Invoking IAR binary utilities

Felipe Torrezan edited this page Nov 30, 2024 · 10 revisions

Starting from CMake v3.31.0, it is possible to invoke the following IAR binary utilities from within a CMake project.

Tool Variable
IAR ELF Dumper CMAKE_IAR_ELFDUMP
IAR ELF Tool CMAKE_IAR_ELFTOOL
IAR ELF Exe to Object Tool CMAKE_IAR_EXE2OBJ
IAR Object File Manipulator CMAKE_IAR_OBJMANIP
IAR Absolute Symbol Exporter CMAKE_IAR_SYMEXPORT

Important

Please notice that these references expect their respective tools being available in the installed toolchain.

Example

In the example below, the IAR ELF Tool is invoked at the post build stage for converting the ELF file, built from myTarget, to the Intel Extended format (*.hex):

add_custom_command(TARGET myTarget POST_BUILD 
                   COMMAND ${CMAKE_IAR_ELFTOOL} --silent --ihex $<TARGET_FILE:myTarget> myTarget.hex)

Related resources

Clone this wiki locally