I can't find any info on it, but only the other way around (e.g., how to set CMake to use clang).
I've installed gcc-4.8 using brew, setup all dependencies, headers, etc, and now CMake refuses to use gcc.
I've set my bash profile with both aliases and actual entries:
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
alias gcc='gcc-4.8'
alias cc='gcc-4.8'
alias g++='g++-4.8'
alias c++='c++-4.8'
Yet CMake stubbornly refuses to use gcc and instead reverts back to clang:
air:build alex$ cmake -DCMAKE_BUILD_TYPE=DEBUG ..
-- The C compiler identification is Clang 5.1.0
-- The CXX compiler identification is Clang 5.1.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…