How to specify a compiler in CMake?

To select a specific compiler, you have several solutions, as exaplained in CMake wiki: Method 1: use environment variables For C and C++, set the CC and CXX environment variables. This method is not guaranteed to work for all generators. (Specifically, if you are trying to set Xcode’s GCC_VERSION, this method confuses Xcode.) For example: … Read more