summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt48
1 files changed, 33 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2fb000..c2eb94d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,7 @@ project (HDF5 C)
# set CMAKE_INSTALL_PREFIX to the required install path.
# Make install can be used to install all components for system-wide use.
#
-if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
MESSAGE(FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n"
"CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
" == CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}\n"
@@ -314,7 +314,7 @@ set (HDF5_PACKAGE_NAME "HDF5")
set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}")
set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}")
set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}")
-if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
+if (H5_VERS_SUBRELEASE)
set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}")
else ()
set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}")
@@ -482,6 +482,15 @@ if (HDF5_MEMORY_ALLOC_SANITY_CHECK)
endif ()
#-----------------------------------------------------------------------------
+# Option to enable/disable using pread/pwrite for VFDs
+#-----------------------------------------------------------------------------
+option (HDF5_ENABLE_PREADWRITE "Use pread/pwrite in sec2/log/core VFDs in place of read/write (when available)" ON)
+mark_as_advanced (HDF5_ENABLE_PREADWRITE)
+if (HDF5_ENABLE_PREADWRITE AND H5_HAVE_PREAD AND H5_HAVE_PWRITE)
+ set (H5_HAVE_PREADWRITE 1)
+endif ()
+
+#-----------------------------------------------------------------------------
# Option to use deprecated public API symbols
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON)
@@ -674,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 **** ")
@@ -713,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 ()
@@ -749,6 +760,11 @@ if (BUILD_TESTING)
"Timeout in seconds for each test (default 1200=20minutes)"
)
+ # Generate a list of timeouts based on DART_TESTING_TIMEOUT
+ math (EXPR CTEST_SHORT_TIMEOUT "${DART_TESTING_TIMEOUT} / 2")
+ math (EXPR CTEST_LONG_TIMEOUT "${DART_TESTING_TIMEOUT} * 2")
+ math (EXPR CTEST_VERY_LONG_TIMEOUT "${DART_TESTING_TIMEOUT} * 3")
+
option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF)
mark_as_advanced (HDF5_TEST_VFD)
if (HDF5_TEST_VFD)
@@ -756,6 +772,13 @@ if (BUILD_TESTING)
mark_as_advanced (HDF5_TEST_FHEAP_VFD)
endif ()
+ option (HDF5_TEST_VOL "Execute tests with different VOL connectors" OFF)
+ mark_as_advanced (HDF5_TEST_VOL)
+ if (HDF5_TEST_VOL)
+ option (HDF5_TEST_FHEAP_VOL "Execute fheap test with different VOL connectors" ON)
+ mark_as_advanced (HDF5_TEST_FHEAP_VOL)
+ endif ()
+
option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0")
mark_as_advanced (HDF_TEST_EXPRESS)
@@ -819,25 +842,20 @@ set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _")
if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran")
option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF)
if (HDF5_BUILD_FORTRAN)
-
- option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON)
-
include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake)
message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}")
# Building with PGI requires CMake 3.3 or greater because previous versions
# of CMake add the wrong compiler flag for the PGI Fortran compiler.
- if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI" AND "${CMAKE_VERSION}" VERSION_LESS "3.3")
+ if (CMAKE_Fortran_COMPILER_ID MATCHES "PGI" AND CMAKE_VERSION VERSION_LESS "3.3")
message (FATAL_ERROR " **** PGI FORTRAN REQUIRES CMAKE VERSION 3.3 OR GREATER **** ")
endif ()
include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake)
set (LINK_Fortran_LIBS ${LINK_LIBS})
- if (HDF5_ENABLE_F2003)
- if (NOT FORTRAN_HAVE_ISO_C_BINDING)
- set (HDF5_ENABLE_F2003 OFF)
- endif ()
+ if (NOT H5_FORTRAN_HAVE_ISO_C_BINDING)
+ message (FATAL_ERROR " **** Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, disable HDF5_BUILD_FORTRAN **** ")
endif ()
# Parallel IO usage requires MPI to be Linked and Included