diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e26a0f0f..1320f5c3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,7 +244,7 @@ if (PIO_ENABLE_COVERAGE) endif () # Allow argument mismatch in gfortran versions > 10 for mpi library compatibility -if (CMAKE_C_COMPILER_NAME STREQUAL "GNU") +if (CMAKE_Fortran_COMPILER_NAME STREQUAL "GNU") if ("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_LESS 10) message (WARNING "gfortran version is ${CMAKE_Fortran_COMPILER_VERSION}") else()