summaryrefslogtreecommitdiffstats
path: root/CMakeFilters.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeFilters.cmake')
-rw-r--r--CMakeFilters.cmake68
1 files changed, 49 insertions, 19 deletions
diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake
index 5a89564..725390b 100644
--- a/CMakeFilters.cmake
+++ b/CMakeFilters.cmake
@@ -5,17 +5,21 @@
# 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.
+# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
+option (USE_LIBAEC "Use AEC library as SZip Filter" OFF)
+option (USE_LIBAEC_STATIC "Use static AEC library " OFF)
include (ExternalProject)
+include (FetchContent)
+
#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 (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
+ option (ZLIB_USE_EXTERNAL "Use External Library Building for HDF5_ZLIB" 1)
option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
set (ZLIB_URL ${ZLIB_GIT_URL} CACHE STRING "Path to zlib git repository")
@@ -29,12 +33,19 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME})
if (NOT EXISTS "${ZLIB_URL}")
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
- message (STATUS "Filter ZLIB file ${ZLIB_URL} not found")
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Filter ZLIB file ${ZLIB_URL} not found")
+ endif ()
endif ()
set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME})
+ if (USE_LIBAEC)
+ set (SZIP_URL ${TGZPATH}/${SZAEC_TGZ_NAME})
+ endif ()
if (NOT EXISTS "${SZIP_URL}")
set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
- message (STATUS "Filter SZIP file ${SZIP_URL} not found")
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Filter SZIP file ${SZIP_URL} not found")
+ endif ()
endif ()
else ()
set (ZLIB_USE_EXTERNAL 0)
@@ -54,7 +65,6 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
find_package (ZLIB) # Legacy find
if (ZLIB_FOUND)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES})
- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES})
endif ()
endif ()
endif ()
@@ -71,7 +81,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
set (H5_HAVE_FILTER_DEFLATE 1)
set (H5_HAVE_ZLIB_H 1)
set (H5_HAVE_LIBZ 1)
- message (STATUS "Filter ZLIB is built")
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Filter HDF5_ZLIB is built")
+ endif ()
else ()
message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5")
endif ()
@@ -85,12 +97,11 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
if (H5_HAVE_FILTER_DEFLATE)
set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE")
endif ()
- if (BUILD_SHARED_LIBS)
- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY})
- endif ()
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY})
INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS})
- message (STATUS "Filter ZLIB is ON")
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Filter HDF5_ZLIB is ON")
+ endif ()
endif ()
#-----------------------------------------------------------------------------
@@ -100,12 +111,22 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF)
if (HDF5_ENABLE_SZIP_SUPPORT)
option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF)
if (NOT SZIP_USE_EXTERNAL)
- find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
- if (NOT SZIP_FOUND)
- find_package (SZIP) # Legacy find
+ 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})
- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES})
+ endif ()
+ endif ()
+
+ if (NOT SZIP_FOUND)
+ find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
+ if (NOT SZIP_FOUND)
+ find_package (SZIP) # Legacy find
+ if (SZIP_FOUND)
+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
+ endif ()
endif ()
endif ()
endif ()
@@ -121,17 +142,26 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set (H5_HAVE_FILTER_SZIP 1)
set (H5_HAVE_SZLIB_H 1)
set (H5_HAVE_LIBSZ 1)
- message (STATUS "Filter SZIP is built")
+ 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})
+ endif ()
else ()
message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5")
endif ()
endif ()
- if (BUILD_SHARED_LIBS)
- set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY})
- endif ()
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY})
INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS})
- message (STATUS "Filter SZIP is ON")
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Filter SZIP is ON")
+ endif ()
if (H5_HAVE_FILTER_SZIP)
set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE")
endif ()