title: cmake and default compilers
body: <p>I have recently updated my OS X to Mountain Lion. Unfortunately FreeBSD switched to a compiler suite (llvm/clang) that does not support OpenMP, that I need, and Apple set that suite as the default compilation tools.</p>
  
  <p>Fortunately OS X 10.8 includes an old gcc 4.2 compiler, that can still be used for some legacy code.</p>
  
  <p>I build the programs using cmake (v2.8). In order to use the gcc compiler, I first tried to set two variables in the CMakeLists.txt script. More specifically, I set <code>CMAKE_C_COMPILER</code> and <code>CMAKE_CXX_COMPILER</code>. However, setting these two variables had no effect: cmake kept using the llvm compiler not supporting OpenMP.</p>
  
  <p>Then I tried to set two environment variables, <code>CC</code> and <code>CXX</code> (in the .profile/.bashrc script), pointing to the same compilers used for the CMake variables. By using these two variables, I am able to compile my source code.</p>
  
  <p>My question is: what's the point of the two CMake variables (CMAKE_..._COMPILER)? How am I supposed to use them?</p>
  
  <p>Thanks.</p>