1# 2# From CMake 2.6.1 + some path changes 3# 4 5# - Find zlib 6# Find the native ZLIB includes and library 7# 8# ZLIB_INCLUDE_DIR - where to find zlib.h, etc. 9# ZLIB_LIBRARIES - List of libraries when using zlib. 10# ZLIB_FOUND - True if zlib found. 11 12IF(MSYS) 13 SET(ZLIB_DIR_SEARCH 14 c:/msys/1.0 15 ) 16ENDIF(MSYS) 17 18IF (ZLIB_INCLUDE_DIR) 19 # Already in cache, be silent 20 SET(ZLIB_FIND_QUIETLY TRUE) 21ENDIF (ZLIB_INCLUDE_DIR) 22 23FIND_PATH(ZLIB_INCLUDE_DIR zlib.h PATHS ${ZLIB_DIR_SEARCH}/local/include) 24 25SET(ZLIB_NAMES z zlib zdll) 26FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} PATHS ${ZLIB_DIR_SEARCH}/local/lib) 27 28# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if 29# all listed variables are TRUE 30INCLUDE(FindPackageHandleStandardArgs) 31FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 32 33IF(ZLIB_FOUND) 34 SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} ) 35ELSE(ZLIB_FOUND) 36 SET( ZLIB_LIBRARIES ) 37ENDIF(ZLIB_FOUND) 38 39MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR ) 40