

However, if you want to use the MinGW compilers to create libraries that are usable from native Visual Studio (VS) compilers, you will need to create VS. lib files from MinGW gfortranīy default when building with the MinGW toolchain and the gfortran compiler, it of course produces GNU style. The module will automatically enable Fortran support under Visual Studio by either using the current VS enabled Fortran Compiler (INTEL Fortran, PGI Fortran, etc.) or directly use the MinGW gfortran compiler.Ĭreating Visual Studio. This module adds a subdirectory to a project that contains a Fortran only sub-project. A new CMake module called CMakeAddFortranSubdirectory.cmake.The ability to create Visual Studio style.The new functionality comes in two parts: Integrating gfortran within VS is feasible but not trivial.ĬMake now contains a new feature to make gfortran integration much easier. The gfortran compiler is indeed only available within Cygwin or MinGW, and no direct gfortran plugin for Visual Studio is available. The main problem is if you are working under Microsoft Visual Studio, only commercial (and thus not free!) compilers are available: Intel Compilers, PGI compilers, Silverforst, etc.

As you may know gfortran, a free GNU Fortran compiler, is now available on all major platforms. If you are going to be using Fortran code or Fortran based library (for example the widely used Linear Algebra PACKage LAPACK from ) in a project, you will obviously need to be able to link your C code against your Fortran code or your Fortran based library. This article will describe how to apply those features in any CMake project requiring mixed C or C++ Fortran development.

