CMake Specify Compiler
CMake Specify Compiler
cmake -DCMAKE_C_COMPILER:FILEPATH=/path/to/gcc-11 -DCMAKE_CXX_COMPILER:FILEPATH=/path/to/g++-11 ..
export CC=/path/to/gcc-11
export CXX=/path/to/gcc-11
make <target>
Note:
CMAKE_C_COMPILER
should not be set inCMakeLists
withset
instead we pass it as an argument and get it checked inCMakeCache