-
Notifications
You must be signed in to change notification settings - Fork 49
/
FindZLIB.cmake
28 lines (26 loc) · 1014 Bytes
/
FindZLIB.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Update this to have more specific rules for finding the zlib library.
# e.g versions, shared or static ...
# for now this should suffice.
# maybe make sure the headers exits too.
find_library(ZLIB_LIBRARY
NAMES zlibstatic
HINTS ${ZLIB_ROOT}/lib
NO_DEFAULT_PATH
)
if(ZLIB_LIBRARY)
set(ZLIB_LIBRARYDIR ${ZLIB_ROOT}/lib)
set(ZLIB_INCLUDEDIR ${ZLIB_ROOT}/include)
message(STATUS "Found ZLIB")
message(STATUS " ZLIB_ROOT: " ${ZLIB_ROOT})
message(STATUS " ZLIB_LIBRARY: " ${ZLIB_LIBRARY})
message(STATUS " ZLIB_LIBRARYDIR: " ${ZLIB_LIBRARYDIR})
message(STATUS " ZLIB_INCLUDEDIR: " ${ZLIB_INCLUDEDIR})
else()
if(ZLIB_FIND_REQUIRED)
message(STATUS "Unable to find the requested ZLIB" )
message(STATUS "Looked in ZLIB_ROOT ${ZLIB_ROOT}" )
message(SEND_ERROR "Could not find libzlibstatic.a Make sure you have set the ZLIB_ROOT in the CMakeFile.txt to point to your ZLIB installation." )
else()
message(STATUS "ZLIB - NOT Found" )
endif(ZLIB_FIND_REQUIRED)
endif()