Commit 40fa8b83 authored by Remi Perenon's avatar Remi Perenon

Moving cmake hdf5 helper to cmake directory

parent 54f35c47
# Find hdf5 libraries
find_library(hdf5_fortran NAME libhdf5_fortran PATHS ${HDF5_LIBRARY_PATH})
if(hdf5_fortran STREQUAL hdf5_fortran-NOTFOUND)
message(FATAL_ERROR "libhdf5_fortran not found")
endif()
find_library(hdf5_f90cstub NAME libhdf5_f90cstub PATHS ${HDF5_LIBRARY_PATH})
if(hdf5_f90cstub STREQUAL hdf5_f90cstub-NOTFOUND)
message(FATAL_ERROR "libhdf5_f90cstub not found")
endif()
find_library(hdf5 NAME libhdf5 PATHS ${HDF5_LIBRARY_PATH})
if(hdf5 STREQUAL hdf5-NOTFOUND)
message(FATAL_ERROR "libhdf5 not found")
endif()
find_library(szip NAME libszip PATHS ${HDF5_LIBRARY_PATH})
if(szip STREQUAL szip-NOTFOUND)
message(FATAL_ERROR "libszip not found")
endif()
find_library(zlib NAME libzlib PATHS ${HDF5_LIBRARY_PATH})
if(zlib STREQUAL zlib-NOTFOUND)
message(FATAL_ERROR "libzlib not found")
endif()
set(HDF5_LIBS libhdf5_fortran libhdf5_f90cstub libhdf5 libszip libzlib)
if(DEFINED ENV{CRYSFML_HDF5_DIR})
set(HDF5_HINTS_DIR "$ENV{CRYSFML_HDF5_DIR}" "$ENV{CRYSFML_HDF5_DIR}/include")
find_path(HDF5_INCLUDE_DIR hdf5.h HINTS ${HDF5_HINTS_DIR})
else()
find_package(HDF5)
endif()
\ No newline at end of file
# Find hdf5 libraries
find_library(hdf5_fortran NAME libhdf5_fortran PATHS ${HDF5_LIBRARY_PATH})
if(hdf5_fortran STREQUAL hdf5_fortran-NOTFOUND)
message(FATAL_ERROR "libhdf5_fortran not found")
endif()
find_library(hdf5_f90cstub NAME libhdf5_f90cstub PATHS ${HDF5_LIBRARY_PATH})
if(hdf5_f90cstub STREQUAL hdf5_f90cstub-NOTFOUND)
message(FATAL_ERROR "libhdf5_f90cstub not found")
endif()
find_library(hdf5 NAME libhdf5 PATHS ${HDF5_LIBRARY_PATH})
if(hdf5 STREQUAL hdf5-NOTFOUND)
message(FATAL_ERROR "libhdf5 not found")
endif()
find_library(szip NAME libszip PATHS ${HDF5_LIBRARY_PATH})
if(szip STREQUAL szip-NOTFOUND)
message(FATAL_ERROR "libszip not found")
endif()
find_library(zlib NAME libzlib PATHS ${HDF5_LIBRARY_PATH})
if(zlib STREQUAL zlib-NOTFOUND)
message(FATAL_ERROR "libzlib not found")
endif()
set(HDF5_LIBS libhdf5_fortran libhdf5_f90cstub libhdf5 libszip libzlib)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment