140-zlib.patch 717 B

1234567891011121314151617181920
  1. --- a/Modules/FindZLIB.cmake
  2. +++ b/Modules/FindZLIB.cmake
  3. @@ -117,10 +117,13 @@ else()
  4. set(ZLIB_NAMES_DEBUG zd zlibd zdlld zlibd1 zlib1d zlibstaticd zlibwapid zlibvcd zlibstatd)
  5. endif()
  6. -# Try each search configuration.
  7. -foreach(search ${_ZLIB_SEARCHES})
  8. - find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
  9. -endforeach()
  10. +if(UNIX)
  11. + find_package(PkgConfig QUIET)
  12. + pkg_search_module(PC_zlib zlib)
  13. +endif()
  14. +
  15. +find_path(ZLIB_INCLUDE_DIR zlib.h HINTS ${PC_zlib_INCLUDEDIR} ${PC_zlib_INCLUDE_DIRS})
  16. +find_library(ZLIB_LIBRARY NAMES z HINTS ${PC_zlib_LIBDIR} ${PC_zlib_LIBRARY_DIRS})
  17. # Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library
  18. if(NOT ZLIB_LIBRARY)