FindZLIB.cmake 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #=============================================================================
  8. # Copyright 2001-2009 Kitware, Inc.
  9. #
  10. # Distributed under the OSI-approved BSD License (the "License");
  11. # see accompanying file Copyright.txt for details.
  12. #
  13. # This software is distributed WITHOUT ANY WARRANTY; without even the
  14. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. # See the License for more information.
  16. #=============================================================================
  17. # (To distributed this file outside of CMake, substitute the full
  18. # License text for the above reference.)
  19. IF (ZLIB_INCLUDE_DIR)
  20. # Already in cache, be silent
  21. SET(ZLIB_FIND_QUIETLY TRUE)
  22. ENDIF (ZLIB_INCLUDE_DIR)
  23. FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
  24. SET(ZLIB_NAMES z zlib zdll)
  25. FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} )
  26. # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
  27. # all listed variables are TRUE
  28. INCLUDE(FindPackageHandleStandardArgs)
  29. FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
  30. IF(ZLIB_FOUND)
  31. SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
  32. ELSE(ZLIB_FOUND)
  33. SET( ZLIB_LIBRARIES )
  34. ENDIF(ZLIB_FOUND)
  35. MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )