-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindZlib.cmake
76 lines (66 loc) · 1.53 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
SET(SEARCH_PATH_ZLIB "" CACHE PATH "Additional Zlib search path")
SET(ZLIB_DIR_SEARCH
$ENV{ZLIB_ROOT}
${SEARCH_PATH_ZLIB}
${ZLIB_DIR_SEARCH}
)
if(CMAKE_SYSTEM MATCHES "Windows")
if (EXISTS "C:/")
SET(ZLIB_DIR_SEARCH
${ZLIB_DIR_SEARCH}
"C:/Development/zlib-1.2.11/dist/"
"C:/Development/Software/zlib/"
)
endif()
if (EXISTS "D:/")
SET(ZLIB_DIR_SEARCH
${ZLIB_DIR_SEARCH}
"D:/Development/zlib-1.2.11/dist/"
"D:/Development/Software/zlib/"
)
endif()
find_path(Zlib_INCLUDE_PATH zlib.h
PATH_SUFFIXES include
PATHS
${ZLIB_DIR_SEARCH}
)
find_library(Zlib_LIB zlib
PATH_SUFFIXES lib
PATHS
${ZLIB_DIR_SEARCH}
)
endif()
set(ADDITIONAL_LIB_DIRS)
if (CMAKE_SYSTEM MATCHES "Linux" )
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
else()
set(ADDITIONAL_LIB_DIRS "/usr/lib64" "/usr/lib/x86_64-linux-gnu/")
endif()
SET(ZLIB_LIB_SEARCH
${ADDITIONAL_LIB_DIRS}
${ZLIB_LIB_SEARCH}
/usr/local/zipper-master/
/usr/local/lib/
/usr/lib/
)
find_library(Zlib_LIB z
PATHS
${ZLIB_LIB_SEARCH}
)
SET(ZLIB_INCLUDE_SEARCH
${ZLIB_INCLUDE_SEARCH}
/usr/local/zipper-master/
/usr/local/
/usr/
)
find_path(Zlib_INCLUDE_PATH zlib.h
PATH_SUFFIXES include
PATHS
${ZLIB_INCLUDE_SEARCH}
)
endif(CMAKE_SYSTEM MATCHES "Linux")
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Zlib DEFAULT_MSG Zlib_INCLUDE_PATH)
MARK_AS_ADVANCED(Zlib_INCLUDE_PATH)