[CMake] How does CMake decide which compiler it should use?

Alexander Neundorf a.neundorf-work at gmx.net
Wed Aug 21 16:45:41 EDT 2013


On Thursday 08 August 2013, Bo Berglund wrote:
> I have one instance of C++Builder XE4 installed and when I run CMake
> it goes about testing the compiler before reaching the point where I
> can select any sources to generate makefiles for.
> 
> But if I install two older versions of C++Builder in addition to the
> XE4 version, there will be 3 complete C++Builder installations each
> with its own compiler and toolchain.
> 
> I may also install Visual Studio 6 and Visual Studio 2012 adding to
> the confusion by now having 2 more toolchains on the same computer.

It searches for some default compiler names it knows, it searches for compiler 
names based on the generator you selected, and it checks the CC and CXX 
environment variables. If these are set, it uses those.
When using MSVS, IIRC you have a terminal entry in the start menu which opens 
a terminal with all the environment variables set up properly for that 
compiler. Start cmake from there, and it will find that compiler.

Maybe there is something similar with C++Builder ?

Alex


More information about the CMake mailing list