diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2019-02-21 22:39:37 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2019-02-21 22:39:37 (GMT) |
commit | bcf5c400c06bf06820b25c37eceaa97245f15f1f (patch) | |
tree | 38c116e724cc4ffb97a4a5d4f8eea4b657466fdd /src/CMakeLists.txt | |
parent | b901552b1ca315db8b27ea090011f2f557491d46 (diff) | |
download | hdf5-bcf5c400c06bf06820b25c37eceaa97245f15f1f.zip hdf5-bcf5c400c06bf06820b25c37eceaa97245f15f1f.tar.gz hdf5-bcf5c400c06bf06820b25c37eceaa97245f15f1f.tar.bz2 |
Fix CMake H5_HAVE_THREADSAFE to set value in H5pubconf.h
Add REQUIRED to find_package(Threads)
Link against thread library if static and not WIN32 platform
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 698c143..83240bd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1118,6 +1118,11 @@ target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" PUBLIC $<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}> ) +if (NOT WIN32) + target_link_libraries (${HDF5_LIB_TARGET} + PUBLIC $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads> + ) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) |