diff --git a/CMakeLists.txt b/CMakeLists.txt index 3721a8fbb..fab49501d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1110,24 +1110,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*/