summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeFilters.cmake47
1 files changed, 27 insertions, 20 deletions
diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake
index bc78fa6..cfde3c9 100644
--- a/CMakeFilters.cmake
+++ b/CMakeFilters.cmake
@@ -86,29 +86,36 @@ ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT)
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})
- IF (NOT SZIP_FOUND)
- FIND_PACKAGE (SZIP) # Legacy find
- ENDIF (NOT SZIP_FOUND)
- ENDIF (NOT SZIP_USE_EXTERNAL)
- IF (SZIP_FOUND)
- SET (H5_HAVE_FILTER_SZIP 1)
- SET (H5_HAVE_SZLIB_H 1)
- SET (H5_HAVE_LIBSZ 1)
- SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR})
- SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR})
- ELSE (SZIP_FOUND)
- IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
- EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE} ${HDF5_ENABLE_SZIP_ENCODING})
+ IF (NOT H5_SZLIB_HEADER)
+ IF (NOT SZIP_USE_EXTERNAL)
+ FIND_PACKAGE (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT})
+ IF (NOT SZIP_FOUND)
+ FIND_PACKAGE (SZIP) # Legacy find
+ ENDIF (NOT SZIP_FOUND)
+ ENDIF (NOT SZIP_USE_EXTERNAL)
+ IF (SZIP_FOUND)
SET (H5_HAVE_FILTER_SZIP 1)
SET (H5_HAVE_SZLIB_H 1)
SET (H5_HAVE_LIBSZ 1)
- MESSAGE (STATUS "Filter SZIP is built")
- ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
- MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5")
- ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
- ENDIF (SZIP_FOUND)
+ SET (H5_SZLIB_HEADER "szlib.h")
+ SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR})
+ SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR})
+ ELSE (SZIP_FOUND)
+ IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
+ EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE} ${HDF5_ENABLE_SZIP_ENCODING})
+ SET (H5_HAVE_FILTER_SZIP 1)
+ SET (H5_HAVE_SZLIB_H 1)
+ SET (H5_HAVE_LIBSZ 1)
+ MESSAGE (STATUS "Filter SZIP is built")
+ ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
+ MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5")
+ ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
+ ENDIF (SZIP_FOUND)
+ ELSE (NOT H5_SZLIB_HEADER)
+ SET (H5_HAVE_FILTER_SZIP 1)
+ SET (H5_HAVE_SZLIB_H 1)
+ SET (H5_HAVE_LIBSZ 1)
+ ENDIF (NOT H5_SZLIB_HEADER)
SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES})
INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIR})
MESSAGE (STATUS "Filter SZIP is ON")