diff options
Diffstat (limited to 'infra/nnfw/cmake/packages/HDF5Config.cmake')
-rw-r--r-- | infra/nnfw/cmake/packages/HDF5Config.cmake | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/infra/nnfw/cmake/packages/HDF5Config.cmake b/infra/nnfw/cmake/packages/HDF5Config.cmake new file mode 100644 index 000000000..1f90deaf9 --- /dev/null +++ b/infra/nnfw/cmake/packages/HDF5Config.cmake @@ -0,0 +1,31 @@ +unset(HDF5_DIR CACHE) +find_package(HDF5 QUIET) + +if (NOT HDF5_FOUND) + # Give second chance for some systems where sytem find_package config mode fails + unset(HDF5_FOUND) + + find_path(HDF5_INCLUDE_DIRS NAMES hdf5.h PATH_SUFFIXES include/hdf5/serial) + + if (NOT HDF5_INCLUDE_DIRS) + set(HDF5_FOUND FALSE) + return() + endif() + + if (HDF5_USE_STATIC_LIBRARIES) + find_library(HDF5_LIBRARIES libhdf5.a) + else (HDF5_USE_STATIC_LIBRARIES) + find_library(HDF5_LIBRARIES libhdf5.so) + endif(HDF5_USE_STATIC_LIBRARIES) + + if (NOT HDF5_LIBRARIES) + set(HDF5_FOUND FALSE) + return() + endif() + list(APPEND HDF5_LIBRARIES "sz" "z" "dl" "m") + + set(HDF5_FOUND TRUE) +endif() + +# Append missing libaec which is required by libsz, which is required by libhdf5 +list(APPEND HDF5_LIBRARIES "aec") |