Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMake to use plugins and compression fetchcontent #3763

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 32 additions & 79 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,35 @@
# If you do not have access to either file, you may request a copy from
# [email protected].
#
option (USE_LIBAEC "Use AEC library as SZip Filter" ON)
option (USE_LIBAEC_STATIC "Use static AEC library " OFF)
option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0)
option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0)
option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" OFF)
option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" OFF)

option (BUILD_ZLIB_WITH_FETCHCONTENT "Use FetchContent to use original source files" OFF)
if (BUILD_ZLIB_WITH_FETCHCONTENT)
set (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
if (NOT ZLIB_USE_LOCALCONTENT)
set (ZLIB_URL ${ZLIB_TGZ_ORIGPATH}/${ZLIB_TGZ_ORIGNAME})
else ()
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_ORIGNAME})
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter ZLIB file is ${ZLIB_URL}")
endif ()
if (NOT ZLIB_USE_LOCALCONTENT)
set (ZLIB_URL ${ZLIB_TGZ_ORIGPATH}/${ZLIB_TGZ_NAME})
else ()
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME})
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter ZLIB file is ${ZLIB_URL}")
endif ()

option (BUILD_SZIP_WITH_FETCHCONTENT "Use FetchContent to use original source files" OFF)
if (BUILD_SZIP_WITH_FETCHCONTENT)
# Only libaec library is usable
set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE)
set (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
if (NOT LIBAEC_USE_LOCALCONTENT)
set (SZIP_URL ${LIBAEC_TGZ_ORIGPATH}/${LIBAEC_TGZ_ORIGNAME})
else ()
set (SZIP_URL ${TGZPATH}/${LIBAEC_TGZ_ORIGNAME})
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter SZIP file is ${SZIP_URL}")
endif ()
if (NOT LIBAEC_USE_LOCALCONTENT)
set (SZIP_URL ${LIBAEC_TGZ_ORIGPATH}/${LIBAEC_TGZ_NAME})
else ()
set (SZIP_URL ${TGZPATH}/${LIBAEC_TGZ_NAME})
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter SZIP file is ${SZIP_URL}")
endif ()

include (ExternalProject)
#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO")
set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)")
set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
set (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
set (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
set (ZLIB_USE_EXTERNAL ON CACHE BOOL "Use External Library Building for ZLIB" FORCE)
set (SZIP_USE_EXTERNAL ON CACHE BOOL "Use External Library Building for SZIP" FORCE)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
set (ZLIB_URL ${ZLIB_GIT_URL} CACHE STRING "Path to zlib git repository")
set (ZLIB_BRANCH ${ZLIB_GIT_BRANCH})
Expand All @@ -58,9 +47,6 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
if (NOT TGZPATH)
set (TGZPATH ${HDF5_SOURCE_DIR})
endif ()
if (NOT BUILD_ZLIB_WITH_FETCHCONTENT)
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME})
endif ()
if (ZLIB_USE_LOCALCONTENT)
if (NOT EXISTS "${ZLIB_URL}")
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
Expand All @@ -69,12 +55,6 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
endif ()
endif ()
endif ()
if (NOT BUILD_SZIP_WITH_FETCHCONTENT)
set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME})
if (USE_LIBAEC)
set (SZIP_URL ${TGZPATH}/${SZAEC_TGZ_NAME})
endif ()
endif ()
if (LIBAEC_USE_LOCALCONTENT)
if (NOT EXISTS "${SZIP_URL}")
set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
Expand All @@ -84,8 +64,10 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
endif ()
endif ()
else ()
set (ZLIB_USE_EXTERNAL 0)
set (SZIP_USE_EXTERNAL 0)
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
set (ZLIB_USE_EXTERNAL OFF CACHE BOOL "Use External Library Building for ZLIB")
set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
set (SZIP_USE_EXTERNAL OFF CACHE BOOL "Use External Library Building for SZIP")
endif ()
endif ()

