On 03/09/2018 07:58 PM, Ondřej Čertík wrote:
> How do I make CMake pass the "Check for working Fortran compiler" phase?

The problem reported in issue 17810 is caused by trying to
enable C with MSVC and Fortran with GNU together at the same
time, e.g. `project(MyProj C Fortran)`.  These tools cannot
be used together directly.

The purpose of cmake_add_fortran_subdirectory as described
in the blog post is to avoid enabling Fortran in the main
project.  Instead Fortran is only enabled in a separate project
by itself, and the main project gets only C (and CXX).

If you want to use MSVC and Fortran together directly then you
need a Fortran compiler that works with the MSVC binutils.  The
Intel Fortran compiler for Windows, a commercial tool, is one
option.  There is also https://github.com/flang-compiler/flang,
which is currently maturing.

Alternatively you can use GNU from MinGW for all languages,
e.g. `CC=gcc CXX=g++ FC=gfortran cmake ../src`.

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to