[CMake] check_fortrant_compiler_flag?

Nils Gladitz nilsgladitz at gmail.com
Fri Jun 20 10:05:30 EDT 2014


On 20.06.2014 15:57, Jack Stalnaker wrote:
> I see that there are standard modules for checking C and C++ compiler 
> flags, but there is no equivalent for fortran. Gfortran and ifort, for 
> instance, have different flags for changing/supporting source code 
> format and line length restrictions, so it would be very useful to be 
> able to check which of a list of flags works (if any). Is there a 
> workaround, or is it easy to do myself?

I don't know about checking specific flags for Fortran but perhaps you 
can set your flags depending on the value of CMAKE_Fortran_COMPILER_ID.
It should be "GNU" for gfortran and "Intel" for ifort.

Nils


More information about the CMake mailing list