simplify hdf5 linking

This commit is contained in:
Xiaoqiang Wang 2017-07-27 12:51:10 +02:00
parent f07816a0d1
commit 71204172df

View File

@ -17,44 +17,24 @@ set(SOURCES
)
# REST
if (REST)
MESSAGE("\n *** Using REST Implementation *** \n")
list (APPEND SOURCES src/UDPRestImplementation.cpp)
# add_library(poco etc.)
# add_library(poco etc.)
else (REST)
MESSAGE("\n *** Using Standard Implementation *** \n")
endif (REST)
# HDF5
if (HDF5_FOUND)
set (HDF5DIR /opt/hdf5v1.10.0)
include_directories(
${HDF5DIR}/include
${HDF5_INCLUDE_DIRS}
)
add_definitions(
-DHDF5C
-DHDF5C ${HDF5_DEFINITIONS}
)
add_library(hdf5 SHARED IMPORTED)
add_library(hdf5_cpp SHARED IMPORTED)
add_library(sz SHARED IMPORTED)
add_library(z SHARED IMPORTED)
set_target_properties(hdf5 PROPERTIES
IMPORTED_LOCATION ${HDF5DIR}/lib/libhdf5.so
)
set_target_properties(hdf5_cpp PROPERTIES
IMPORTED_LOCATION ${HDF5DIR}/lib/libhdf5_cpp.so
)
set_target_properties(sz PROPERTIES
IMPORTED_LOCATION ${HDF5DIR}/lib/libsz.so
)
set_target_properties(z PROPERTIES
IMPORTED_LOCATION ${HDF5DIR}/lib/libz.so
)
set(_hdf5_libs hdf5 hdf5_cpp sz z)
list (APPEND SOURCES
src/HDF5File.cpp
src/HDF5FileStatic.cpp
@ -105,5 +85,8 @@ target_link_libraries(slsReceiver
pthread
zmq
rt
${_hdf5_libs}
)
if (HDF5_FOUND)
target_link_libraries(slsReceiver ${HDF5_CXX_LIBRARIES})
endif ()