diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2685195e4e5ca856a4253eb5a82c87ba37fa02de..f9f47a0e2ffade7b8a28f8d874c27c84a9b8c61c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,8 +20,8 @@ enable_language(C)
 if (CM_ALL_USE_F08)
     if (NOT CM_ALL_FORTRAN)
         message(FATAL_ERROR "Flag for Fortran 08 MPI interface set, while Fortran interface is not enabled!")
-    endif (CM_ALL_FORTRAN)
-endif (CM_ALL_USE_F08)
+    endif ()
+endif ()
 
 if (CM_ALL_FORTRAN)
     enable_language(Fortran)