Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment adding libhdf5 #157

Closed
wants to merge 11 commits into from
1 change: 0 additions & 1 deletion tdms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ endif()

# Compile options -------------------------------------------------------------
target_compile_options(tdms PUBLIC -DMX_COMPAT_32 -c ${DFLAG} -O3)
target_link_libraries(tdms ${HDF5_CXX_LIBRARIES})

if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(tdms PRIVATE /W4)
Expand Down
2 changes: 2 additions & 0 deletions tdms/cmake/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function(release_target)
${Matlab_MX_LIBRARY}
${Matlab_MAT_LIBRARY}
${LIBCXX_LIBRARY}
${HDF5_CXX_LIBRARIES}
OpenMP::OpenMP_CXX
spdlog::spdlog
)
Expand Down Expand Up @@ -44,6 +45,7 @@ function(test_target)
${Matlab_MX_LIBRARY}
${Matlab_MAT_LIBRARY}
${LIBCXX_LIBRARY}
${HDF5_CXX_LIBRARIES}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • the target tdms isn't told to explicitly link to the HDF5 library found during configuration, so the linker just picks up the first one it finds. Adding

      target_link_libraries(tdms ${HDF5_CXX_LIBRARIES})
    

    should do the trick

Mosè's fix is also needed for the dynlib target (at least on my ARM64 Mac which tries to link the wrong HDF5 libraries).

OpenMP::OpenMP_CXX
spdlog::spdlog
)
Expand Down