diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2015-03-17 18:59:19 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2015-03-17 18:59:19 (GMT) |
commit | e5d4692a97f4b28d97b7bd555da51b8571ee76e5 (patch) | |
tree | 1846f4408df49e49568dbdb76931596f7ee32dc0 | |
parent | 17f78f8469fca0787aa9ef8fbed07d55b0ee4510 (diff) | |
download | hdf5-e5d4692a97f4b28d97b7bd555da51b8571ee76e5.zip hdf5-e5d4692a97f4b28d97b7bd555da51b8571ee76e5.tar.gz hdf5-e5d4692a97f4b28d97b7bd555da51b8571ee76e5.tar.bz2 |
[svn-r26465] Merge back from DB branch; cmake defaults and compressed examples
-rw-r--r-- | CMakeInstallation.cmake | 10 | ||||
-rw-r--r-- | CMakeLists.txt | 61 | ||||
-rw-r--r-- | config/cmake/README.txt.cmake.in | 8 | ||||
-rw-r--r-- | config/cmake/cacheinit.cmake | 4 |
4 files changed, 48 insertions, 35 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 74224a2..37afa89 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -176,9 +176,17 @@ if (HDF5_PACK_EXAMPLES) COMPONENT hdfdocuments ) if (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED} + ) + install ( + DIRECTORY ${HDF5_BINARY_DIR}/HDF5Examples-0.1.1-Source + DESTINATION ${HDF5_INSTALL_DATA_DIR} + USE_SOURCE_PERMISSIONS + COMPONENT hdfdocuments + ) install ( FILES - ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED} ${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments diff --git a/CMakeLists.txt b/CMakeLists.txt index a09ab1a..2a487c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -369,10 +369,11 @@ endif (MAKE_SYSTEM) #----------------------------------------------------------------------------- # Add some definitions for Debug Builds #----------------------------------------------------------------------------- +option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) +mark_as_advanced (HDF5_ENABLE_TRACE) if (CMAKE_BUILD_TYPE MATCHES Debug) add_definitions (-DDEBUG) # Enable tracing of the API - option (HDF5_ENABLE_TRACE "Enable API tracing capability" ON) if (HDF5_ENABLE_TRACE) add_definitions (-DH5_DEBUG_API ) endif (HDF5_ENABLE_TRACE) @@ -381,14 +382,13 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) if (HDF5_ENABLE_INSTRUMENT) set (H5_HAVE_INSTRUMENTED_LIBRARY 1) endif (HDF5_ENABLE_INSTRUMENT) - mark_as_advanced (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) - option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) if (HDF5_ENABLE_TRACE) add_definitions (-DH5_DEBUG_API ) endif (HDF5_ENABLE_TRACE) @@ -685,6 +685,9 @@ endif (HDF5_USE_18_API_DEFAULT) #----------------------------------------------------------------------------- include (UserMacros.cmake) +#----------------------------------------------------------------------------- +# Include filter (zlib, szip, etc.) macros +#----------------------------------------------------------------------------- include (CMakeFilters.cmake) #----------------------------------------------------------------------------- @@ -792,6 +795,27 @@ if (BUILD_TESTING) endif (BUILD_TESTING) #----------------------------------------------------------------------------- +# Option to build examples +#----------------------------------------------------------------------------- +if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON) + if (HDF5_BUILD_EXAMPLES) + add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) + endif (HDF5_BUILD_EXAMPLES) +endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + +#----------------------------------------------------------------------------- +# Option to build High Level API's +#----------------------------------------------------------------------------- +if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON) + if (HDF5_BUILD_HL_LIB) + set (H5_INCLUDE_HL 1) + add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) + endif (HDF5_BUILD_HL_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + +#----------------------------------------------------------------------------- # Option to build Fortran bindings/tests/examples # Make sure this appears before the CONFIGURE_FILE step # so that fortran name mangling is detected before writing H5pubconf.h @@ -829,20 +853,10 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") #----------------------------------------------------------------------------- -# Option to build examples -#----------------------------------------------------------------------------- -if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") - option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) - if (HDF5_BUILD_EXAMPLES) - add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) - endif (HDF5_BUILD_EXAMPLES) -endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") - -#----------------------------------------------------------------------------- # Option to build HDF5 C++ Library #----------------------------------------------------------------------------- if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") - option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) + option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" ON) if (HDF5_BUILD_CPP_LIB) # check for unsupported options if (HDF5_ENABLE_PARALLEL) @@ -852,6 +866,12 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") set (H5_NO_STD 1) endif (CMAKE_NO_STD_NAMESPACE) add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) + if (HDF5_BUILD_HL_LIB) + if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") + #-- Build the High Level Fortran source codes + add_subdirectory (${HDF5_SOURCE_DIR}/hl/c++ ${PROJECT_BINARY_DIR}/hl/c++) + endif (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") + endif (HDF5_BUILD_HL_LIB) endif (HDF5_BUILD_CPP_LIB) endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") @@ -859,24 +879,13 @@ endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++" # Option to build HDF5 Tools #----------------------------------------------------------------------------- if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") - option (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) + option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON) if (HDF5_BUILD_TOOLS) add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) endif (HDF5_BUILD_TOOLS) endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") #----------------------------------------------------------------------------- -# Option to build High Level API's -#----------------------------------------------------------------------------- -if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") - option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) - if (HDF5_BUILD_HL_LIB) - set (H5_INCLUDE_HL 1) - add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) - endif (HDF5_BUILD_HL_LIB) -endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") - -#----------------------------------------------------------------------------- # Check if Fortran's default real is double precision. If it is and HL is # being built then configure should fail due to bug HDFFV-889. #----------------------------------------------------------------------------- diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 4044ce5..b88fedf 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -24,15 +24,15 @@ Installation After Installation =========================================================================== -The compressed examples file HDF5Examples-0.1.1-Source.@BINARY_EXAMPLE_ENDING@, located in the +The examples folder, HDF5Examples, located in the HDF5 install folder, can be built and tested with CMake and the supplied HDF518_Examples.cmake file. The HDF518_Examples.cmake expects HDF5 to have -been installed in the default location with above compilers. Also, CMake and 7Zip -utilities should be installed. +been installed in the default location with above compilers. Also, the CMake +utility should be installed. To test the installation with the examples; Create a directory to run the examples. - Copy HDF5Examples-0.1.1-Source.@BINARY_EXAMPLE_ENDING@ to this directory, do NOT unzip. + Copy HDF5Examples-0.1.1-Source folder to this directory, do NOT unzip. Copy HDF518_Examples.cmake to this directory. Edit HDF518_Examples.cmake line 8 to set INSTALLDIR to where HDF5 is installed. (The default should be correct unless you installed into a different folder.) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index e68afe6..a18395f 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -10,10 +10,6 @@ set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) -set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) - -set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) - set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) |