--- hdf5-1.8.21/CMakeFilters.cmake.orig	2018-07-31 13:15:05.730704200 +0300
+++ hdf5-1.8.21/CMakeFilters.cmake	2018-07-31 13:21:23.985568600 +0300
@@ -44,10 +44,10 @@
       find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
       if (NOT ZLIB_FOUND)
         find_package (ZLIB) # Legacy find
-        if (ZLIB_FOUND)
-          set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES})
-          set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES})
-        endif ()
+      endif ()
+      if (ZLIB_FOUND)
+        set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES})
+        set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES})
       endif ()
     endif ()
     if (ZLIB_FOUND)
@@ -95,10 +95,10 @@
     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})
-        set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES})
-      endif ()
+    endif ()
+    if (SZIP_FOUND)
+      set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
+      set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES})
     endif ()
   endif ()
   if (SZIP_FOUND)
