forked from Mudlet/Mudlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindPCRE.cmake
156 lines (140 loc) · 3.35 KB
/
FindPCRE.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Locate PCRE library
# This module defines
# PCRE_FOUND, if false, do not try to link to PCRE
# PCRE_LIBRARIES
# PCRE_INCLUDE_DIR, where to find pcre.h
FIND_PATH(PCRE_INCLUDE_DIR pcre.h
HINTS
${PCRE_DIR} $ENV{PCRE_DIR}
PATH_SUFFIXES include/pcre include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
FIND_LIBRARY(PCRE_LIBRARY_RELEASE
NAMES pcre
HINTS
${PCRE_DIR} $ENV{PCRE_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
FIND_LIBRARY(PCRE_LIBRARY_DEBUG
NAMES pcred
HINTS
${PCRE_DIR} $ENV{PCRE_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
FIND_LIBRARY(PCRECPP_LIBRARY_RELEASE
NAMES pcrecpp
HINTS
${PCRE_DIR} $ENV{PCRE_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
FIND_LIBRARY(PCRECPP_LIBRARY_DEBUG
NAMES pcrecppd
HINTS
${PCRE_DIR} $ENV{PCRE_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
FIND_LIBRARY(PCREPOSIX_LIBRARY_RELEASE
NAMES pcreposix
HINTS
${PCRE_DIR} $ENV{PCRE_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
FIND_LIBRARY(PCREPOSIX_LIBRARY_DEBUG
NAMES pcreposixd
HINTS
${PCRE_DIR} $ENV{PCRE_DIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
SET( PCRE_STATIC OFF CACHE BOOL "Use PCRE static libraries.")
IF(PCRE_STATIC)
ADD_DEFINITIONS(-DPCRE_STATIC)
ENDIF(PCRE_STATIC)
IF(PCRE_LIBRARY_DEBUG AND PCRE_LIBRARY_RELEASE)
SET(PCRE_LIBRARY optimized ${PCRE_LIBRARY_RELEASE} debug ${PCRE_LIBRARY_DEBUG} )
ELSEIF(PCRE_LIBRARY_RELEASE)
SET(PCRE_LIBRARY ${PCRE_LIBRARY_RELEASE} )
ELSEIF(PCRE_LIBRARY_DEBUG)
SET(PCRE_LIBRARY ${PCRE_LIBRARY_DEBUG} )
ENDIF()
IF(PCRECPP_LIBRARY_DEBUG AND PCRECPP_LIBRARY_RELEASE)
SET(PCRECPP_LIBRARY optimized ${PCRECPP_LIBRARY_RELEASE} debug ${PCRECPP_LIBRARY_DEBUG} )
ELSEIF(PCRECPP_LIBRARY_RELEASE)
SET(PCRECPP_LIBRARY ${PCRECPP_LIBRARY_RELEASE} )
ELSEIF(PCRECPP_LIBRARY_DEBUG)
SET(PCRECPP_LIBRARY ${PCRECPP_LIBRARY_DEBUG} )
ENDIF()
IF(PCREPOSIX_LIBRARY_DEBUG AND PCREPOSIX_LIBRARY_RELEASE)
SET(PCREPOSIX_LIBRARY optimized ${PCREPOSIX_LIBRARY_RELEASE} debug ${PCREPOSIX_LIBRARY_DEBUG} )
ELSEIF(PCREPOSIX_LIBRARY_RELEASE)
SET(PCREPOSIX_LIBRARY ${PCREPOSIX_LIBRARY_RELEASE} )
ELSEIF(PCREPOSIX_LIBRARY_DEBUG)
SET(PCREPOSIX_LIBRARY ${PCREPOSIX_LIBRARY_DEBUG} )
ENDIF()
SET( PCRE_LIBRARIES "${PCRE_LIBRARY};${PCRECPP_LIBRARY};${PCREPOSIX_LIBRARY}" CACHE STRING "PCRE Libraries")
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARIES PCRE_INCLUDE_DIR)
MARK_AS_ADVANCED(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_LIBRARY PCRE_LIBRARY_RELEASE PCRE_LIBRARY_DEBUG PCRECPP_LIBRARY PCRECPP_LIBRARY_RELEASE PCRECPP_LIBRARY_DEBUG PCREPOSIX_LIBRARY PCREPOSIX_LIBRARY_RELEASE PCREPOSIX_LIBRARY_DEBUG)