]> git.lyx.org Git - lyx.git/blob - development/cmake/modules/FindZLIB.cmake
9821a6d92d9c60f53bf07b1dbf39d6230bcffd43
[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()
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  "C:\\Programme\\Microsoft Visual Studio 8\\VC\\lib"
18  /usr/lib
19  /usr/local/lib
20 )
21
22 IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
23    set(ZLIB_FOUND TRUE)
24 endif()
25
26 IF (ZLIB_FOUND)
27    IF (NOT ZLIB_FIND_QUIETLY)
28       message(STATUS "Found Z: ${ZLIB_LIBRARY}")
29    endif()
30 else()
31    IF (ZLIB_FIND_REQUIRED)
32       message(STATUS "Looked for Z libraries named ${POTENTIAL_Z_LIBS}.")
33       message(STATUS "Found no acceptable Z library. This is fatal.")
34       message(FATAL_ERROR "Could NOT find z library")
35    endif()
36 endif()
37
38 MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)