Boost logo

Boost-Build :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-10-12 16:33:26

On 10/12/07 13:54, Bill Hoffman wrote:
> Larry Evans wrote:
>> On 10/05/07 16:17, David Abrahams wrote:
>> > on Fri Oct 05 2007, Larry Evans <>
>> >
>> >> Dave, because I was having trouble with BB, I tried CMake briefly
>> >> around August. It was hard to specify a different compiler, as
>> >> described here:
>> >>
>> >>
>> >>
>> >> I guess this qualifies as "empirical data".
>> >
>> > Yes, it does, thanks.
>> >
>> >> After that CMake experience, I went back to BB to see if I could
>> >> understand it (in particular the extending) better. I'm still
>> >> trying :(.
>> BTW, I've made some progress in getting BB to work on the problem,
>> which was emulating the GMCPPOT (see below).
> OK, so that was a very long email. :-)

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.


> 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:

cmake -DCMAKE_CXX_COMPILER=/home/evansl/download/gcc/\

and the resulting CMakeCache.txt didn't have the -std or the -I flags:

//CXX compiler.

This is needed in order to test the variadic compiler. The -std flag
signals variadic templates and the -I is to include my variadic boost
directory ahead of the normal boost directory. So, unless there's a
workaround, I think this is a definite negative on cmake's side of the
comparison with BB. With BB, in my user-config.jam, I just have this:

using gcc
   : 4.3_v



and then just say `bjam --toolset=gcc-4.3_v` to get this compiler with
these flags.

> 3. You want some sort of mapping between the CMakeLists.txt input files
> and the
> generated Makefiles.

Yes. However, I've had no real experience and it may not be that
necessary. I was just extrapolating my experience with c++ macros.

> To answer those issues:
> 1. Yes, you can not change the compiler once cmake has run.
> 2. make source.i will generate preprocessed output for a given compiler.
> make help in a directory will show the possible targets to make.

Yes, that's what Brad mentioned here:

However, what I want is to filter the output through csplit and then
ident to it's more readable.

> 3. You are the first to make this request. For each directory in the
> source tree that has a CMakeLists.txt file, a directory in the binary
> tree will be created. The lines of the CMakeLists.txt file do
> not directly map to any particular line of the Makefile. I something
> could be done here, but I am not sure how useful it would be.

You're probably right. As I mentioned, it was an extrapolation of my
experience with cpp macros. Since the output of cmake macro's is much
more user-readable and probably much easier to trace back to the
source, I withdraw the request.

Thanks for your response.


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at