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