I’m working on an embedded project built on top of IAR Embedded Workbench.
One of the tasks I’m working on here is adding unit tests that will be running in a host environment (Windows for the devs and Linux for CI). I’m using CMake as the build tool for this job.
One of the cumbersome things I want to deal with is the number of include paths specified in the IAR project. Each time tests or code are added, this include list grown within the IAR project and the top level CMakeLists.txt needs to be updated as well. I know this is not the CMake way of doing things, but well I have to treat the IAR project as the source of truth.
What I thought I might do is use a script, that I already have, to extract the include paths from the IAR project and use it with the include_directories command. Maybe use a custom target called includes.cmake or something that depends on the IAR project.
Would this work?
is there a better way to approach this?