Skip to content

Commit

Permalink
Use only one find_package call for zlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed Jan 27, 2025
1 parent 985df02 commit fc03971
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,13 @@ if (HDF5_ENABLE_ZLIB_SUPPORT)
set(ZLIB_FOUND FALSE)
if (HDF5_USE_ZLIB_STATIC)
set(ZLIB_SEARCH_TYPE static)
else ()
set(ZLIB_SEARCH_TYPE shared)
endif ()
# Search pure Config mode first
find_package (ZLIB NAMES ${PACKAGE_NAME} OPTIONAL_COMPONENTS ${ZLIB_SEARCH_TYPE})
if (NOT ZLIB_FOUND)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
set(ZLIB_USE_STATIC_LIBS ${HDF5_USE_ZLIB_STATIC})
endif()
find_package (ZLIB) # Legacy find
else ()
set(ZLIB_SEARCH_TYPE shared)
endif ()
find_package (ZLIB NAMES ${PACKAGE_NAME} OPTIONAL_COMPONENTS ${ZLIB_SEARCH_TYPE})
set(H5_ZLIB_FOUND ${ZLIB_FOUND})
if (H5_ZLIB_FOUND)
if (HDF5_USE_ZLIB_NG)
Expand Down

0 comments on commit fc03971

Please sign in to comment.