Debug options for CMake
In this section:
Preparing a CMake project for debugging:
Choose Project>Options>General Options>Target and make sure that all options reflect the options you have set in CMake for the project.
Now the project is ready for debugging using the IAR C-SPY Debugger.