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