Skip to content

Commit

Permalink
Remove special case of finding static zlib library
Browse files Browse the repository at this point in the history
Don't implement all the find functions ourselves, rely on hdf5-config instead.
  • Loading branch information
MaartenBent authored and tbeu committed Sep 8, 2020
1 parent f8bb7c9 commit 3e2469d
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions cmake/thirdParties.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,6 @@ if(MATIO_WITH_ZLIB)
matio_create_zlib(zlib)
else()
find_package(ZLIB 1.2.3)

# try to find a static zlib version
if((NOT ZLIB_FOUND OR NOT MATIO_SHARED) AND ZLIB_INCLUDE_DIRS AND NOT ZLIB_STATIC_LIBRARY)
get_filename_component(ZLIB_DIR ${ZLIB_LIBRARY} DIRECTORY)
find_library(ZLIB_STATIC_LIBRARY libzlib PATHS ${ZLIB_DIR} ${ZLIB_ROOT}/lib ${PROJECT_BINARY_DIR}/lib)
if(ZLIB_STATIC_LIBRARY)
if(NOT TARGET ZLIB::ZLIB)
set(ZLIB_FOUND TRUE)
add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
endif()
set_target_properties(ZLIB::ZLIB PROPERTIES IMPORTED_LOCATION "${ZLIB_STATIC_LIBRARY}")
message(STATUS "Found ZLIB: ${ZLIB_STATIC_LIBRARY} (static library)")
endif()
endif()
endif()

if(ZLIB_FOUND)
Expand Down

0 comments on commit 3e2469d

Please sign in to comment.