I'm working on a robot that consists of an ARM based SBC with an AVR based control board and would like to use CMake to manage the builds.
My desire is to just run CMake once and have the build process go through and compile each binary, then embed the AVR firmware into the image for the ARM SBC so that the ARM software can check and update the MCU as needed and without having to manually run 3 independent build process.
From what I'm reading, CMake doesn't like working with more than a single toolchain and thus is not capable of doing what I want it to, which would make sense given the CMAKE_*_COMPILER variables. However, with CMake being such a complex and featureful system, I get the impression that the issue lies more in that it requires some more legwork to actually get it working, but I'm not sure where to start with this. I have clobbered together a handful of CMakeLists in the past, but they have generally not been very complex, so I am not well-versed in everything CMake has to offer when it comes to things that extend beyond basic build needs.
As a bonus, I want this to be something that I can use from VS Code/Codium, and at a glance, the CMake extension doesn't seem to particularly like having multiple, unrelated CMakeLists in the workspace.
To try and summarize, I want CMake to:
- Build the MCU firmware using Toolchain A.
- Build the software for the ARM SBC using Toolchain B.
- Build a Linux-based image containing both that will be written to an SD card.
Are there any existing resources that cover this scenario? Where do I start with this? Do I just have to bite the bullet and stick with Make?