summaryrefslogtreecommitdiffstats
path: root/CMakePlugins.cmake
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2020-11-20 21:54:28 (GMT)
committerGitHub <noreply@github.com>2020-11-20 21:54:28 (GMT)
commit8d5854cb806a6cf67d2c7cffef9749170d7a8d7d (patch)
tree30385be2bae602f77ec2a2087e2e06bbaf933dcf /CMakePlugins.cmake
parentaab84e704d10c15e8e759d75f809158c1923b6d5 (diff)
downloadhdf5-8d5854cb806a6cf67d2c7cffef9749170d7a8d7d.zip
hdf5-8d5854cb806a6cf67d2c7cffef9749170d7a8d7d.tar.gz
hdf5-8d5854cb806a6cf67d2c7cffef9749170d7a8d7d.tar.bz2
Multiple changes to bring branch up-to-date (#87)
Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros.
Diffstat (limited to 'CMakePlugins.cmake')
-rw-r--r--CMakePlugins.cmake56
1 files changed, 56 insertions, 0 deletions
diff --git a/CMakePlugins.cmake b/CMakePlugins.cmake
new file mode 100644
index 0000000..da8de42
--- /dev/null
+++ b/CMakePlugins.cmake
@@ -0,0 +1,56 @@
+#
+# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+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")
+ option (PLUGIN_USE_EXTERNAL "Use External Library Building for filter PLUGIN" 1)
+ 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")
+ if (NOT TGZPATH)
+ set (TGZPATH ${HDF5_SOURCE_DIR})
+ endif ()
+ set (PLUGIN_URL ${TGZPATH}/${PLUGIN_TGZ_NAME})
+ if (NOT EXISTS "${PLUGIN_URL}")
+ set (HDF5_ENABLE_PLUGIN_SUPPORT OFF CACHE BOOL "" FORCE)
+ message (STATUS "Filter PLUGIN file ${PLUGIN_URL} not found")
+ endif ()
+ else ()
+ set (PLUGIN_USE_EXTERNAL 0)
+ 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 ()