Skip to content

Commit

Permalink
Fixes for FindHDF5 changes in CMake 3.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakejohnson committed Nov 9, 2016
1 parent f4fb2bd commit 6226f89
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ set(APS2_VERSION_STRING ${APS2_VERSION_MAJOR}.${APS2_VERSION_MINOR}.${APS2_VERSI
# look for HDF5
FIND_PACKAGE(HDF5 REQUIRED COMPONENTS C CXX)
INCLUDE_DIRECTORIES( ${HDF5_INCLUDE_DIRS} )
LINK_DIRECTORIES( ${LINK_DIRECTORIES} ${HDF5_LIBRARY_DIRS} )

# look for threading library
set(THREADS_PREFER_PTHREAD_FLAG ON)
Expand Down Expand Up @@ -127,9 +126,9 @@ TARGET_LINK_LIBRARIES(dac_bist aps2)
SET(bin_targets enumerate play_waveform play_sequence flash reset program dac_bist run_tests)

if(WIN32)
TARGET_LINK_LIBRARIES(aps2 hdf5 hdf5_cpp ws2_32 iphlpapi Threads::Threads)
TARGET_LINK_LIBRARIES(aps2 ${HDF5_CXX_LIBRARIES} ws2_32 iphlpapi Threads::Threads)
else(WIN32)
TARGET_LINK_LIBRARIES(aps2 hdf5 hdf5_cpp Threads::Threads)
TARGET_LINK_LIBRARIES(aps2 ${HDF5_CXX_LIBRARIES} Threads::Threads)
endif(WIN32)

# installation section
Expand All @@ -152,10 +151,10 @@ IF(UNIX AND NOT APPLE)
FILE(GLOB LIBGCC_ALL ${LIBGCC_DIR}/libgcc*.so.1)
FIND_LIBRARY(STDCPP NAMES libstdc++.so.6 HINTS ${GCC_PATH}/../lib64)
FILE(GLOB STDCPP_ALL ${STDCPP}*)
FIND_LIBRARY(HDF5LIB NAMES hdf5 HINTS ${HDF5_LIBRARY_DIRS})
FILE(GLOB HDF5LIB_ALL ${HDF5LIB}.*)
FIND_LIBRARY(HDF5CPPLIB NAMES hdf5_cpp HINTS ${HDF5_LIBRARY_DIRS})
FILE(GLOB HDF5CPPLIB_ALL ${HDF5CPPLIB}.*)
FILE(GLOB HDF5LIB_ALL ${HDF5_C_LIBRARIES}*)
# the CPP lib seems to be the first library listed in HDF5_CXX_LIBRARIES
LIST(GET HDF5_CXX_LIBRARIES 0 HDF5CPPLIB)
FILE(GLOB HDF5CPPLIB_ALL ${HDF5CPPLIB}*)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${LIBGCC_ALL}
${STDCPP_ALL}
Expand Down

0 comments on commit 6226f89

Please sign in to comment.