[cmake-developers] Using multiple toolchains

Brad King brad.king at kitware.com
Wed Jul 3 14:56:48 EDT 2013


On 7/1/2013 1:26 PM, Stephen Kelly wrote:
> I've pushed a proof-of-concept multiple-toolchains branch to my clone which 
> enables the use of multiple toolchains with cmake.

Wow, that is a mind-blowing branch ;)

> The idea is to use a separate cache and set of definition overrides for each 
> toolchain.

That sounds a lot like a separate invocation of CMake for each
toolchain, which is what one must do now.

> One of the goals I have is to make it possible to use N different 
> toolchains, not just two.

Currently we support only one toolchain per language per build tree,
not even two.  When one needs host tools we require two separate
builds.

> There's obviously a clash of output binary names, cmake target names and 
> make target names if the same library is going to be build for multiple 
> toolchains. That's something I have not yet attempted to solve.

These among many other challenges await anyone that attempts your
proposed approach.  While the work in your branch has gotten
impressively far, it also serves to demonstrate the inherent
complexity of the proposed approach.  IMO it is not worth exploring
that approach further.  Sorry.

Much of the multiple toolchains functionality can be accomplished by
using ExternalProject to create a "superbuild" in which each inner
project uses a different toolchain file.  From that one can get to
a single make invocation to drive everything.  It doesn't need any
fundamental changes in CMake.

-Brad



More information about the cmake-developers mailing list