diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 72f2dee2bb..58d0967ce0 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -65,7 +65,10 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list) # Test this combination of libraries. set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}}) #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) + get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) + if(_LANGUAGES_ MATCHES Fortran) + check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) + endif(_LANGUAGES_ MATCHES Fortran) set(CMAKE_REQUIRED_LIBRARIES) mark_as_advanced(${_prefix}${_combined_name}_WORKS) set(_libraries_work ${${_prefix}${_combined_name}_WORKS})