On Monday 04 March 2013, Daniel Russel wrote:
> I'm not very clear on how cmake chooses which compiler it uses by default.
> Specifically, we have a system where a there is an old version of gcc
> installed in the system and then a newer version installed elsewhere, but
> in the PATH (so running g++ or gcc finds the new version). However, cmake
> uses the old version unless we explicitly set the CMAKE_CXX_COMPILER. Is
> this what is supposed to happen? I couldn't find docs on how the default
> compiler is picked. Thanks. --

By default, it searches for a list of known compiler names:
cc, gcc, cl, bcc, xlc, clang
In that order, in PATH.
If you set the CC (or CXX respectively) environment variable, it will use this 
compiler. This is the recommended way how to point cmake to a specific 
compiler.

Alex
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to