FindZLIB.cmake 827 B

123456789101112131415161718192021222324252627282930
  1. # - Find zlib
  2. # Find the native ZLIB includes and library
  3. #
  4. # ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
  5. # ZLIB_LIBRARIES - List of libraries when using zlib.
  6. # ZLIB_FOUND - True if zlib found.
  7. IF (ZLIB_INCLUDE_DIR)
  8. # Already in cache, be silent
  9. SET(ZLIB_FIND_QUIETLY TRUE)
  10. ENDIF (ZLIB_INCLUDE_DIR)
  11. FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
  12. SET(ZLIB_NAMES z zlib zdll)
  13. FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} )
  14. # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
  15. # all listed variables are TRUE
  16. INCLUDE(FindPackageHandleStandardArgs)
  17. FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
  18. IF(ZLIB_FOUND)
  19. SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
  20. ELSE(ZLIB_FOUND)
  21. SET( ZLIB_LIBRARIES )
  22. ENDIF(ZLIB_FOUND)
  23. MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )