summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt22
-rw-r--r--config/cmake/ConfigureChecks.cmake4
-rw-r--r--config/cmake/H5pubconf.h.in3
-rwxr-xr-xconfig/cmake/cacheinit.cmake2
-rw-r--r--fortran/src/CMakeLists.txt25
-rw-r--r--src/CMakeLists.txt21
-rw-r--r--src/H5private.h10
7 files changed, 46 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5e33a3..d244e44 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -365,7 +365,11 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
IF (CMAKE_COMPILER_IS_GNUCC)
- SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
+ IF (CMAKE_BUILD_TYPE MATCHES Debug)
+ SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common")
+ ELSE (CMAKE_BUILD_TYPE MATCHES Debug)
+ SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
+ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
ENDIF (CMAKE_COMPILER_IS_GNUCC)
#-----------------------------------------------------------------------------
@@ -453,6 +457,15 @@ IF (HDF5_USE_16_API_DEFAULT)
ENDIF (HDF5_USE_16_API_DEFAULT)
#-----------------------------------------------------------------------------
+# Option to use 1.8.x API
+#-----------------------------------------------------------------------------
+OPTION (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF)
+SET (H5_USE_18_API_DEFAULT 0)
+IF (HDF5_USE_18_API_DEFAULT)
+ SET (H5_USE_18_API_DEFAULT 1)
+ENDIF (HDF5_USE_18_API_DEFAULT)
+
+#-----------------------------------------------------------------------------
# Options for HDF5 Filters
#-----------------------------------------------------------------------------
MACRO (HDF5_SETUP_FILTERS FILTER)
@@ -586,8 +599,13 @@ IF (WIN32 AND NOT CYGWIN)
ENDIF (HDF5_ENABLE_PARALLEL)
SET (H5_HAVE_THREADSAFE 1)
IF (H5_HAVE_IOEO)
- MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7)**** ")
+ MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ")
SET (H5_HAVE_WIN_THREADS 1)
+ ELSE (H5_HAVE_IOEO)
+ IF (NOT H5_HAVE_PTHREAD_H)
+ SET (H5_HAVE_THREADSAFE 0)
+ MESSAGE (FATAL " **** Threadsafe option requires thread library **** ")
+ ENDIF (NOT H5_HAVE_PTHREAD_H)
ENDIF (H5_HAVE_IOEO)
ENDIF (HDF5_ENABLE_THREADSAFE)
ENDIF (WIN32 AND NOT CYGWIN)
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 1c6c8e4..145fd98 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -590,7 +590,7 @@ ENDIF (NOT WINDOWS)
#-----------------------------------------------------------------------------
# Check if InitOnceExecuteOnce is available
#-----------------------------------------------------------------------------
-IF (WINDOWS)
+IF (WINDOWS AND NOT HDF5_NO_IOEO_TEST)
MESSAGE (STATUS "Checking for InitOnceExecuteOnce:")
IF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$")
IF (LARGEFILE)
@@ -648,7 +648,7 @@ IF (WINDOWS)
"Return value: ${HAVE_IOEO_EXITCODE}\n")
ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0)
ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$")
-ENDIF (WINDOWS)
+ENDIF (WINDOWS AND NOT HDF5_NO_IOEO_TEST)
#-----------------------------------------------------------------------------
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index ae2e1a0..31a0829 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -722,6 +722,9 @@
/* Define using v1.6 public API symbols by default */
#cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@
+/* Define using v1.8 public API symbols by default */
+#cmakedefine H5_USE_18_API_DEFAULT @H5_USE_18_API_DEFAULT@
+
/* Define if a memory checking tool will be used on the library, to cause
library to be very picky about memory operations and also disable the
internal free list manager code. */
diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake
index c967ce5..6293c35 100755
--- a/config/cmake/cacheinit.cmake
+++ b/config/cmake/cacheinit.cmake
@@ -38,6 +38,8 @@ SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" F
SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
+SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE)
+
SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index d5cbc1b..ef858c6 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -2,15 +2,6 @@ cmake_minimum_required (VERSION 2.8)
PROJECT (HDF5_F90_SRC C CXX Fortran)
#-----------------------------------------------------------------------------
-# When building utility executables that generate other (source) files :
-# we make use of the following variables defined in the root CMakeLists.
-# Certain systems may add /Debug or /Release to output paths
-# and we need to call the executable from inside the CMake configuration
-#-----------------------------------------------------------------------------
-#inherit EXE_EXT from parent HDF5 cmake project
-#inherit CFG_INIT from parent HDF5 cmake project
-
-#-----------------------------------------------------------------------------
# Setup the Fortran auto-detection utilities
# H5test_kind(_SIZEOF).f90 used to generate H5fortran_detect.f90
# H5fortran_detect.f90 used to generate H5fort_type_defines.h
@@ -39,7 +30,7 @@ IF (WIN32 AND MSVC)
ENDIF (WIN32 AND MSVC)
SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran)
-SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5test_FortranHavekind${EXE_EXT})
+SET (CMD $<TARGET_FILE:H5test_FortranHavekind>)
ADD_CUSTOM_COMMAND (
OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90
COMMAND ${CMD}
@@ -63,9 +54,9 @@ IF (WIN32 AND MSVC)
LINK_FLAGS "/SUBSYSTEM:CONSOLE"
)
ENDIF (WIN32 AND MSVC)
-SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran)
-SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5fortran_detect${EXE_EXT})
+SET (CMD $<TARGET_FILE:H5fortran_detect>)
ADD_CUSTOM_COMMAND (
OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h
COMMAND ${CMD}
@@ -80,7 +71,7 @@ ADD_EXECUTABLE (H5match_types
${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h
${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c
)
-SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5match_types${EXE_EXT})
+SET (CMD $<TARGET_FILE:H5match_types>)
ADD_CUSTOM_COMMAND (
OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
${HDF5_F90_BINARY_DIR}/H5fortran_types.f90
@@ -189,16 +180,16 @@ SET (SHARED_LINK_FLAGS " ")
IF (WIN32 AND NOT CYGWIN)
IF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET}
- APPEND PROPERTY COMPILE_DEFINITIONS
- BUILD_HDF5_DLL
- )
+ APPEND PROPERTY COMPILE_DEFINITIONS
+ BUILD_HDF5_DLL
+ )
IF (MSVC)
SET (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def")
ENDIF (MSVC)
ENDIF (BUILD_SHARED_LIBS)
SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET}
APPEND PROPERTY COMPILE_DEFINITIONS
- HDF5F90_WINDOWS
+ HDF5F90_WINDOWS
)
ENDIF (WIN32 AND NOT CYGWIN)
TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${SHARED_LINK_FLAGS})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7fd40c0..016ac2a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -614,27 +614,15 @@ INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR})
INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR})
#-----------------------------------------------------------------------------
-# When building utility executables that generate other (source) files :
-# we make use of the following variables defined in the root CMakeLists.
-# Certain systems may add /Debug or /Release to output paths
-# and we need to call the executable from inside the CMake configuration
-#-----------------------------------------------------------------------------
-#inherit EXE_EXT from parent HDF5 cmake project
-#inherit CFG_INIT from parent HDF5 cmake project
-
-#-----------------------------------------------------------------------------
# Setup the H5Detect utility which generates H5Tinit with platform
# specific type checks inside
#-----------------------------------------------------------------------------
-SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5detect${EXE_EXT})
-IF (XCODE)
- SET (CMD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5detect")
-ENDIF (XCODE)
ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c)
IF (MSVC)
TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib")
ENDIF (MSVC)
+SET (CMD $<TARGET_FILE:H5detect>)
ADD_CUSTOM_COMMAND (
OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
COMMAND ${CMD}
@@ -642,18 +630,15 @@ ADD_CUSTOM_COMMAND (
DEPENDS H5detect
)
-SET (CMDL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5make_libsettings${EXE_EXT})
-IF (XCODE)
- SET (CMDL "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5make_libsettings")
-ENDIF (XCODE)
ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
IF (MSVC)
TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib")
ENDIF (MSVC)
+SET (CMD $<TARGET_FILE:H5make_libsettings>)
ADD_CUSTOM_COMMAND (
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
- COMMAND ${CMDL}
+ COMMAND ${CMD}
ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
DEPENDS H5make_libsettings
)
diff --git a/src/H5private.h b/src/H5private.h
index 9978cd1..d87ad90 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -30,11 +30,17 @@
/* include the pthread header */
#ifdef H5_HAVE_THREADSAFE
+ #ifdef _WIN32
+ #ifndef H5_HAVE_WIN_THREADS
#ifdef H5_HAVE_PTHREAD_H
#include <pthread.h>
-#else /* H5_HAVE_PTHREAD_H */
-#define H5_HAVE_WIN_THREADS
#endif /* H5_HAVE_PTHREAD_H */
+ #endif /* H5_HAVE_WIN_THREADS */
+ #else /* _WIN32 */
+ #ifdef H5_HAVE_PTHREAD_H
+ #include <pthread.h>
+ #endif /* H5_HAVE_PTHREAD_H */
+ #endif /* _WIN32 */
#endif /* H5_HAVE_THREADSAFE */
/*