title: How can I make CMake use GCC instead of Clang on Mac OS X?
body: <p>I can't find any info on it, but only the other way around (e.g., how to set CMake to use clang).</p>
  
  <p>I've installed gcc-4.8 using brew, setup all dependencies, headers, etc, and now CMake refuses to use gcc.</p>
  
  <p>I've set my bash profile with both aliases and actual entries:</p>
  
  <pre><code>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'
  </code></pre>
  
  <p>Yet CMake stubbornly refuses to use gcc and instead reverts back to clang:</p>
  
  <pre><code>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
  </code></pre>