[CMake] Selecting compiler on Windows platform

Miguel A. Figueroa-Villanueva miguelf at ieee.org
Mon Oct 22 10:39:39 EDT 2007


On 10/22/07, Josef Karthauser  wrote:
> > -----Original Message-----
> > On Monday 22 October 2007 11:34, Josef Karthauser wrote:
> > ...
> > > However, I'd like to control this from within a CMake file, and this
> > > doesn't appear possible.  From what I can see,
> > CMakeDetermineCXXCompiler is
> > > loaded and executed prior to the CMakeLists.txt file, which means
> > that I
> > > cannot set the compiler internally.  Is this true,
> >
> > Yes, this is true.
> > One reason is that one build tree must not use several compilers for
> > one
> > language, because all the configure checks are global for one build
> > tree and
> > so the results are only correct for the compiler which was used when
> > they
> > were executed.
>
> This seems overly restrictive, a tree might contain a number of sub-trees which use different compilers.  Whilst I understand the need to keep things consistent by default, if a user wants to shoot themselves in the foot it ought to be allowed.  (Tools not policy! :)
>
> I guess I'm going to have to run CMakeDetermineCXXCompiler again myself. :/.

Hello Joe,

Why not have to build trees for the same source tree? One for cl and
one for gcc... You could conditionally leave out portions of the
source code if it is the gcc build and viceversa.

--Miguel


More information about the CMake mailing list