Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/tutorialHS08/cmake/FindZLIB.cmake @ 9253

Last change on this file since 9253 was 1776, checked in by landauf, 16 years ago

Many changes in almost all FindXYZ.cmake files. They now throw errors if something wasn't found.

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1# - Find zlib
2# Find the native ZLIB includes and library
3#
4#  ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
5#  ZLIB_LIBRARY     - List of libraries when using zlib.
6#  ZLIB_FOUND       - True if zlib found.
7#
8#  Modified by Nicolas Schlumberger, (c) 2007
9#  to make it work on the Tardis Infrastucture of the ETH Zurich
10#
11# Several changes and additions by Fabian 'x3n' Landau
12#                 > www.orxonox.net <
13
14IF (ZLIB_INCLUDE_DIR)
15  SET(ZLIB_FIND_QUIETLY TRUE)
16ENDIF (ZLIB_INCLUDE_DIR)
17
18IF(UNIX)
19  FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
20    /usr/pack/zziplib-0.13.49-sd/include/
21    /usr/local/include
22    /usr/include
23  )
24
25  SET(ZLIB_NAMES z zlib zdll)
26  FIND_LIBRARY(ZLIB_LIBRARY
27    NAMES ${ZLIB_NAMES}
28    PATHS /usr/pack/zziplib-0.13.49-sd/i686-debian-linux3.1/lib/ /usr/lib /usr/local/lib
29  )
30ENDIF(UNIX)
31
32IF(WIN32)
33  IF(EXISTS "../libs/zlib")
34    SET (ZLIB_LIBRARY_DIR "../libs/zlib")
35  ENDIF(EXISTS "../libs/zlib")
36
37  FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
38    ../libs/zlib/include
39  )
40
41  FIND_LIBRARY(ZLIB_LIBRARY
42    NAMES zlib
43    PATHS ${ZLIB_LIBRARY_DIR}
44  )
45ENDIF(WIN32)
46
47SET(ZLIB_FOUND FALSE)
48IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
49  SET(ZLIB_FOUND TRUE)
50ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
51
52IF (ZLIB_FOUND)
53  IF (NOT ZLIB_FIND_QUIETLY)
54    MESSAGE(STATUS "ZLIB was found.")
55    IF (VERBOSE_FIND)
56      MESSAGE (STATUS "  include path: ${ZLIB_INCLUDE_DIR}")
57      MESSAGE (STATUS "  library path: ${ZLIB_LIBRARY}")
58      MESSAGE (STATUS "  libraries:    zlib")
59    ENDIF (VERBOSE_FIND)
60  ENDIF (NOT ZLIB_FIND_QUIETLY)
61ELSE (ZLIB_FOUND)
62  IF (NOT ZLIB_INCLUDE_DIR)
63    MESSAGE(SEND_ERROR "ZLIB include path was not found.")
64  ENDIF (NOT ZLIB_INCLUDE_DIR)
65  IF (NOT ZLIB_LIBRARY)
66    MESSAGE(SEND_ERROR "ZLIB was not found.")
67    MESSAGE(STATUS "Looked for Z libraries named ${ZLIBS_NAMES}.")
68  ENDIF (NOT ZLIB_LIBRARY)
69ENDIF (ZLIB_FOUND)
70
71MARK_AS_ADVANCED(
72  ZLIB_LIBRARY
73  ZLIB_INCLUDE_DIR
74)
Note: See TracBrowser for help on using the repository browser.