Expand All @@ -107,14 +89,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES})
endif ()
else ()
if (BUILD_ZLIB_WITH_FETCHCONTENT)
# Only tgz files available
ORIGINAL_ZLIB_LIBRARY ("TGZ")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "HDF5_ZLIB is built from fetch content")
endif ()
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY})
elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter HDF5_ZLIB is built")
Expand All @@ -140,6 +115,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
message (VERBOSE "Filter HDF5_ZLIB is ON")
endif ()
else ()
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
message (WARNING " ZLib support in HDF5 was enabled but not found")
endif ()
endif ()
Expand All @@ -152,15 +128,13 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" ON)
if (NOT SZIP_USE_EXTERNAL)
set(SZIP_FOUND FALSE)
if (USE_LIBAEC)
set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC})
find_package (libaec 1.0.5 CONFIG)
if (SZIP_FOUND)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
endif ()
set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC})
find_package (libaec 1.0.5 CONFIG)
if (SZIP_FOUND)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
endif ()
if (NOT SZIP_FOUND)
find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
find_package (SZIP NAMES ${LIBAEC_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
if (NOT SZIP_FOUND)
find_package (SZIP) # Legacy find
endif ()
Expand All @@ -171,33 +145,11 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
endif ()
else ()
if (BUILD_SZIP_WITH_FETCHCONTENT)
# Only tgz files available
ORIGINAL_SZIP_LIBRARY ("TGZ" ${HDF5_ENABLE_SZIP_ENCODING})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "SZIP is built from fetch content")
endif ()
if (USE_LIBAEC)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "... with library AEC")
endif ()
set (SZIP_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME})
else ()
set (SZIP_PACKAGE_NAME ${SZIP_PACKAGE_NAME})
endif ()
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY})
elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter SZIP is built")
endif ()
if (USE_LIBAEC)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "... with library AEC")
endif ()
set (SZIP_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME})
else ()
set (SZIP_PACKAGE_NAME ${SZIP_PACKAGE_NAME})
message (VERBOSE "... with library AEC")
endif ()
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY})
endif ()
Expand All @@ -218,6 +170,7 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE")
endif ()
else ()
set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
message (WARNING "SZIP support in HDF5 was enabled but not found")
endif ()
endif ()
2 changes: 1 addition & 1 deletion CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ if (HDF5_PACK_EXAMPLES)
COMPONENT hdfdocuments
)

option (EXAMPLES_USE_RELEASE_NAME "Use the released examples artifact name" OFF)
option (EXAMPLES_DOWNLOAD "Download to use released examples files" OFF)
if (EXAMPLES_DOWNLOAD)
option (EXAMPLES_USE_RELEASE_NAME "Use the released examples artifact name" OFF)
if (EXAMPLES_USE_RELEASE_NAME)
set (EXAMPLES_NAME ${EXAMPLES_TGZ_ORIGNAME})
else ()
Expand Down
22 changes: 14 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,13 @@ set (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}")
set (HDF5_PACKAGE_URL "http://www.hdfgroup.org")
set (HDF5_PACKAGE_BUGREPORT "[email protected]")

#-----------------------------------------------------------------------------
# Set variables needed for installation
#-----------------------------------------------------------------------------
set (HDF5_VERSION_STRING ${HDF5_PACKAGE_VERSION})
set (HDF5_VERSION_MAJOR ${HDF5_PACKAGE_VERSION_MAJOR})
set (HDF5_VERSION_MINOR ${HDF5_PACKAGE_VERSION_MINOR})

#-----------------------------------------------------------------------------
# Include some macros for reusable code
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -475,6 +482,12 @@ include (${HDF_RESOURCES_DIR}/ConfigureChecks.cmake)

set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)

#-----------------------------------------------------------------------------
# Include directories in the source or build tree should come before other
# directories to prioritize headers in the sources over installed ones.
#-----------------------------------------------------------------------------
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)

#-----------------------------------------------------------------------------
# Mac OS X Options
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -803,13 +816,6 @@ option (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF)
if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (HDF5_PACKAGE_EXTLIBS)
set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND AND NOT BUILD_ZLIB_WITH_FETCHCONTENT)
PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
endif ()

if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND AND NOT BUILD_SZIP_WITH_FETCHCONTENT)
PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
endif ()
endif ()
endif ()

Expand All @@ -821,7 +827,7 @@ if (HDF5_ENABLE_THREADSAFE)
# check for unsupported options
if (WIN32)
if (BUILD_STATIC_LIBS)
message (FATAL_ERROR " **** thread-safety option not supported with static library **** ")
message (FATAL_ERROR " **** thread-safety option not supported with static library **** ")
endif ()
endif ()
if (HDF5_ENABLE_PARALLEL)
Expand Down
2 changes: 1 addition & 1 deletion CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else ()
if (CDASH_LOCAL)
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5112")
else ()
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5")
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5112")
endif ()
endif ()
set (CTEST_DROP_SITE_CDASH TRUE)
Expand Down
10 changes: 8 additions & 2 deletions config/cmake/HDF5PluginCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# 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 (BUILD_EXAMPLES ${HDF5_BUILD_EXAMPLES} CACHE BOOL "Build H5PL Examples" FORCE)

