forked from Mudlet/Mudlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindZIP.cmake
79 lines (69 loc) · 1.79 KB
/
FindZIP.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
77
78
79
# Locate ZIP library
# This module defines
# ZIP_FOUND, if false, do not try to link to ZIP
# ZIP_LIBRARIES
# ZIP_INCLUDE_DIR, where to find zip*.h
FIND_PATH(ZIP_INCLUDE_DIR zip.h
HINTS
${ZIP_DIR} $ENV{ZIP_DIR}
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
FIND_LIBRARY(ZIP_LIBRARY_RELEASE
NAMES zip zip_s
HINTS
${ZIP_DIR} $ENV{ZIP_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
FIND_LIBRARY(ZIP_LIBRARY_DEBUG
NAMES zipd zip_sd
HINTS
${ZIP_DIR} $ENV{ZIP_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
IF(ZIP_LIBRARY_DEBUG AND ZIP_LIBRARY_RELEASE)
SET(ZIP_LIBRARY optimized ${ZIP_LIBRARY_RELEASE} debug ${ZIP_LIBRARY_DEBUG} )
GET_FILENAME_COMPONENT(ZIP_FILENAME ${ZIP_LIBRARY_RELEASE} NAME_WE)
ELSEIF(ZIP_LIBRARY_RELEASE)
SET(ZIP_LIBRARY ${ZIP_LIBRARY_RELEASE} )
GET_FILENAME_COMPONENT(ZIP_FILENAME ${ZIP_LIBRARY_RELEASE} NAME_WE)
ELSEIF(ZIP_LIBRARY_DEBUG)
SET(ZIP_LIBRARY ${ZIP_LIBRARY_DEBUG} )
GET_FILENAME_COMPONENT(ZIP_FILENAME ${ZIP_LIBRARY_DEBUG} NAME_WE)
ENDIF()
STRING(FIND ${ZIP_FILENAME} zip_s ZIP_STATIC)
IF(ZIP_STATIC EQUAL -1)
ADD_DEFINITIONS(-DZIP_EXTERN=)
ENDIF()
SET( ZIP_LIBRARIES "${ZIP_LIBRARY}" CACHE STRING "ZIP Libraries")
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set ZIP_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZIP DEFAULT_MSG ZIP_LIBRARIES ZIP_INCLUDE_DIR)
MARK_AS_ADVANCED(ZIP_INCLUDE_DIR ZIP_LIBRARIES ZIP_LIBRARY ZIP_LIBRARY_RELEASE ZIP_LIBRARY_DEBUG)