[CMake] Setting the cmake compiler...

Peter Soetens peter.soetens at fmtc.be
Fri Oct 20 09:22:57 EDT 2006


Quoting Brad King <brad.king at kitware.com>:
>
> Any time you change the compiler you have to wipe out the build tree and
> start from scratch.  Try running CMake like this instead:
>
> $ rm -rf build; mkdir build; cd build
> $ CC=gcc CXX=g++ cmake ..
>

I had read this comment before, but I couldn't believe it was supposed 
to be common practice.This erases your complete configuration. Say a 
developer first uses ccmake to configure the build (paths, options,...) 
and then discovers the compiler needs to be changed, he has to start 
all over ?  What's the rationale behind this ?

Another 'bug' is that you can edit the CMAKE_CXX_COMPILER field in 
ccmake, but when you run 'c', the field is overwritten again. All very 
annoying. Maybe a SET( LOCKED ...) flag could be added such that fields 
are not user editable.

I tested your example "CC=gcc CXX=g++ cmake .." and it seems also to be 
the only way in which you can use 'distcc':

CC="distcc gcc" CXX="distcc g++" cmake ..

The classical -D approach does not work in this case for some reason..

Aren't these 'little details' a big complaint of beginning cmake users ?
Especially if <http://www.cmake.org/Wiki/CMake_Useful_Variables> does 
not mention these 'caveat's.

Thanks for helping me out,
Peter
-- 
www.fmtc.be


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the CMake mailing list