How to specify new GCC path for CMake
Do not overwrite CMAKE_C_COMPILER, but export CC (and CXX) before calling cmake: export CC=/usr/local/bin/gcc export CXX=/usr/local/bin/g++ cmake /path/to/your/project make The export only needs to be done once, the first time you configure the project, then those values will be read from the CMake cache. UPDATE: longer explanation on why not overriding CMAKE_C(XX)_COMPILER after Jake’s comment … Read more