diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2020-12-15 00:13:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 00:13:37 (GMT) |
commit | 4e24a95f942466126b2cab1954281e59c0af6943 (patch) | |
tree | 3d3945e21d087917e11706a9d72f6098a5f4bf2c /config | |
parent | 20aa4bcccaaa29a6c49c793d044a88c812425440 (diff) | |
download | hdf5-4e24a95f942466126b2cab1954281e59c0af6943.zip hdf5-4e24a95f942466126b2cab1954281e59c0af6943.tar.gz hdf5-4e24a95f942466126b2cab1954281e59c0af6943.tar.bz2 |
OESS-98 Update plugin build option (#171)
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/HDF5Macros.cmake | 2 | ||||
-rw-r--r-- | config/cmake/HDF5PluginCache.cmake | 28 | ||||
-rw-r--r-- | config/cmake/HDF5PluginMacros.cmake | 162 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFMacros.cmake | 13 |
4 files changed, 102 insertions, 103 deletions
diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 090524a..007bc29 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -5,7 +5,7 @@ # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in # the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # diff --git a/config/cmake/HDF5PluginCache.cmake b/config/cmake/HDF5PluginCache.cmake new file mode 100644 index 0000000..7f3aea9 --- /dev/null +++ b/config/cmake/HDF5PluginCache.cmake @@ -0,0 +1,28 @@ +# This is the CMakeCache file. + +######################## +# EXTERNAL cache entries +######################## + +# examples are the tests for plugins +set (H5PL_BUILD_TESTING ON CACHE BOOL "Enable h5pl testing" FORCE) +set (BUILD_EXAMPLES ON CACHE BOOL "Build h5pl Examples" FORCE) + +set (HDF5_PACKAGE_NAME "hdf5" CACHE STRING "Name of HDF5 package" FORCE) +set (HDF5_HDF5_HEADER "h5pubconf.h" CACHE STRING "Name of HDF5 header" FORCE) +set (HDF5_LINK_TARGET ${HDF5_LIBSH_TARGET} CACHE STRING "hdf5 target" FORCE) +set (HDF5_LINK_LIBS $<TARGET_LINKER_FILE:${HDF5_LIBSH_TARGET}> CACHE STRING "hdf5 shared link library" FORCE) +#set (HDF5_INCLUDE_DIR $<TARGET_PROPERTY:${HDF5_LIBSH_TARGET},INCLUDE_DIRECTORIES> CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_INCLUDE_DIR "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_INCLUDE_DIRS "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "hdf5 build folder" FORCE) + +set (H5PL_ALLOW_EXTERNAL_SUPPORT "${HDF5_ALLOW_EXTERNAL_SUPPORT}" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) + +set (H5PL_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/h5plugin.git" CACHE STRING "Use plugins from HDF repository" FORCE) +set (H5PL_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (H5PL_TGZ_NAME "${PLUGIN_TGZ_NAME}" CACHE STRING "Use plugins from compressed file" FORCE) + +set (PL_PACKAGE_NAME "${PLUGIN_PACKAGE_NAME}" CACHE STRING "Name of plugins package" FORCE) +set (H5PL_CPACK_ENABLE OFF CACHE BOOL "Enable the CPACK include and components" FORCE) diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake index 46d3979..3c0e12c 100644 --- a/config/cmake/HDF5PluginMacros.cmake +++ b/config/cmake/HDF5PluginMacros.cmake @@ -3,114 +3,72 @@ #------------------------------------------------------------------------------- macro (EXTERNAL_PLUGIN_LIBRARY compress_type) if (${compress_type} MATCHES "GIT") - EXTERNALPROJECT_ADD (PLUGIN + FetchContent_Declare (PLUGIN GIT_REPOSITORY ${PLUGIN_URL} GIT_TAG ${PLUGIN_BRANCH} - LIST_SEPARATOR | - INSTALL_COMMAND "" - CMAKE_ARGS - -DUSE_SHARED_LIBS:BOOL=ON - -DBUILD_SHARED_LIBS:BOOL=ON - -DH5PL_ALLOW_EXTERNAL_SUPPORT:STRING=${HDF5_ALLOW_EXTERNAL_SUPPORT} - -DBUILD_TESTING:STRING=OFF - -DBUILD_EXAMPLES:STRING=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DDISABLE_PLUGIN_ENCODER:BOOL=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - # the hdf5 settings - -DHDF5_PACKAGE_NAME:STRING=hdf5 - -DHDF5_HDF5_HEADER:STRING=h5pubconf.h - -DHDF5_LINK_LIBS:STRING=$<TARGET_LINKER_FILE:${HDF5_LIBSH_TARGET}> - -DHDF5_INCLUDE_DIR:PATH=${HDF5_SRC_DIR}|${HDF5_SRC_BINARY_DIR} - -DPL_PACKAGE_NAME:STRING=${PLUGIN_PACKAGE_NAME} - -DH5PL_CPACK_ENABLE:BOOL=ON - -DHDF5_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR} - -DTGZPATH:PATH=${TGZPATH} - # the filters - -DBSHUF_TGZ_NAME:STRING=${BSHUF_TGZ_NAME} - -DBSHUF_PACKAGE_NAME:STRING=${BSHUF_PACKAGE_NAME} - -DBLOSC_TGZ_NAME:STRING=${BLOSC_TGZ_NAME} - -DBLOSC_PACKAGE_NAME:STRING=${BLOSC_PACKAGE_NAME} - -DZLIB_TGZ_NAME:STRING=${ZLIB_TGZ_NAME} - -DZLIB_PACKAGE_NAME:STRING=${ZLIB_PACKAGE_NAME} - -DBZ2_TGZ_NAME:STRING=${BZ2_TGZ_NAME} - -DBZ2_PACKAGE_NAME:STRING=${BZ2_PACKAGE_NAME} - #-DFPZIP_TGZ_NAME:STRING=${FPZIP_TGZ_NAME} - #-DFPZIP_PACKAGE_NAME:STRING=${FPZIP_PACKAGE_NAME} - -DJPEG_TGZ_NAME:STRING=${JPEG_TGZ_NAME} - -DJPEG_PACKAGE_NAME:STRING=${JPEG_PACKAGE_NAME} - -DLZ4_TGZ_NAME:STRING=${LZ4_TGZ_NAME} - -DLZ4_PACKAGE_NAME:STRING=${LZ4_PACKAGE_NAME} - -DLZF_TGZ_NAME:STRING=${LZF_TGZ_NAME} - -DLZF_PACKAGE_NAME:STRING=${LZF_PACKAGE_NAME} - -DSZF_TGZ_NAME:STRING=${SZF_TGZ_NAME} - -DSZF_PACKAGE_NAME:STRING=${SZF_PACKAGE_NAME} - -DZFP_TGZ_NAME:STRING=${ZFP_TGZ_NAME} - -DZFP_PACKAGE_NAME:STRING=${ZFP_PACKAGE_NAME} ) elseif (${compress_type} MATCHES "TGZ") - EXTERNALPROJECT_ADD (PLUGIN + FetchContent_Declare (PLUGIN URL ${PLUGIN_URL} - URL_MD5 "" - LIST_SEPARATOR | - INSTALL_COMMAND "" - CMAKE_ARGS - -DUSE_SHARED_LIBS:BOOL=ON - -DBUILD_SHARED_LIBS:BOOL=ON - -DH5PL_ALLOW_EXTERNAL_SUPPORT:STRING=${HDF5_ALLOW_EXTERNAL_SUPPORT} - -DBUILD_TESTING:STRING=OFF - -DBUILD_EXAMPLES:STRING=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DDISABLE_PLUGIN_ENCODER:BOOL=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - # the hdf5 settings - -DHDF5_PACKAGE_NAME:STRING=hdf5 - -DHDF5_HDF5_HEADER:STRING=h5pubconf.h - -DHDF5_LINK_LIBS:STRING=$<TARGET_LINKER_FILE:${HDF5_LIBSH_TARGET}> - -DHDF5_INCLUDE_DIR:PATH=${HDF5_SRC_DIR}|${HDF5_SRC_BINARY_DIR} - -DPL_PACKAGE_NAME:STRING=${PLUGIN_PACKAGE_NAME} - -DH5PL_CPACK_ENABLE:BOOL=ON - -DHDF5_DIR:STRING=${CMAKE_CURRENT_BINARY_DIR} - -DTGZPATH:PATH=${TGZPATH} - # the filters - -DBSHUF_TGZ_NAME:STRING=${BSHUF_TGZ_NAME} - -DBSHUF_PACKAGE_NAME:STRING=${BSHUF_PACKAGE_NAME} - -DBLOSC_TGZ_NAME:STRING=${BLOSC_TGZ_NAME} - -DBLOSC_PACKAGE_NAME:STRING=${BLOSC_PACKAGE_NAME} - -DZLIB_TGZ_NAME:STRING=${ZLIB_TGZ_NAME} - -DZLIB_PACKAGE_NAME:STRING=${ZLIB_PACKAGE_NAME} - -DBZ2_TGZ_NAME:STRING=${BZ2_TGZ_NAME} - -DBZ2_PACKAGE_NAME:STRING=${BZ2_PACKAGE_NAME} - #-DFPZIP_TGZ_NAME:STRING=${FPZIP_TGZ_NAME} - #-DFPZIP_PACKAGE_NAME:STRING=${FPZIP_PACKAGE_NAME} - -DJPEG_TGZ_NAME:STRING=${JPEG_TGZ_NAME} - -DJPEG_PACKAGE_NAME:STRING=${JPEG_PACKAGE_NAME} - -DLZ4_TGZ_NAME:STRING=${LZ4_TGZ_NAME} - -DLZ4_PACKAGE_NAME:STRING=${LZ4_PACKAGE_NAME} - -DLZF_TGZ_NAME:STRING=${LZF_TGZ_NAME} - -DLZF_PACKAGE_NAME:STRING=${LZF_PACKAGE_NAME} - -DSZF_TGZ_NAME:STRING=${SZF_TGZ_NAME} - -DSZF_PACKAGE_NAME:STRING=${SZF_PACKAGE_NAME} - -DZFP_TGZ_NAME:STRING=${ZFP_TGZ_NAME} - -DZFP_PACKAGE_NAME:STRING=${ZFP_PACKAGE_NAME} + URL_HASH "" ) endif () - externalproject_get_property (PLUGIN BINARY_DIR SOURCE_DIR) - set (PLUGIN_BINARY_DIR "${BINARY_DIR}") - -# include (${BINARY_DIR}/PLUGIN-targets.cmake) + FetchContent_GetProperties(PLUGIN) + message (STATUS "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + if(NOT PLUGIN_POPULATED) + FetchContent_Populate(PLUGIN) + include (${HDF_RESOURCES_DIR}/HDF5PluginCache.cmake) + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + add_subdirectory(${plugin_SOURCE_DIR} ${plugin_BINARY_DIR}) + if (ENABLE_BLOSC) + add_dependencies (h5blosc ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_blosc ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_blosc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_BSHUF) + add_dependencies (h5bshuf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_bshuf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_bshuf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_BZIP2) + add_dependencies (h5bz2 ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_bzip2 ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_bzip2 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_JPEG) + add_dependencies (h5jpeg ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_jpeg ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_jpeg PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_LZ4) + add_dependencies (h5lz4 ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_lz4 ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_lz4 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_LZF) + add_dependencies (h5lzf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_lzf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_lzf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_MAFISC) + add_dependencies (h5mafisc ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_mafisc ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_mafisc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_SZF) + add_dependencies (h5szf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_szf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_szf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_ZFP) + add_dependencies (h5zfp ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_zfp ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_zfp PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + endif() + message (STATUS "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + set (PLUGIN_BINARY_DIR "${plugin_BINARY_DIR}") + set (PLUGIN_SOURCE_DIR "${plugin_SOURCE_DIR}") set (PLUGIN_LIBRARY "PLUGIN") set (PLUGIN_FOUND 1) endmacro () @@ -129,7 +87,7 @@ macro (FILTER_OPTION plname) elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (NOT TGZPATH) set (TGZPATH ${H5PL_SOURCE_DIR}) - endif () + endif () set (HDF_${plname}_URL ${TGZPATH}/${HDF_${plname}_TGZ_NAME}) endif () endif () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index c42e1b2..c26956b 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -429,6 +429,19 @@ macro (HDF_DIR_PATHS package_prefix) endif () endif () + if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if (CMAKE_HOST_UNIX) + set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + else () + GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) + set (CMAKE_INSTALL_PREFIX + "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + set (CMAKE_GENERIC_PROGRAM_FILES) + endif () + endif () + #----------------------------------------------------------------------------- # Setup pre-3.14 FetchContent #----------------------------------------------------------------------------- |