Resolve Windows build issue
[zynaddsubfx-code.git] / cmake / Findzlib.cmake
blob49edafd128929a01b71f0d089da683219c7c6aa3
1 # - Find zlib
2 # Find the native ZLIB includes and library
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.
8 #=============================================================================
9 # Copyright 2001-2009 Kitware, Inc.
11 # Distributed under the OSI-approved BSD License (the "License");
12 # see accompanying file Copyright.txt for details.
14 # This software is distributed WITHOUT ANY WARRANTY; without even the
15 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 # See the License for more information.
17 #=============================================================================
18 # (To distributed this file outside of CMake, substitute the full
19 #  License text for the above reference.)
21 IF (ZLIB_INCLUDE_DIR)
22   # Already in cache, be silent
23   SET(ZLIB_FIND_QUIETLY TRUE)
24 ENDIF (ZLIB_INCLUDE_DIR)
26 FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
28 SET(ZLIB_NAMES z zlib zdll)
29 FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} )
30 MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
32 # Per-recommendation
33 SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}")
34 SET(ZLIB_LIBRARIES    "${ZLIB_LIBRARY}")
36 # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
37 # all listed variables are TRUE
38 INCLUDE(FindPackageHandleStandardArgs)
39 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)