--- a/config/cmake_files/medMacros.cmake
+++ b/config/cmake_files/medMacros.cmake
@@ -447,7 +447,7 @@
     ##
     ## Requires 1.12.x version
     ##
-    IF (NOT HDF_VERSION_MAJOR_REF EQUAL 1 OR NOT HDF_VERSION_MINOR_REF EQUAL 12 OR NOT HDF_VERSION_RELEASE_REF GREATER 0)
+    IF (HDF5_VERSION VERSION_LESS 1.12.1)
         MESSAGE(FATAL_ERROR "HDF5 version is ${HDF_VERSION_REF}. Only versions >= 1.12.1 are supported.")
     ENDIF()
     ##
--- a/src/ci/MEDfileCompatibility.c
+++ b/src/ci/MEDfileCompatibility.c
@@ -116,7 +116,7 @@
 #if MED_NUM_MAJEUR != 5
 #error "Don't forget to update the test version here when you change the major version of the library !"
 #endif
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to check the compatibility version of the library, depending on the internal hdf model choice !"
 #error "Cf. _MEDfileCreate ..."
 #endif
--- a/src/hdfi/_MEDfileCreate.c
+++ b/src/hdfi/_MEDfileCreate.c
@@ -189,7 +189,7 @@
    * Cette ligne est censée obliger HDF à ne pas utiliser un modèle interne différent de 1.10.z
    * Un test autoconf permet de fixer un intervalle de version HDF à MED.
    */
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to change the compatibility version of the library !"
 #endif
    
--- a/src/hdfi/_MEDfileOpen.c
+++ b/src/hdfi/_MEDfileOpen.c
@@ -113,7 +113,7 @@
        has been set in the group creation property list (see H5Pset_link_creation_order).
   */
 
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to change the compatibility version of the library !"
 #endif
 /* L'avantage de bloquer le modèle interne HDF5
--- a/src/hdfi/_MEDfileOpenForImport.c
+++ b/src/hdfi/_MEDfileOpenForImport.c
@@ -53,7 +53,7 @@
   }
 
 
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to change the compatibility version of the library !"
 #endif
 /* L'avantage de bloquer le modèle interne HDF5
--- a/src/hdfi/_MEDmemFileOpen.c
+++ b/src/hdfi/_MEDmemFileOpen.c
@@ -439,7 +439,7 @@
     goto ERROR;
   }
 
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to change the compatibility version of the library !"
 #endif
   if ( H5Pset_libver_bounds( _fapl, H5F_LIBVER_V112, H5F_LIBVER_V112 ) ) {
@@ -506,7 +506,7 @@
 	goto ERROR;
       }
       _fversionMM = 100*_fmajor+10*_fminor;
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to change the compatibility version of the library !"
 #endif
       if ( _fversionMM < 500 ) { /*100*MED_NUM_MAJEUR+10*MED_NUM_MINEUR*/
--- a/src/hdfi/_MEDparFileCreate.c
+++ b/src/hdfi/_MEDparFileCreate.c
@@ -64,7 +64,7 @@
    * En HDF5-1.10.0p1 cela n'a aucun effet ! 
    * Un test autoconf permet de fixer un intervalle de version HDF à MED.
    */
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to change the compatibility version of the library !"
 #endif
    
--- a/src/hdfi/_MEDparFileOpen.c
+++ b/src/hdfi/_MEDparFileOpen.c
@@ -86,7 +86,7 @@
   }
   _fversionMM = 100*_fmajor+10*_fminor;
 
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to change the compatibility version of the library !"
 #endif 
   if ( _fversionMM < 500 ) { /*100*MED_NUM_MAJEUR+10*MED_NUM_MINEUR*/
--- a/src/misc/MEDversionedApi3C.c
+++ b/src/misc/MEDversionedApi3C.c
@@ -114,7 +114,7 @@
   /*      (_fversionMM <= (100*MED_NUM_MAJEUR+10*MED_NUM_MINEUR) ) */
   /*      ) { */
 
-#if H5_VERS_MINOR > 12
+#if H5_VERS_MINOR > 14
 #error "Don't forget to change the compatibility version of the library !"
 #endif
   
