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

Add capability to enable/disable compression libraries #2712

Merged
merged 2 commits into from
Jul 26, 2023
Merged
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
38 changes: 27 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1134,24 +1134,40 @@ macro(set_std_filter filter)
# Upper case the filter name
string(TOUPPER "${filter}" upfilter)
string(TOLOWER "${filter}" downfilter)
if(ENABLE_${upfilter})
# Define a test flag for filter
IF(${filter}_FOUND)
INCLUDE_DIRECTORIES(${${filter}_INCLUDE_DIRS})
SET(ENABLE_${upfilter} TRUE)
SET(HAVE_${upfilter} ON)
SET(STD_FILTERS "${STD_FILTERS} ${downfilter}")
MESSAGE(">>> Standard Filter: ${downfilter}")
IF(${filter}_FOUND)
INCLUDE_DIRECTORIES(${${filter}_INCLUDE_DIRS})
SET(ENABLE_${upfilter} TRUE)
SET(HAVE_${upfilter} ON)
SET(STD_FILTERS "${STD_FILTERS} ${downfilter}")
MESSAGE(">>> Standard Filter: ${downfilter}")
ELSE()
SET(ENABLE_${upfilter} FALSE)
SET(HAVE_${upfilter} OFF)
ENDIF()
ELSE()
SET(ENABLE_${upfilter} FALSE)
SET(HAVE_${upfilter} OFF)
ENDIF()
endmacro(set_std_filter)

# Locate some compressors
FIND_PACKAGE(Szip)
FIND_PACKAGE(Bz2)
FIND_PACKAGE(Blosc)
FIND_PACKAGE(Zstd)
OPTION(ENABLE_SZIP "Enable use of Szip compression library if it is available." ON)
OPTION(ENABLE_BZ2 "Enable use of Bz2 compression library if it is available." ON)
OPTION(ENABLE_BLOSC "Enable use of blosc compression library if it is available." ON)
OPTION(ENABLE_ZSTD "Enable use of Zstd compression library if it is available." ON)
IF (ENABLE_SZIP)
FIND_PACKAGE(Szip)
ENDIF()
IF (ENABLE_BZ2)
FIND_PACKAGE(Bz2)
ENDIF()
IF (ENABLE_BLOSC)
FIND_PACKAGE(Blosc)
ENDIF()
IF (ENABLE_ZSTD)
FIND_PACKAGE(Zstd)
ENDIF()

# Accumulate standard filters
set(STD_FILTERS "deflate") # Always have deflate*/
Expand Down