forked from madler/zlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZLIBConfig.cmake.in
45 lines (39 loc) · 1.12 KB
/
ZLIBConfig.cmake.in
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
set(ZLIB_INCLUDE_DIRS
${CMAKE_CURRENT_LIST_DIR}/include
)
set(ZLIB_NAME @ZLIB_NAME@)
set(ZLIB_DEFINITIONS @ZLIB_DEFINITIONS@)
find_library(ZLIB_LIBRARY_O ${ZLIB_NAME} PATHS ${CMAKE_CURRENT_LIST_DIR}/lib NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
find_library(ZLIB_LIBRARY_D ${ZLIB_NAME}_d PATHS ${CMAKE_CURRENT_LIST_DIR}/lib NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
unset(ZLIB_LIBRARIES)
if(ZLIB_LIBRARY_O)
if(ZLIB_LIBRARY_D)
set(ZLIB_LIBRARIES
debug ${ZLIB_LIBRARY_D}
optimized ${ZLIB_LIBRARY_O}
)
else()
if(MSVC)
list(APPEND ZLIB_WARNINGS "Only optimized libs found.")
set(ZLIB_LIBRARIES optimized ${ZLIB_LIBRARY_O})
else()
set(ZLIB_LIBRARIES ${ZLIB_LIBRARY_O})
endif()
endif()
else()
if(ZLIB_LIBRARY_D)
list(APPEND ZLIB_WARNINGS "Only debug libs found.")
set(ZLIB_LIBRARIES debug ${ZLIB_LIBRARY_D})
else()
list(APPEND ZLIB_ERRORS "No libraries found (${ZLIB_NAME} or ${ZLIB_NAME_D}).")
endif()
endif()
if(ZLIB_ERRORS)
message(STATUS ${ZLIB_ERRORS})
unset(ZLIB_INCLUDE_DIRS)
unset(ZLIB_INCLUDE_DIR)
set(ZLIB_FOUND 0)
else()
set(ZLIB_FOUND 1)
set(ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS})
endif()