Skip to content

Commit 4a092c7

Browse files
committed
Merge branch 'patch-57' of https://github.com/gsjaardema/netcdf-c into gh2712-parity.wif
2 parents dc2b0f7 + 05d5b3c commit 4a092c7

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

CMakeLists.txt

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,24 +1110,40 @@ macro(set_std_filter filter)
11101110
# Upper case the filter name
11111111
string(TOUPPER "${filter}" upfilter)
11121112
string(TOLOWER "${filter}" downfilter)
1113+
if(ENABLE_${upfilter})
11131114
# Define a test flag for filter
1114-
IF(${filter}_FOUND)
1115-
INCLUDE_DIRECTORIES(${${filter}_INCLUDE_DIRS})
1116-
SET(ENABLE_${upfilter} TRUE)
1117-
SET(HAVE_${upfilter} ON)
1118-
SET(STD_FILTERS "${STD_FILTERS} ${downfilter}")
1119-
MESSAGE(">>> Standard Filter: ${downfilter}")
1115+
IF(${filter}_FOUND)
1116+
INCLUDE_DIRECTORIES(${${filter}_INCLUDE_DIRS})
1117+
SET(ENABLE_${upfilter} TRUE)
1118+
SET(HAVE_${upfilter} ON)
1119+
SET(STD_FILTERS "${STD_FILTERS} ${downfilter}")
1120+
MESSAGE(">>> Standard Filter: ${downfilter}")
1121+
ELSE()
1122+
SET(ENABLE_${upfilter} FALSE)
1123+
SET(HAVE_${upfilter} OFF)
1124+
ENDIF()
11201125
ELSE()
1121-
SET(ENABLE_${upfilter} FALSE)
11221126
SET(HAVE_${upfilter} OFF)
11231127
ENDIF()
11241128
endmacro(set_std_filter)
11251129

11261130
# Locate some compressors
1127-
FIND_PACKAGE(Szip)
1128-
FIND_PACKAGE(Bz2)
1129-
FIND_PACKAGE(Blosc)
1130-
FIND_PACKAGE(Zstd)
1131+
OPTION(ENABLE_SZIP "Enable use of Szip compression library if it is available." ON)
1132+
OPTION(ENABLE_BZ2 "Enable use of Bz2 compression library if it is available." ON)
1133+
OPTION(ENABLE_BLOSC "Enable use of blosc compression library if it is available." ON)
1134+
OPTION(ENABLE_ZSTD "Enable use of Zstd compression library if it is available." ON)
1135+
IF (ENABLE_SZIP)
1136+
FIND_PACKAGE(Szip)
1137+
ENDIF()
1138+
IF (ENABLE_BZ2)
1139+
FIND_PACKAGE(Bz2)
1140+
ENDIF()
1141+
IF (ENABLE_BLOSC)
1142+
FIND_PACKAGE(Blosc)
1143+
ENDIF()
1144+
IF (ENABLE_ZSTD)
1145+
FIND_PACKAGE(Zstd)
1146+
ENDIF()
11311147

11321148
# Accumulate standard filters
11331149
set(STD_FILTERS "deflate") # Always have deflate*/

0 commit comments

Comments
 (0)