[CMake] Mixing GFortran and Intel Fortran on the Same windows machine?

Bill Hoffman bill.hoffman at kitware.com
Fri May 30 16:39:45 EDT 2014


On 5/30/2014 2:44 PM, Michael Jackson wrote:
> How is CMake determining if the Intel Compiler is available?
> Registry
query or Path query? I tried to export the FC variable but that did not
work either. I guess I'll have to fire up yet-another virtual machine.
was just hoping to bounce back and forth between the compilers on the
same machine.

> Thank you for the insight.
> Mike Jackson

It uses the check_language macro:

   # if we are not using MSVC without fortran support
   # then just use the usual add_subdirectory to build
   # the fortran library
   check_language(Fortran)
   if(NOT (MSVC AND (NOT CMAKE_Fortran_COMPILER)))
     add_subdirectory(${subdir})
     return()
   endif()

So, if your visual studio supports fortran, it will use it.

-Bill



More information about the CMake mailing list