Skip to content

Commit

Permalink
CMake: (feature) libaec
Browse files Browse the repository at this point in the history
Implemented better support for the compression library libaec.
Especially, for the new version 1.0.5:
- The CMake config files of this version 1.0.5 now set certain
  SZIP variables which can be used in the existing
  CMake structure.
- Both static and shared SZIP compatible libaec library contains
  all required objects such it can be easily used when building
  HDF5 from scratch.
- Introduced the USE_LIBAEC_STATIC option to make use of the static
  version of SZIP compatible libaec library.
  • Loading branch information
jwsblokland committed Jun 15, 2021
1 parent 978b11c commit 257e19c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# 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)
Expand Down Expand Up @@ -110,12 +111,20 @@ 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
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 ()
else ()
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 ()
if (SZIP_FOUND)
Expand Down

0 comments on commit 257e19c

Please sign in to comment.