[CMake] Using different compilers

Filipe Sousa filipe at ipb.pt
Tue Nov 8 16:21:54 EST 2005


On Tuesday 08 November 2005 18:09, Paulo Jabardo wrote:
> I'm developping  a program that will be executed in
> several different platforms and will consist of
> c,c++,fortran and yacc files. On some of these
> platforms, it is possible to use two different
> compilers, for instance gcc and the intel compilers.
>
> How can I specify the compiler the compiler I want to
> use in the CMakeLists.txt? The user could simply use
> the advanced mode options to specify the options but I
> think it would be interesting to use a set of "canned"
> options, such as :
> OPTION(USE_ICC "Use intel compilers") and it would
> figure the rest out.
>

I don't think you can change the compiler inside CMakeLists. Another option is 
setting CC and CXX environment variables before you run cmake

CC=icc CXX=icpc cmake 

--
Filipe Sousa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20051108/ac207a86/attachment.pgp


More information about the CMake mailing list