summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-07-12 17:19:16 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-07-12 17:19:16 (GMT)
commite2750fc5153069d614eb8ec6fecaee4eeeb642cf (patch)
tree3b6827cc467a256f4d370a44ed819f1e7a9fc7ff /CMakeLists.txt
parent3bd9ac725c8807150bf6ed8fe1cdd2f09d7a595e (diff)
downloadhdf5-e2750fc5153069d614eb8ec6fecaee4eeeb642cf.zip
hdf5-e2750fc5153069d614eb8ec6fecaee4eeeb642cf.tar.gz
hdf5-e2750fc5153069d614eb8ec6fecaee4eeeb642cf.tar.bz2
[svn-r30173] Add GIT support and correct name of option for UNSUPPORTED
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt115
1 files changed, 65 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62dcb10..6a725bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,10 +177,16 @@ set (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++)
set (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test)
set (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl)
set (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++)
+set (HDF5_HL_TOOLS_DIR ${HDF5_SOURCE_DIR}/hl/tools)
+set (HDF5_TOOLS_DIR ${HDF5_SOURCE_DIR}/tools)
set (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools)
set (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/tools/perform)
set (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran)
+if (APPLE)
+ option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE)
+endif (APPLE)
+
if (NOT HDF5_INSTALL_BIN_DIR)
set (HDF5_INSTALL_BIN_DIR bin)
endif (NOT HDF5_INSTALL_BIN_DIR)
@@ -193,7 +199,6 @@ 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)
@@ -212,6 +217,10 @@ if (NOT HDF5_INSTALL_DATA_DIR)
endif (NOT WIN32)
endif (NOT HDF5_INSTALL_DATA_DIR)
+if(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}")
+ set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
+endif(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}")
+
#-----------------------------------------------------------------------------
# parse the full version number from H5public.h and include in H5_VERS_INFO
#-----------------------------------------------------------------------------
@@ -335,6 +344,11 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
set (CMAKE_Fortran_MODULE_DIRECTORY
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules."
)
+ if (WIN32)
+ set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
+ else (WIN32)
+ set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+ endif (WIN32)
else (NOT HDF5_EXTERNALLY_CONFIGURED)
# if we are externally configured, but the project uses old cmake scripts
# this may not be set and utilities like H5detect will fail
@@ -575,53 +589,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 (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)
- 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)
#-----------------------------------------------------------------------------
# Add the HDF5 Library Target to the build
@@ -663,12 +678,12 @@ if (BUILD_TESTING)
option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0")
mark_as_advanced (HDF_TEST_EXPRESS)
- include (${HDF5_SOURCE_DIR}/CTestConfig.cmake)
- configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)
-
enable_testing ()
include (CTest)
+ include (${HDF5_SOURCE_DIR}/CTestConfig.cmake)
+ configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)
+
if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test")
add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib)