summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt95
1 files changed, 48 insertions, 47 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1035142..65124ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -193,10 +193,10 @@ endif (NOT HDF5_INSTALL_LIB_DIR)
if (NOT HDF5_INSTALL_INCLUDE_DIR)
set (HDF5_INSTALL_INCLUDE_DIR include)
endif (NOT HDF5_INSTALL_INCLUDE_DIR)
+option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE)
if (NOT HDF5_INSTALL_DATA_DIR)
if (NOT WIN32)
if (APPLE)
- option (HDF5_BUILD_FRAMEWORKS "Create a Mac OSX Framework" OFF)
if (HDF5_BUILD_FRAMEWORKS)
set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport)
else (HDF5_BUILD_FRAMEWORKS)
@@ -321,7 +321,6 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
#-----------------------------------------------------------------------------
# Mac OS X Options
#-----------------------------------------------------------------------------
-option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" TRUE)
if (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS)
set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries")
endif (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS)
@@ -435,10 +434,6 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
set (H5_HAVE_INSTRUMENTED_LIBRARY 1)
endif (HDF5_ENABLE_INSTRUMENT)
mark_as_advanced (HDF5_ENABLE_INSTRUMENT)
- #-- NMake Makefiles will overwhelm the console with warnings if -Wall is used.
- if (NOT WIN32)
- add_definitions (-Wall)
- endif (NOT WIN32)
else (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions (-DNDEBUG)
if (HDF5_ENABLE_TRACE)
@@ -540,48 +535,54 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
endif (NOT HDF5_EXTERNALLY_CONFIGURED)
#-----------------------------------------------------------------------------
# Option to use threadsafe
-# Note: Currently CMake only allows configuring of threadsafe on
-# non-Cygwin WINDOWS.
#-----------------------------------------------------------------------------
-if (WIN32)
- 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 (HDF5_ENABLE_PARALLEL)
- if (NOT ALLOW_UNSUPPORTED)
- message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ")
- else (NOT ALLOW_UNSUPPORTED)
- message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ")
- endif (NOT ALLOW_UNSUPPORTED)
- endif (HDF5_ENABLE_PARALLEL)
- if (HDF5_BUILD_FORTRAN)
- if (NOT ALLOW_UNSUPPORTED)
- message (STATUS " **** Fortran and thread-safety options are not supported **** ")
- message (STATUS " **** thread-safety option will not be used building Fortran library **** ")
- else (NOT ALLOW_UNSUPPORTED)
- message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ")
- endif (NOT ALLOW_UNSUPPORTED)
- endif (HDF5_BUILD_FORTRAN)
- if (HDF5_BUILD_CPP_LIB)
- if (NOT ALLOW_UNSUPPORTED)
- message (STATUS " **** C++ and thread-safety options are not supported **** ")
- message (STATUS " **** thread-safety option will not be used building C++ library **** ")
- else (NOT ALLOW_UNSUPPORTED)
- message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ")
- endif (NOT ALLOW_UNSUPPORTED)
- endif (HDF5_BUILD_CPP_LIB)
- if (H5_HAVE_IOEO)
- message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ")
- set (H5_HAVE_WIN_THREADS 1)
- else (H5_HAVE_IOEO)
- if (NOT H5_HAVE_PTHREAD_H)
- message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ")
- endif (NOT H5_HAVE_PTHREAD_H)
- endif (H5_HAVE_IOEO)
- endif (HDF5_ENABLE_THREADSAFE)
-endif (WIN32)
+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 (HDF5_ENABLE_PARALLEL)
+ if (NOT ALLOW_UNSUPPORTED)
+ message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ")
+ else (NOT ALLOW_UNSUPPORTED)
+ message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ")
+ endif (NOT ALLOW_UNSUPPORTED)
+ endif (HDF5_ENABLE_PARALLEL)
+ if (HDF5_BUILD_FORTRAN)
+ if (NOT ALLOW_UNSUPPORTED)
+ message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ")
+ else (NOT ALLOW_UNSUPPORTED)
+ message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ")
+ endif (NOT ALLOW_UNSUPPORTED)
+ endif (HDF5_BUILD_FORTRAN)
+ if (HDF5_BUILD_CPP_LIB)
+ if (NOT ALLOW_UNSUPPORTED)
+ message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ")
+ else (NOT ALLOW_UNSUPPORTED)
+ message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ")
+ endif (NOT ALLOW_UNSUPPORTED)
+ endif (HDF5_BUILD_CPP_LIB)
+ if (HDF5_BUILD_HL_LIB)
+ if (NOT ALLOW_UNSUPPORTED)
+ message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ")
+ else (NOT ALLOW_UNSUPPORTED)
+ message (STATUS " **** Allowing unsupported HL and thread-safety options **** ")
+ endif (NOT ALLOW_UNSUPPORTED)
+ endif (HDF5_BUILD_HL_LIB)
+ if (H5_HAVE_IOEO)
+ message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ")
+ set (H5_HAVE_WIN_THREADS 1)
+ else (H5_HAVE_IOEO)
+ if (NOT H5_HAVE_PTHREAD_H)
+ message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ")
+ endif (NOT H5_HAVE_PTHREAD_H)
+ endif (H5_HAVE_IOEO)
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads)
+ if (NOT Threads_FOUND)
+ message (STATUS " **** thread-safe package not found - threads still might work **** ")
+ endif (NOT Threads_FOUND)
+endif (HDF5_ENABLE_THREADSAFE)
# -----------------------------------------------------------------------
# wrapper script variables