handle missing lack of fortran compiler more gracefully

This commit is contained in:
Martin Kroeker 2020-07-16 22:17:39 +00:00 committed by GitHub
parent d8e2edfc20
commit a847d00366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -21,7 +21,14 @@
# NEED2UNDERSCORES # NEED2UNDERSCORES
if (NOT NO_LAPACK) if (NOT NO_LAPACK)
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran) enable_language(Fortran)
else()
message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")
set (NOFORTRAN 1)
set (NO_LAPACK 1)
endif()
else() else()
include(CMakeForceCompiler) include(CMakeForceCompiler)
CMAKE_FORCE_Fortran_COMPILER(gfortran GNU) CMAKE_FORCE_Fortran_COMPILER(gfortran GNU)