cmake - detect missing HDF5_LIBRARIES on win/darwin

Previously it would assign .so files on Windows as libraries and you would detect error on linking stage.
This commit is contained in:
Andrej730
2025-08-12 16:06:52 +05:00
parent 95820516cf
commit 3342bd923d
+12 -8
View File
@@ -654,14 +654,18 @@ if(HDF5_SUPPORT)
endif()
if(NOT HDF5_LIBRARIES)
# debian default
set(HDF5_LIBRARIES
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
/usr/lib/x86_64-linux-gnu/libsz.so
/usr/lib/x86_64-linux-gnu/libaec.so
z dl
)
if(NOT WIN32 AND NOT APPLE)
# debian default
set(HDF5_LIBRARIES
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
/usr/lib/x86_64-linux-gnu/libsz.so
/usr/lib/x86_64-linux-gnu/libaec.so
z dl
)
else()
message(FATAL_ERROR "HDF5_LIBRARIES is not provided.")
endif()
endif()
add_definitions(-DWITH_HDF5)