I work on a big Cortex-M project with arm-none-eabi-gcc, cmake and ninja-build.
The current build process is a bash script which consists of 4 parts:
- Execute pre-cmake-build bash instruction (also here, some files are generated EVERY TIME like git_version_info.h etc)
- Execute cmake …
- Execute ninja
- Execute post-cmake-build bash instructions
Now what i want to achieve is moving part 1 and part 4 into a pre and post build bash script, and remove the other one, so i can make it work with CLion.
Im terribly failing to find a command for cmake that lets me execute a bash script:
A.) every time a build, even if there is no change in coding
B.) that actually PRE_BUILD executes.
add_custom_command does not work, as PRE_BUILD is equal to PRE_LINK, therefore the build fails since header files are missing.
Can someone help me write this cmakelists file so the bash script will actually execute BEFORE cmake generates files and ninja executes the compilation?