2009-02-02 17:44:46 +03:00
|
|
|
# - Try to find ZLIB
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# ZLIB_FOUND - system has ZLIB
|
|
|
|
# ZLIB_INCLUDE_DIRS - the ZLIB include directory
|
|
|
|
# ZLIB_LIBRARIES - Link these to use ZLIB
|
|
|
|
# ZLIB_DEFINITIONS - Compiler switches required for using ZLIB
|
|
|
|
#
|
2010-03-30 01:20:43 +04:00
|
|
|
# Copyright (c) 2009-2010 Andreas Schneider <mail@cynapses.org>
|
2009-02-02 17:44:46 +03:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the New
|
|
|
|
# BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
if (ZLIB_LIBRARIES AND ZLIB_INCLUDE_DIRS)
|
|
|
|
# in cache already
|
|
|
|
set(ZLIB_FOUND TRUE)
|
|
|
|
else (ZLIB_LIBRARIES AND ZLIB_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
find_path(ZLIB_INCLUDE_DIR
|
|
|
|
NAMES
|
|
|
|
zlib.h
|
|
|
|
PATHS
|
2010-05-12 15:55:32 +04:00
|
|
|
${_ZLIB_DIR}/include
|
2009-02-02 17:44:46 +03:00
|
|
|
/usr/include
|
|
|
|
/usr/local/include
|
|
|
|
/opt/local/include
|
|
|
|
/sw/include
|
2010-03-30 01:20:43 +04:00
|
|
|
/usr/lib/sfw/include
|
2010-12-30 02:26:37 +03:00
|
|
|
$ENV{PROGRAMFILES}/GnuWin32/include
|
|
|
|
$ENV{PROGRAMFILES}/zlib/include
|
2009-02-02 17:44:46 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
find_library(Z_LIBRARY
|
|
|
|
NAMES
|
|
|
|
z
|
2011-01-01 18:15:33 +03:00
|
|
|
zdll
|
2009-03-08 15:10:07 +03:00
|
|
|
zlib
|
|
|
|
zlib1
|
2009-02-02 17:44:46 +03:00
|
|
|
PATHS
|
2010-05-12 15:55:32 +04:00
|
|
|
${_ZLIB_DIR}/lib
|
2009-02-02 17:44:46 +03:00
|
|
|
/usr/lib
|
|
|
|
/usr/local/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/sw/lib
|
2010-03-30 01:20:43 +04:00
|
|
|
/usr/sfw/lib/64
|
|
|
|
/usr/sfw/lib
|
2010-12-30 02:26:37 +03:00
|
|
|
$ENV{PROGRAMFILES}/GnuWin32/lib
|
|
|
|
$ENV{PROGRAMFILES}/zlib/lib
|
2009-02-02 17:44:46 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
set(ZLIB_INCLUDE_DIRS
|
|
|
|
${ZLIB_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
2010-03-30 01:20:43 +04:00
|
|
|
if (Z_LIBRARY)
|
2009-02-02 17:44:46 +03:00
|
|
|
set(ZLIB_LIBRARIES
|
2010-03-30 01:20:43 +04:00
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
${Z_LIBRARY}
|
2009-02-02 17:44:46 +03:00
|
|
|
)
|
2010-03-30 01:20:43 +04:00
|
|
|
endif (Z_LIBRARY)
|
2009-02-02 17:44:46 +03:00
|
|
|
|
2010-03-30 01:20:43 +04:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)
|
2009-02-02 17:44:46 +03:00
|
|
|
|
|
|
|
# show the ZLIB_INCLUDE_DIRS and ZLIB_LIBRARIES variables only in the advanced view
|
|
|
|
mark_as_advanced(ZLIB_INCLUDE_DIRS ZLIB_LIBRARIES)
|
|
|
|
|
|
|
|
endif (ZLIB_LIBRARIES AND ZLIB_INCLUDE_DIRS)
|
|
|
|
|