Boost logo

Boost-Build :

From: Bill Hoffman (bill.hoffman_at_[hidden])
Date: 2007-10-12 19:45:08


Larry Evans wrote:
> Sorry. I probably sould have shortened it, but it took me so long to
> write :(, I just didn't have the heart to shorten it.
>
> >
> > Can we sum it up into the following three issues?
> >
> > 1. Once you configure a binary tree for a build with CMake,
> > it is not easy to change the compiler.
>
> Yep.
>
> >
> > 2. You want to pass flags to the compiler like -E, but cmake does not
> > allow this.
>
> I didn't mean this. The mention of using -E was only meant to show I
> used it to debug c++ macros, and that a similar feature would be
> useful w.r.t. cmake macros. Sorry I wasn't clear. However, I tested
> this, and indeed you're right. I tried:
>
> #!/bin/bash
> cmake -DCMAKE_CXX_COMPILER=/home/evansl/download/gcc/\
> 4.3-20071005/install/bin/g++\
> -std=gnu++0x\
> -I/home/evansl/prog_dev/boost-cvs/ro/boost/sandbox/variadic-templates\
> ../../src
>
> and the resulting CMakeCache.txt didn't have the -std or the -I flags:
>
> //CXX compiler.
> CMAKE_CXX_COMPILER:FILEPATH=/home/evansl/download/gcc/4.3-20071005/install/bin/g++
>
>
Just because it is not in the cache under that variable does not mean it
is not there.
It should have been put as the first flag to the CMAKE_CXX_FLAGS.
And you should have a variable in the cache CMAKE_CXX_COMPILER_ARG1.
This is for things like the sgi CC -LANG:std and such.

When you built the project did it use the flags you gave it?

Another way is to use the environment CFLAGS and CXXFLAGS before running
cmake. So, you should be able to do what you want without a problem.

-Bill


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk