Pmundts answer is the correct one. The most efficient solution for this problem is, t consequently make use of the cmake-kits.json and configure a CMAKE toolchain file for each embedded target/processor. You then don't need to source the environment variables each time you want to cross-build or cross-debug your project.