Skip to content

Commit

Permalink
Prefer static library if available
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Sep 24, 2020
1 parent 56a0bfd commit 251919d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/FindZLIB.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
find_path(ZLIB_INCLUDE_DIR zlib.h)
find_library(ZLIB_LIBRARY z)
find_library(ZLIB_LIBRARY NAMES libz.a z)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY)
Expand All @@ -9,3 +9,6 @@ set_property(TARGET p::zlib PROPERTY INTERFACE_INCLUDE_DIRECTORIES
${ZLIB_INCLUDE_DIR})
set_property(TARGET p::zlib PROPERTY INTERFACE_LINK_LIBRARIES
${ZLIB_LIBRARY})

message("ZLIB_INCLUDE_DIR: ${ZLIB_INCLUDE_DIR}")
message("ZLIB_LIBRARY: ${ZLIB_LIBRARY}")

0 comments on commit 251919d

Please sign in to comment.