summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2019-02-21 22:39:37 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2019-02-21 22:39:37 (GMT)
commitbcf5c400c06bf06820b25c37eceaa97245f15f1f (patch)
tree38c116e724cc4ffb97a4a5d4f8eea4b657466fdd /CMakeLists.txt
parentb901552b1ca315db8b27ea090011f2f557491d46 (diff)
downloadhdf5-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 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6446a7d..c2eb94d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -683,8 +683,10 @@ endif ()
option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF)
if (HDF5_ENABLE_THREADSAFE)
# check for unsupported options
- message (STATUS " **** thread-safety option not supported with static library **** ")
- message (STATUS " **** thread-safety option will not be used building static library **** ")
+ if (WIN32)
+ message (STATUS " **** thread-safety option not supported with static library **** ")
+ message (STATUS " **** thread-safety option will not be used building static library **** ")
+ endif ()
if (HDF5_ENABLE_PARALLEL)
if (NOT ALLOW_UNSUPPORTED)
message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ")
@@ -722,9 +724,9 @@ if (HDF5_ENABLE_THREADSAFE)
endif ()
endif ()
set(THREADS_PREFER_PTHREAD_FLAG ON)
- find_package(Threads)
- if (NOT Threads_FOUND)
- message (STATUS " **** thread-safe package not found - threads still might work **** ")
+ find_package(Threads REQUIRED)
+ if (Threads_FOUND)
+ set (H5_HAVE_THREADSAFE 1)
endif ()
endif ()