Switching between GCC and Clang/LLVM using CMake
CMake honors the environment variables CC and CXX upon detecting the C and C++ compiler to use: $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++ $ cmake .. — The C compiler identification is Clang — The CXX compiler identification is Clang The compiler specific flags can be overridden by putting them into a make override file … Read more