1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-23 04:43:57 +01:00

If header is not found, try pkgconfig

This commit is contained in:
Anthony Scemama 2023-01-16 19:26:52 +01:00
parent aa4e9ca7d3
commit 5742221eb2

View File

@ -134,11 +134,13 @@ AS_IF([test "x$with_hdf5" == "xno"], [
HDF5_LIBS="-L$HDF5_PATH/lib -lhdf5" HDF5_LIBS="-L$HDF5_PATH/lib -lhdf5"
HDF5_CFLAGS="-I$HDF5_PATH/include" HDF5_CFLAGS="-I$HDF5_PATH/include"
AC_DEFINE([HAVE_HDF5], 1, [Define to 1 if HDF5 is available]) ], AC_DEFINE([HAVE_HDF5], 1, [Define to 1 if HDF5 is available]) ],
[ [ # else
AC_CHECK_LIB([hdf5], [H5Fcreate], [ HDF5_LIBS="-lhdf5" ], [ AC_CHECK_LIB([hdf5], [H5Fcreate], [ HDF5_LIBS="-lhdf5" ], [
PKG_CHECK_MODULES([HDF5], [hdf5 >= 1.8]) PKG_CHECK_MODULES([HDF5], [hdf5 >= 1.8])
] ) ])
AC_CHECK_HEADER([hdf5.h], [HDF5_CFLAGS=""], [AC_MSG_ERROR([HDF5 header not found]) ]) AC_CHECK_HEADER([hdf5.h], [HDF5_CFLAGS=""], [
[ PKG_CHECK_MODULES([HDF5], [hdf5 >= 1.8])
])
AC_DEFINE([HAVE_HDF5], 1, [Define to 1 if HDF5 is available]) AC_DEFINE([HAVE_HDF5], 1, [Define to 1 if HDF5 is available])
]) ])