#preset HDF5 cache vars to this projects libraries instead of searching
set (H5PL_HDF5_HEADER "H5pubconf.h" CACHE STRING "Name of HDF5 header" FORCE)
Expand All @@ -18,7 +18,13 @@ set (H5PL_HDF5_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "HDF5 build folder"
set (H5PL_HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump-shared> CACHE STRING "HDF5 h5dump target" FORCE)
set (H5PL_HDF5_REPACK_EXECUTABLE $<TARGET_FILE:h5repack-shared> CACHE STRING "HDF5 h5repack target" FORCE)

set (H5PL_ALLOW_EXTERNAL_SUPPORT "${HDF5_ALLOW_EXTERNAL_SUPPORT}" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE)
if (NOT DEFINED H5PL_ALLOW_EXTERNAL_SUPPORT)
set (H5PL_ALLOW_EXTERNAL_SUPPORT "${HDF5_ALLOW_EXTERNAL_SUPPORT}" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE)
endif ()

if (NOT DEFINED H5PL_TGZPATH)
set (H5PL_TGZPATH "${TGZPATH}" CACHE PATH "PATH for finding plugin tgz file" FORCE)
endif ()

set (H5PL_GIT_URL "https://github.com/HDFGroup/hdf5_plugins.git" CACHE STRING "Use plugins from HDF Group repository" FORCE)
set (H5PL_GIT_BRANCH "master" CACHE STRING "" FORCE)
Expand Down
77 changes: 19 additions & 58 deletions config/cmake/HDF5PluginMacros.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#
# Copyright by The HDF Group.
# All rights reserved.
#
# 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.
# If you do not have access to either file, you may request a copy from
# [email protected].
#
#-------------------------------------------------------------------------------
# Plugins must be built SHARED
#-------------------------------------------------------------------------------
Expand All @@ -22,56 +33,6 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type)
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_INCLUDE_DIRS};${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_INCLUDE_DIRS};${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_INCLUDE_DIRS};${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_INCLUDE_DIRS};${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_INCLUDE_DIRS};${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_INCLUDE_DIRS};${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_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR}")
endif ()
if (ENABLE_SZ)
add_dependencies (h5sz ${HDF5_LIBSH_TARGET})
add_dependencies (h5ex_d_sz ${HDF5_LIBSH_TARGET})
target_include_directories (h5ex_d_sz PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${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_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR}")
endif ()
if (ENABLE_ZSTD)
add_dependencies (h5zstd ${HDF5_LIBSH_TARGET})
add_dependencies (h5ex_d_zstd ${HDF5_LIBSH_TARGET})
target_include_directories (h5ex_d_zstd PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR}")
endif ()
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}")
Expand All @@ -87,18 +48,18 @@ macro (FILTER_OPTION plname)
string(TOLOWER ${plname} PLUGIN_NAME)
option (ENABLE_${plname} "Enable Library Building for ${plname} plugin" ON)
if (ENABLE_${plname})
option (HDF_${plname}_USE_EXTERNAL "Use External Library Building for ${PLUGIN_NAME} plugin" 0)
option (HDF_${plname}_USE_EXTERNAL "Use External Library Building for ${PLUGIN_NAME} plugin" OFF)
mark_as_advanced (HDF_${plname}_USE_EXTERNAL)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
set (HDF_${plname}_USE_EXTERNAL 1 CACHE BOOL "Use External Library Building for ${PLUGIN_NAME} plugin" FORCE)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
set (HDF_${plname}_USE_EXTERNAL ON CACHE BOOL "Use External Library Building for ${PLUGIN_NAME} plugin" FORCE)
if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
set (HDF_${plname}_URL ${HDF_${plname}_GIT_URL})
set (HDF_${plname}_BRANCH ${HDF_${plname}_GIT_BRANCH})
elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (NOT TGZPATH)
set (TGZPATH ${H5PL_SOURCE_DIR})
elseif (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (NOT H5PL_COMP_TGZPATH)
set (H5PL_COMP_TGZPATH ${H5PL_SOURCE_DIR}/libs)
endif ()
set (HDF_${plname}_URL ${TGZPATH}/${HDF_${plname}_TGZ_NAME})
set (HDF_${plname}_URL ${H5PL_COMP_TGZPATH}/${HDF_${plname}_TGZ_NAME})
endif ()
endif ()
add_subdirectory (${plname})
Expand Down
Loading