[CMake] Compiler detection on mac

Jaime Frey jfrey at cs.wisc.edu
Wed Jun 20 00:57:24 EDT 2012


With cmake 2.8.8, if you have both cc/c++ and gcc/g++ in your path, cmake will choose to use gcc and c++. This is because the default search orders in CMakeDetermineCCompiler.cmake and CMakeDetermineCXXCompiler.cmake are different. Up until now, this hasn't been a problem for us, as cc/c++ and gcc/g++ pointed to the same compilers.

But on our newest mac build machine, cc/c++ invoke the clang compiler instead of the llvm gnu compiler. Our project uses a mix of C and C++, which are now being built with different compilers by default.

I know we can pick the compilers we want to use by setting CC and CXX in the environment, but it'd be nice if we could get a consistent set of compilers by default, especially for our users who want to build our code.

+--------------------------------+-----------------------------------+
|           Jaime Frey           | I used to be a heavy gambler.     |
|       jfrey at cs.wisc.edu        | But now I just make mental bets.  |
|                                | That's how I lost my mind.        |
+--------------------------------+-----------------------------------+



More information about the CMake mailing list