FindZLIB.cmake 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # - Find zlib
  2. # Find the native ZLIB includes and library
  3. #
  4. # ZLIB_INCLUDE_DIRS - 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. MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
  27. # Per-recommendation
  28. SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}")
  29. SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}")
  30. # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
  31. # all listed variables are TRUE
  32. INCLUDE(FindPackageHandleStandardArgs)
  33. FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)