]> git.lyx.org Git - lyx.git/blob - development/cmake/modules/FindZLIB.cmake
correct filenames
[lyx.git] / development / cmake / modules / FindZLIB.cmake
1 #
2 #  based on cmake file
3 #
4 if (ZLIB_INCLUDE_DIR)
5   # Already in cache, be silent
6   set(ZLIB_FIND_QUIETLY TRUE)
7 endif (ZLIB_INCLUDE_DIR)
8
9 FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
10  /usr/include
11  /usr/local/include
12 )
13
14 set(POTENTIAL_Z_LIBS z zlib zdll)
15 FIND_LIBRARY(ZLIB_LIBRARY NAMES ${POTENTIAL_Z_LIBS}
16 PATHS
17  /usr/lib
18  /usr/local/lib
19 )
20
21 IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
22    SET(ZLIB_FOUND TRUE)
23 ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
24
25 IF (ZLIB_FOUND)
26    IF (NOT ZLIB_FIND_QUIETLY)
27       MESSAGE(STATUS "Found Z: ${ZLIB_LIBRARY}")
28    ENDIF (NOT ZLIB_FIND_QUIETLY)
29 ELSE (ZLIB_FOUND)
30    IF (ZLIB_FIND_REQUIRED)
31       MESSAGE(STATUS "Looked for Z libraries named ${POTENTIAL_Z_LIBS}.")
32       MESSAGE(STATUS "Found no acceptable Z library. This is fatal.")
33       MESSAGE(FATAL_ERROR "Could NOT find z library")
34    ENDIF (ZLIB_FIND_REQUIRED)
35 ENDIF (ZLIB_FOUND)
36
37 MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)