[CMake] Alternative to toolchains (Was IBM Fortran and the C Preprocessor)

Alexander Neundorf a.neundorf-work at gmx.net
Thu Jun 25 13:27:25 EDT 2009


On Thursday 25 June 2009, Will Dicharry wrote:
> I'm splitting into a new thread because these are two distinct topics now.
>
> Bill Hoffman wrote:
> > Will Dicharry wrote:
> >> We do this because we need a quick way to choose our compiler (cmake
> >> chooses GNU on this system by default, and we have to use an MPI
> >> wrapper compiler) and because we want those particular Fortran flags
> >> when the MPI wrapper compiler is being used.
> >> When I use this toolchain file, the Fortran compiler ID is unknown (I
> >> failed to see this before, the C and CXX compiler IDs were correct).
> >>
> >> However if I comment out the set CMAKE_Fortran_FLAGS line or if I skip
> >> the toolchain file altogether and just pass
> >> -DCMAKE_Fortran_COMPILER=mpxlf90 into the cmake command, the compiler ID
> >> is VisualAge and everything works fine.
> >>
> >> Am I misusing the toolchain file capability?
> >
> > Yes, that should only be used for cross-compiling.

We could kind-of make that sure by checking that after the toolchain file has 
been loaded, CMAKE_SYSTEM_NAME must be set.
If that's the case, then cmake considers the build a cross compile.
Do we really want that ?

Alex


More information about the CMake mailing list