Commit a62ee1a6 authored by Laurent Claustre's avatar Laurent Claustre

Use find_package HDF5 for unix instead

parent 3b4e4b45
......@@ -373,24 +373,16 @@ if(LIMA_ENABLE_HDF5)
find_library(LIB_HDF5_HL libhdf5_hl ${LIB_HDF5_DIR})
find_library(LIB_ZLIB libzlib ${LIB_HDF5_DIR})
find_library(LIB_SZIP libszip ${LIB_HDF5_DIR})
else()
set(LIB_HDF5_INCLUDE_DIR "/usr/local/hdf5/include" CACHE PATH "Path to HDF5 directories")
set(LIB_HDF5_DIR "/usr/local/hdf5/lib")
find_library(LIB_HDF5_CPP hdf5_cpp ${LIB_HDF5_DIR})
find_library(LIB_HDF5 hdf5 ${LIB_HDF5_DIR})
find_library(LIB_HDF5_HL hdf5_hl ${LIB_HDF5_DIR})
find_path(LIB_HDF5_INCLUDE_DIR H5Cpp.h)
link_directories(${LIB_HDF5_DIR})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HDF5 DEFAULT_MSG LIB_HDF5 LIB_HDF5_INCLUDE_DIR)
if(${HDF5_FOUND})
else()
find_package(HDF5 REQUIRED COMPONENTS C CXX HL )
endif()
if(${HDF5_FOUND})
add_definitions(-DWITH_HDF5_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Hdf5.cpp)
set(saving_libs ${saving_libs} ${LIB_HDF5} ${LIB_HDF5_CPP} ${LIB_HDF5_HL} ${LIB_SZIP} ${LIB_ZLIB})
set(saving_includes ${saving_includes} ${LIB_HDF5_INCLUDE_DIR})
set(saving_libs ${saving_libs} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} ${LIB_SZIP} ${LIB_ZLIB})
set(saving_includes ${saving_includes} ${HDF5_INCLUDE_DIRS})
else()
message(FATAL_ERROR "hdf5_cpp library not found, please install or disable LIMA_ENABLE_HDF5")
message(FATAL_ERROR "HDF5 libraries not found, please install or disable LIMA_ENABLE_HDF5")
endif()
if(LIMA_ENABLE_HDF5_BS)
......
......@@ -23,11 +23,8 @@
############################################################################
if (NOT BITSHUFFLE_EXTERNALLY_CONFIGURED)
cmake_minimum_required(VERSION 2.8)
find_library(LIB_HDF5 hdf5)
find_path(LIB_HDF5_INCLUDE_DIR hdf5.h)
cmake_minimum_required(VERSION 3.1)
find_package(HDF5 REQUIRED)
endif (NOT BITSHUFFLE_EXTERNALLY_CONFIGURED)
set(BS_VERSION_MAJOR "0")
......@@ -51,9 +48,9 @@ add_library(h5bshuf SHARED ${bitshuffle_src})
target_include_directories(h5bshuf PRIVATE "${BITSHUFFLE_DIR}/src")
target_include_directories(h5bshuf PRIVATE "${BITSHUFFLE_DIR}/lz4")
target_include_directories(h5bshuf PRIVATE "${LIB_HDF5_INCLUDE_DIR}")
target_include_directories(h5bshuf PRIVATE "${HDF5_INCLUDE_DIRS}")
target_link_libraries(h5bshuf ${LIB_HDF5})
target_link_libraries(h5bshuf ${HDF5_LIBRARIES})
install(TARGETS h5bshuf LIBRARY DESTINATION lib)
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