Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2007-10-15 22:47:02

on Mon Oct 15 2007, Bill Hoffman <> wrote:

>> into the system. My question is, do we really need to be able to
>> specify arbitrary combinations of tools on the bjam/cmake command
>> line, or is it enough to configure the combinations we're interested
>> in, each using its own build tree?
> I saw that the config file had multiple compilers in one file. I think
> this could be done in a single
> ctest -S file.

[Bill, I hope you don't mind me picking nits, but your mailer has ugly
linebreaks and you should leave a blank line before starting your
reply (]

> Having to create a script or thin layer on top of cmake
> would most likely be not
> that cross platform. (Might depend on python or some shell being
> installed.)

Yeah, I would have expected to use something like Python.

> In this respect,
> that is why I thought it might be close to the ctest -S scripts. When
> we started doing dashboards
> we had shell scripts and .bat files to drive the process. However, this
> was hard to
> maintain. So, we added support to ctest to process cmake scripts. The
> feature could be used
> to do what you want.

I'm not so sure.

> I am thinking something like this:
> # set a root path for builds
> set(CTEST_BINARY_DIRECTORY "/home/me/my_builds")
> # initialize the cache with the compiler and tools you want for the system
> file(WRITE "${CTEST_BINARY_DIRECTORY}/BinaryOne/CMakeCache.txt" "
> CMAKE_CXX_COMPILE=/usr/bin/g++
> ")
> # run cmake
> ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}/BinaryOne/")
> # build the project
> ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}/BinaryOne/")
> # create a second build tree for the next compiler
> file(WRITE "${CTEST_BINARY_DIRECTORY}/BinaryOne/CMakeCache.txt" "
> CMAKE_CXX_COMPILER=/usr/local/gcc-4.2.0/bin/g++
> ")
> ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}/BinaryOne2/")
> ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}/BinaryOne2/")
> Then you could build both with ctest -S mybuild.cmake.

First of all, let me just say, "ick, that's even uglier than your
mailer's linebreaks" ;-). And it's full of redundant boilerplate.

Secondly, I don't think this has the same semantics. Normally if you


it builds once, with the default toolset (the first you've
configured). If you say

        bjam gcc msvc

it will build with the default version of gcc and of msvc. You don't
need to edit your user-config.jam to get a different build as long as
it can find the compilers you've requested. If you say

       bjam gcc-3.4 gcc-4.2 msvc-6.5

it will build with those specific versions (if they are configured).

Unless I'm misunderstanding, I don't think ctest has the right
abstractions for this.

Thirdly, why should I have to get involved with the testing system
just to get this functionality, which is clearly a build system thing?

> I am not sure this works right now, because there might be some
> dashboard specific stuff that might be required, but I don't think
> it would be hard to make this work. It all depends on if you folks
> think it is useful.

Not in that form, IMO.

Dave Abrahams
Boost Consulting

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