CMake for cross-compiling but using VS Code/VS Studio

I use CMake 3.31.6 for building a 2 applications for 2 microcontrollers in the project.

Unfortunately, they are two different microcontrollers and required two different toolchain setups.

Currently we essentially have created a VS Studio project by hand, and two makefile project to actually build the project. We have been unsuccessful in generating a VS Studio project that correctly builds the ELF/HEX output file.

2 Questions:

  1. is there a way to build a VS Studio project that uses a toolchain?
  2. Is there away to have a “root/master” project that has two subprojects that are for different tool chains?

If I have to move to CMake 4 for this, I will gladly :slight_smile: