Multi-config generator with multiple toolchains?

We are currently working on some products that have multiple different microcontrollers (with different compilers as well).
We always use CMake together with ninja, for which a multi-config generator exists.

In our current workflow, we have a CMakePresets.json that specifies configuration presets for the different microcontrollers (using different toolchain files).
The multi-config aspect got me thinking: would it be possible to have use multiple toolchains alongside each other using a multi-config generator as well?

Did anyone every try something like this?

No, this wouldn’t work because there is still only one configure-time CMAKE_CXX_COMPILER_ID and the like. It would only work if we banned configure-time requests of things like that and instead all such logic had to be baked into generator expressions. Of particular interest for your use case would be CMAKE_SYSTEM_PROCESSOR for which I don’t think we even have generator expressions.

Thanks for the feedback. I’ll guess we’ll just stick with our current workflow then :wink: