[CMake] How to specify precedence when using enable_language to search for compilers

rocwhite168 rocwhite168 at 163.com
Tue Mar 15 14:28:26 EDT 2011


Hi again,

I'm not sure if it is the time I posted this happened to be Sunday
that no one has read it or we simply cannot specify a precedence to
let cmake change its default sequence of searching for available
compilers?

Thanks,
Roc

On Fri, Mar 11, 2011 at 6:10 PM, rocwhite168 <rocwhite168 at 163.com> wrote:
> Hi everyone,
>
> I wonder how I can specify precedence when using enable_language to
> search for compilers. For example, if my system has both ifort and
> gfortran installed, and I want to use ifort instead of the gfortran,
> how could I set up this?
>
> From what I currently found, a work-around is to set
> CMAKE_Fortran_Compiler before project(xxx), so that this variable can
> never gets overridden later, but clearly this is not the best way,
> since I need gfortran if there turns out to be no ifort available.
>
> By the way, what's the best place to look for this kind of
> information? The documentation does not seem to be very complete..
>
> Thanks,
> Roc
>


More information about the CMake mailing list