Skip to content

Commit 094e2a4

Browse files
committed
Amend check for H5Literate to work with 1.10.x
1 parent 3e0b36a commit 094e2a4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

CMakeLists.txt

+11-1
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,19 @@ IF(USE_HDF5)
780780
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Literate "" HAVE_H5Literate)
781781

782782
IF(NOT HAVE_H5Literate)
783-
MESSAGE(FATAL_ERROR "${HDF5_C_LIBRARY_hdf5} does not contain symbol '_H5Literate'. Please recompile your libhdf5 install using '--with-default-api-version=v18'.")
783+
CHECK_C_SOURCE_COMPILES("#include <H5public.h>
784+
#if !(H5Literate_vers == 1)
785+
#error
786+
#endif
787+
int main() {int x = 1;}" HAVE_H5Literate_Macro)
788+
ELSE()
789+
SET(HAVE_H5Literate_Macro 1)
784790
ENDIF(NOT HAVE_H5Literate)
785791

792+
IF(NOT HAVE_H5Literate_Macro)
793+
MESSAGE(FATAL_ERROR "${HDF5_C_LIBRARY_hdf5} does not contain symbol '_H5Literate'. Please recompile your libhdf5 install using '--with-default-api-version=v18'.")
794+
ENDIF(NOT HAVE_H5Literate_Macro)
795+
786796
IF(HDF5_PARALLEL)
787797
SET(HDF5_CC h5pcc)
788798
ELSE()

0 commit comments

Comments
 (0)