[CMake] Setting the compiler

Juan Sanchez Juan.Sanchez at amd.com
Fri Jul 27 15:09:10 EDT 2007


I'm evaluating CMAKE for use by our group and I am running into an issue
with selecting the compiler.

Is there any way to set the compiler and flags in the CMakeLists.txt
file?  This information appears to be ignored.  The FAQ as well as the
book suggest setting environment variables.

We have a script which we can use to determine the platform we are on,
but setting CMAKE_CXX_COMPILER in the if block of the CMakeLists.txt is
ignored.

An issue is that it would be hard to convince other developers to adopt
CMAKE if this would require them to set environment variables every time
they check out the source code and start building.  Another issue is
that they will be developing on both 32 and 64 bit machines, and would
like to be able to use the same directory to do this.  The compiler on
each platform is in a different directory.

Any help would be appreciated.

Thanks,

Juan




More information about the CMake mailing list