summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt33
-rw-r--r--config/cmake/libhdf5.settings.cmake.in88
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--test/CMakeLists.txt14
4 files changed, 92 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d244e44..d46aeee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -254,11 +254,15 @@ ENDIF (WIN32 AND NOT CYGWIN)
#-----------------------------------------------------------------------------
OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
SET (LIB_TYPE STATIC)
+SET (H5_ENABLE_SHARED_LIB NO)
+SET (H5_ENABLE_STATIC_LIB NO)
IF (BUILD_SHARED_LIBS)
SET (LIB_TYPE SHARED)
SET (H5_BUILT_AS_DYNAMIC_LIB 1)
+ SET (H5_ENABLE_SHARED_LIB YES)
ELSE (BUILD_SHARED_LIBS)
SET (H5_BUILT_AS_STATIC_LIB 1)
+ SET (H5_ENABLE_STATIC_LIB YES)
IF (NOT WIN32)
# should this be a user setting : Everyone uses it anyway ?
ADD_DEFINITIONS (-DPIC)
@@ -373,6 +377,14 @@ IF (CMAKE_COMPILER_IS_GNUCC)
ENDIF (CMAKE_COMPILER_IS_GNUCC)
#-----------------------------------------------------------------------------
+# Option to embed library info into executables
+#-----------------------------------------------------------------------------
+OPTION (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON)
+IF (HDF5_ENABLE_EMBEDDED_LIBINFO)
+ SET (H5_HAVE_EMBEDDED_LIBINFO 1)
+ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO)
+
+#-----------------------------------------------------------------------------
# Option to allow the user to disable compiler warnings
#-----------------------------------------------------------------------------
OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
@@ -472,6 +484,7 @@ MACRO (HDF5_SETUP_FILTERS FILTER)
OPTION (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON)
IF (HDF5_USE_FILTER_${FILTER})
SET (H5_HAVE_FILTER_${FILTER} 1)
+ SET (FILTERS "${FILTERS} ${FILTER}")
ENDIF (HDF5_USE_FILTER_${FILTER})
# MESSAGE (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}")
ENDMACRO (HDF5_SETUP_FILTERS)
@@ -532,6 +545,9 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT)
SET (H5_HAVE_ZLIB_H 1)
SET (H5_HAVE_LIBZ 1)
ENDIF (NOT H5_ZLIB_HEADER)
+ IF (H5_HAVE_FILTER_DEFLATE)
+ SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE")
+ ENDIF (H5_HAVE_FILTER_DEFLATE)
SET (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES})
INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS})
MESSAGE (STATUS "Filter ZLIB is ON")
@@ -565,8 +581,12 @@ IF (HDF5_ENABLE_SZIP_SUPPORT)
SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES})
INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS})
MESSAGE (STATUS "Filter SZIP is ON")
+ IF (H5_HAVE_FILTER_SZIP)
+ SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE")
+ ENDIF (H5_HAVE_FILTER_SZIP)
IF (HDF5_ENABLE_SZIP_ENCODING)
SET (H5_HAVE_SZIP_ENCODER 1)
+ SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE")
ENDIF (HDF5_ENABLE_SZIP_ENCODING)
ENDIF (HDF5_ENABLE_SZIP_SUPPORT)
@@ -821,6 +841,19 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
#-----------------------------------------------------------------------------
+# Configure the libhdf5.settings file for the lib info
+#-----------------------------------------------------------------------------
+IF (H5_WORDS_BIGENDIAN)
+ SET (BYTESEX big-endian)
+ELSE (H5_WORDS_BIGENDIAN)
+ SET (BYTESEX little-endian)
+ENDIF (H5_WORDS_BIGENDIAN)
+CONFIGURE_FILE (
+ ${HDF5_RESOURCES_DIR}/libhdf5.settings.cmake.in
+ ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY
+)
+
+#-----------------------------------------------------------------------------
# Add Document File(s) to CMake Install
#-----------------------------------------------------------------------------
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in
index ba233e8..97d09a7 100644
--- a/config/cmake/libhdf5.settings.cmake.in
+++ b/config/cmake/libhdf5.settings.cmake.in
@@ -1,68 +1,68 @@
- SUMMARY OF THE HDF5 CONFIGURATION
- =================================
+ SUMMARY OF THE HDF5 CONFIGURATION
+ =================================
General Information:
-------------------
- HDF5 Version: @H5_VERSION@
- Configured on: @CONFIG_DATE@
- Configured by: @CONFIG_USER@
- Configure mode: @CONFIG_MODE@
- Host system: @host_cpu@-@host_vendor@-@host_os@
- Uname information: @UNAME_INFO@
- Byte sex: @BYTESEX@
- Libraries: @STATIC_SHARED@
- Installation point: @prefix@
+ HDF5 Version: @HDF5_PACKAGE_VERSION@
+ Configured on: @CONFIG_DATE@
+ Configured by: @CMAKE_GENERATOR@
+ Configure mode: CMAKE @CMAKE_VERSION@
+ Host system: @CMAKE_HOST_SYSTEM@
+ Uname information: @CMAKE_SYSTEM_NAME@
+ Byte sex: @BYTESEX@
+ Libraries: @BUILD_NAME_EXT@
+ Installation point: @CMAKE_INSTALL_PREFIX@
Compiling Options:
------------------
- Compilation Mode: @CONFIG_MODE@
- C Compiler: @CC_VERSION@
- CFLAGS: @CFLAGS@
+ Compilation Mode: @CMAKE_BUILD_TYPE@
+ C Compiler: @CMAKE_C_COMPILER@
+ CFLAGS: @CMAKE_C_FLAGS@
H5_CFLAGS: @H5_CFLAGS@
AM_CFLAGS: @AM_CFLAGS@
- CPPFLAGS: @CPPFLAGS@
+ CPPFLAGS: @CMAKE_CXX_FLAGS@
H5_CPPFLAGS: @H5_CPPFLAGS@
AM_CPPFLAGS: @AM_CPPFLAGS@
- Shared Libraries: @enable_shared@
- Static Libraries: @enable_static@
- Statically Linked Executables: @STATIC_EXEC@
- LDFLAGS: @LDFLAGS@
+ Shared Libraries: @H5_ENABLE_SHARED_LIB@
+ Static Libraries: @H5_ENABLE_STATIC_LIB@
+ Statically Linked Executables: @BUILD_STATIC_EXECS@
+ LDFLAGS: @CMAKE_SHARED_LINKER_FLAGS@
AM_LDFLAGS: @AM_LDFLAGS@
- Extra libraries: @LIBS@
- Archiver: @AR@
- Ranlib: @RANLIB@
- Debugged Packages: @DEBUG_PKG@
- API Tracing: @TRACE_API@
+ Extra libraries: @LINK_LIBS@
+ Archiver: @CMAKE_AR@
+ Ranlib: @CMAKE_RANLIB@
+ Debugged Packages: @DEBUG_PKG@
+ API Tracing: @HDF5_ENABLE_TRACE@
Languages:
----------
- Fortran: @HDF_FORTRAN@
-@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @FC@
-@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @FCFLAGS@
+ Fortran: @HDF5_BUILD_FORTRAN@
+@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@
+@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @CMAKE_Fortran_FLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@
- C++: @HDF_CXX@
-@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CXX@
-@BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CXXFLAGS@
+ C++: @HDF5_BUILD_CPP_LIB@
+@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CMAKE_CXX_COMPILER@
+@BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CMAKE_CXX_FLAGS@
@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@
@BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@
Features:
---------
- Parallel HDF5: @PARALLEL@
- High Level library: @HDF5_HL@
- Threadsafety: @THREADSAFE@
+ Parallel HDF5: @HDF5_ENABLE_PARALLEL@
+ High Level library: @HDF5_BUILD_HL_LIB@
+ Threadsafety: @HDF5_ENABLE_THREADSAFE@
Default API Mapping: @DEFAULT_API_VERSION@
- With Deprecated Public Symbols: @DEPRECATED_SYMBOLS@
+ With Deprecated Public Symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@
I/O filters (external): @EXTERNAL_FILTERS@
I/O filters (internal): @FILTERS@
- MPE: @MPE@
- Direct VFD: @DIRECT_VFD@
- dmalloc: @HAVE_DMALLOC@
-Clear file buffers before write: @CLEARFILEBUF@
- Using memory checker: @USINGMEMCHECKER@
- Function Stack Tracing: @CODESTACK@
- GPFS: @GPFS@
- Strict File Format Checks: @STRICT_FORMAT_CHECKS@
- Optimization Instrumentation: @INSTRUMENT@
- Large File Support (LFS): @LARGEFILE@
+ MPE: @H5_HAVE_LIBLMPE@
+ Direct VFD: @H5_HAVE_DIRECT@
+ dmalloc: @H5_HAVE_LIBDMALLOC@
+Clear file buffers before write: @HDF5_Enable_Clear_File_Buffers@
+ Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@
+ Function Stack Tracing: @HDF5_ENABLE_CODESTACK@
+ GPFS: @HDF5_ENABLE_GPFS@
+ Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@
+ Optimization Instrumentation: @HDF5_Enable_Instrument@
+ Large File Support (LFS): @HDF5_ENABLE_LARGE_FILE@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 016ac2a..861a4fe 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -641,6 +641,7 @@ ADD_CUSTOM_COMMAND (
COMMAND ${CMD}
ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
DEPENDS H5make_libsettings
+ WORKING_DIRECTORY ${HDF5_BINARY_DIR}
)
ADD_CUSTOM_COMMAND (
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index fe4dc5b..ab19fea 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -462,6 +462,20 @@ ADD_TEST (NAME links_env COMMAND "${CMAKE_COMMAND}"
)
SET_TESTS_PROPERTIES(links_env PROPERTIES DEPENDS h5test-clear-links_env-objects)
+#-- Adding test for libinfo
+SET (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake)
+FILE (WRITE ${GREP_RUNNER}
+ "FILE (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\")
+IF (\${TEST_RESULT} STREQUAL \"0\")
+ MESSAGE (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\")
+ELSE (\${TEST_RESULT} STREQUAL \"0\")
+ MESSAGE (STATUS \"COMMAND Result: \${TEST_RESULT}\")
+ENDIF (\${TEST_RESULT} STREQUAL \"0\")
+"
+)
+
+ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}")
+
##############################################################################
##############################################################################
### V F D T E S T S ###