2020-09-26 05:43:57 +08:00
|
|
|
#
|
|
|
|
# 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
|
2021-02-17 22:52:36 +08:00
|
|
|
# distribution tree, or in https://www.hdfgroup.org/licenses.
|
2020-09-26 05:43:57 +08:00
|
|
|
# If you do not have access to either file, you may request a copy from
|
|
|
|
# help@hdfgroup.org.
|
|
|
|
#
|
2023-10-18 09:32:31 +08:00
|
|
|
option (PLUGIN_USE_EXTERNAL "Use External Library Building for filter PLUGIN" OFF)
|
2023-10-05 04:51:01 +08:00
|
|
|
|
|
|
|
if (NOT PLUGIN_USE_LOCALCONTENT)
|
2023-10-10 22:30:19 +08:00
|
|
|
set (PLUGIN_URL ${PLUGIN_TGZ_ORIGPATH}/${PLUGIN_TGZ_NAME})
|
2023-10-05 04:51:01 +08:00
|
|
|
else ()
|
|
|
|
if (NOT H5PL_TGZPATH)
|
|
|
|
set (H5PL_TGZPATH ${TGZPATH})
|
|
|
|
endif ()
|
2023-10-10 22:30:19 +08:00
|
|
|
set (PLUGIN_URL ${H5PL_TGZPATH}/${PLUGIN_TGZ_NAME})
|
2023-10-05 04:51:01 +08:00
|
|
|
endif ()
|
|
|
|
message (STATUS "Filter PLUGIN file is ${PLUGIN_URL}")
|
2020-09-26 05:43:57 +08:00
|
|
|
|
|
|
|
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")
|
2023-10-19 03:46:02 +08:00
|
|
|
set (PLUGIN_USE_EXTERNAL ON CACHE BOOL "Use External Library Building for PLUGIN" FORCE)
|
2020-09-26 05:43:57 +08:00
|
|
|
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
|
|
|
|
set (PLUGIN_URL ${PLUGIN_GIT_URL} CACHE STRING "Path to PLUGIN git repository")
|
|
|
|
set (PLUGIN_BRANCH ${PLUGIN_GIT_BRANCH})
|
|
|
|
elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
2023-10-05 04:51:01 +08:00
|
|
|
if (NOT H5PL_TGZPATH)
|
|
|
|
set (H5PL_TGZPATH ${TGZPATH})
|
2020-09-26 05:43:57 +08:00
|
|
|
endif ()
|
2023-10-05 04:51:01 +08:00
|
|
|
if (PLUGIN_USE_LOCALCONTENT)
|
|
|
|
if (NOT EXISTS "${PLUGIN_URL}")
|
|
|
|
set (HDF5_ENABLE_PLUGIN_SUPPORT OFF CACHE BOOL "" FORCE)
|
|
|
|
message (VERBOSE "Filter PLUGIN file ${PLUGIN_URL} not found")
|
|
|
|
endif ()
|
2020-09-26 05:43:57 +08:00
|
|
|
endif ()
|
|
|
|
else ()
|
2023-10-18 09:32:31 +08:00
|
|
|
set (PLUGIN_USE_EXTERNAL OFF CACHE BOOL "Use External Library Building for PLUGIN")
|
2023-10-05 04:51:01 +08:00
|
|
|
message (VERBOSE "Filter PLUGIN not built")
|
2020-09-26 05:43:57 +08:00
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Option for PLUGIN support
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
option (HDF5_ENABLE_PLUGIN_SUPPORT "Enable PLUGIN Filters" OFF)
|
|
|
|
if (HDF5_ENABLE_PLUGIN_SUPPORT)
|
|
|
|
if (NOT PLUGIN_USE_EXTERNAL)
|
|
|
|
find_package (PLUGIN NAMES ${PLUGIN_PACKAGE_NAME}${HDF_PACKAGE_EXT})
|
|
|
|
if (NOT PLUGIN_FOUND)
|
|
|
|
find_package (PLUGIN) # Legacy find
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
if (NOT PLUGIN_FOUND)
|
|
|
|
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
|
|
|
EXTERNAL_PLUGIN_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
|
|
|
|
message (STATUS "Filter PLUGIN is built")
|
|
|
|
else ()
|
|
|
|
message (FATAL_ERROR " PLUGIN is Required for PLUGIN support in HDF5")
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
message (STATUS "Filter PLUGIN is ON")
|
|
|
|
endif ()
|