diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake index dcd4a78a79..5d5aa8e82f 100644 --- a/Tests/CheckFortran.cmake +++ b/Tests/CheckFortran.cmake @@ -2,7 +2,7 @@ # file LICENSE.rst or https://cmake.org/licensing for details. -if(NOT DEFINED CMAKE_Fortran_COMPILER) +if(NOT DEFINED CMAKE_Fortran_COMPILER AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") set(_desc "Looking for a Fortran compiler") message(STATUS ${_desc}) file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran)