CMake: (fix) Threads dependency (#3267)

- If the HDF5 library has been build with either thread-safety or
  subfiling VFD feature on it will have an additional dependency
  on a threading library. This dependency has been added to the
  hdf-config.cmake.in file.
This commit is contained in:
Jan-Willem Blokland 2023-07-24 21:43:43 +02:00 committed by GitHub
parent fe7e027db6
commit 8853687933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,6 +69,11 @@ if (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL)
find_package(MPI QUIET REQUIRED)
endif ()
if (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE OR ${HDF5_PACKAGE_NAME}_ENABLE_SUBFILING_VFD)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads QUIET REQUIRED)
endif ()
if (${HDF5_PACKAGE_NAME}_BUILD_JAVA)
set (${HDF5_PACKAGE_NAME}_JAVA_INCLUDE_DIRS
@PACKAGE_CURRENT_BUILD_DIR@/lib/jarhdf5-@HDF5_VERSION_STRING@.jar