1
- INCLUDE (CheckIncludeFile)
2
- INCLUDE (CheckFunctionExists)
3
- INCLUDE (CheckTypeSize)
4
-
5
- CHECK_INCLUDE_FILE (dirent.h HAVE_DIRENT_H)
6
- CHECK_INCLUDE_FILE (stdint.h HAVE_STDINT_H)
7
- CHECK_INCLUDE_FILE (inttypes.h HAVE_INTTYPES_H)
8
- CHECK_INCLUDE_FILE (sys/stat.h HAVE_SYS_STAT_H)
9
- CHECK_INCLUDE_FILE (sys/types.h HAVE_SYS_TYPES_H)
10
- CHECK_INCLUDE_FILE (unistd.h HAVE_UNISTD_H)
11
- CHECK_INCLUDE_FILE (windows.h HAVE_WINDOWS_H)
12
-
13
- CHECK_FUNCTION_EXISTS (bcopy HAVE_BCOPY)
14
- CHECK_FUNCTION_EXISTS (memmove HAVE_MEMMOVE)
15
- CHECK_FUNCTION_EXISTS (strerror HAVE_STRERROR)
16
- CHECK_FUNCTION_EXISTS (strtoll HAVE_STRTOLL)
17
- CHECK_FUNCTION_EXISTS (strtoq HAVE_STRTOQ)
18
- CHECK_FUNCTION_EXISTS (_strtoi64 HAVE__STRTOI64)
19
-
20
- CHECK_TYPE_SIZE ("long long" LONG_LONG)
21
- CHECK_TYPE_SIZE ("unsigned long long" UNSIGNED_LONG_LONG)
22
-
23
- DISABLE_WARNINGS (unused-function)
24
- DISABLE_WARNINGS (implicit-fallthrough)
1
+ include (CheckIncludeFile)
2
+ include (CheckFunctionExists)
3
+ include (CheckTypeSize)
4
+
5
+ check_include_file (dirent.h HAVE_DIRENT_H)
6
+ check_include_file (stdint.h HAVE_STDINT_H)
7
+ check_include_file (inttypes.h HAVE_INTTYPES_H)
8
+ check_include_file (sys/stat.h HAVE_SYS_STAT_H)
9
+ check_include_file (sys/types.h HAVE_SYS_TYPES_H)
10
+ check_include_file (unistd.h HAVE_UNISTD_H)
11
+ check_include_file (windows.h HAVE_WINDOWS_H)
12
+
13
+ check_function_exists (bcopy HAVE_BCOPY)
14
+ check_function_exists (memmove HAVE_MEMMOVE)
15
+ check_function_exists (strerror HAVE_STRERROR)
16
+ check_function_exists (strtoll HAVE_STRTOLL)
17
+ check_function_exists (strtoq HAVE_STRTOQ)
18
+ check_function_exists (_strtoi64 HAVE__STRTOI64)
19
+
20
+ check_type_size ("long long" LONG_LONG)
21
+ check_type_size ("unsigned long long" UNSIGNED_LONG_LONG)
22
+
23
+ disable_warnings (unused-function)
24
+ disable_warnings (implicit-fallthrough)
25
25
26
26
# User-configurable options
27
27
28
- SET (SUPPORT_PCRE8 1)
29
- SET (PCRE_LINK_SIZE "2" )
30
- SET (PCRE_PARENS_NEST_LIMIT "250" )
31
- SET (PCRE_MATCH_LIMIT "10000000" )
32
- SET (PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" )
33
- SET (PCRE_NEWLINE "LF" )
34
- SET (NO_RECURSE 1)
35
- SET (PCRE_POSIX_MALLOC_THRESHOLD "10" )
36
- SET (BSR_ANYCRLF 0)
37
-
38
- IF (MINGW)
39
- OPTION (NON_STANDARD_LIB_PREFIX
40
- "ON=Shared libraries built in mingw will be named pcre.dll, etc., instead of libpcre.dll, etc."
41
- OFF )
42
-
43
- OPTION (NON_STANDARD_LIB_SUFFIX
44
- "ON=Shared libraries built in mingw will be named libpcre-0.dll, etc., instead of libpcre.dll, etc."
45
- OFF )
46
- ENDIF (MINGW)
28
+ set (SUPPORT_PCRE8 1)
29
+ set (PCRE_LINK_SIZE "2" )
30
+ set (PCRE_PARENS_NEST_LIMIT "250" )
31
+ set (PCRE_MATCH_LIMIT "10000000" )
32
+ set (PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" )
33
+ set (PCRE_NEWLINE "LF" )
34
+ set (NO_RECURSE 1)
35
+ set (PCRE_POSIX_MALLOC_THRESHOLD "10" )
36
+ set (BSR_ANYCRLF 0)
37
+
38
+ if (MINGW)
39
+ option (NON_STANDARD_LIB_PREFIX
40
+ "ON=Shared libraries built in mingw will be named pcre.dll, etc., instead of libpcre.dll, etc."
41
+ OFF )
42
+
43
+ option (NON_STANDARD_LIB_SUFFIX
44
+ "ON=Shared libraries built in mingw will be named libpcre-0.dll, etc., instead of libpcre.dll, etc."
45
+ OFF )
46
+ endif (MINGW)
47
47
48
48
# Prepare build configuration
49
49
50
- SET (pcre_have_long_long 0)
51
- SET (pcre_have_ulong_long 0)
52
-
53
- IF (HAVE_LONG_LONG)
54
- SET (pcre_have_long_long 1)
55
- ENDIF (HAVE_LONG_LONG)
56
-
57
- IF (HAVE_UNSIGNED_LONG_LONG)
58
- SET (pcre_have_ulong_long 1)
59
- ENDIF (HAVE_UNSIGNED_LONG_LONG)
60
-
61
- SET (NEWLINE "" )
62
-
63
- IF (PCRE_NEWLINE STREQUAL "LF" )
64
- SET (NEWLINE "10" )
65
- ENDIF (PCRE_NEWLINE STREQUAL "LF" )
66
- IF (PCRE_NEWLINE STREQUAL "CR" )
67
- SET (NEWLINE "13" )
68
- ENDIF (PCRE_NEWLINE STREQUAL "CR" )
69
- IF (PCRE_NEWLINE STREQUAL "CRLF" )
70
- SET (NEWLINE "3338" )
71
- ENDIF (PCRE_NEWLINE STREQUAL "CRLF" )
72
- IF (PCRE_NEWLINE STREQUAL "ANY" )
73
- SET (NEWLINE "-1" )
74
- ENDIF (PCRE_NEWLINE STREQUAL "ANY" )
75
- IF (PCRE_NEWLINE STREQUAL "ANYCRLF" )
76
- SET (NEWLINE "-2" )
77
- ENDIF (PCRE_NEWLINE STREQUAL "ANYCRLF" )
78
-
79
- IF (NEWLINE STREQUAL "" )
80
- MESSAGE (FATAL_ERROR "The PCRE_NEWLINE variable must be set to one of the following values: \" LF\" , \" CR\" , \" CRLF\" , \" ANY\" , \" ANYCRLF\" ." )
81
- ENDIF (NEWLINE STREQUAL "" )
50
+ set (pcre_have_long_long 0)
51
+ set (pcre_have_ulong_long 0)
52
+
53
+ if (HAVE_LONG_LONG)
54
+ set (pcre_have_long_long 1)
55
+ endif (HAVE_LONG_LONG)
56
+
57
+ if (HAVE_UNSIGNED_LONG_LONG)
58
+ set (pcre_have_ulong_long 1)
59
+ endif (HAVE_UNSIGNED_LONG_LONG)
60
+
61
+ set (NEWLINE "" )
62
+
63
+ if (PCRE_NEWLINE STREQUAL "LF" )
64
+ set (NEWLINE "10" )
65
+ endif (PCRE_NEWLINE STREQUAL "LF" )
66
+ if (PCRE_NEWLINE STREQUAL "CR" )
67
+ set (NEWLINE "13" )
68
+ endif (PCRE_NEWLINE STREQUAL "CR" )
69
+ if (PCRE_NEWLINE STREQUAL "CRLF" )
70
+ set (NEWLINE "3338" )
71
+ endif (PCRE_NEWLINE STREQUAL "CRLF" )
72
+ if (PCRE_NEWLINE STREQUAL "ANY" )
73
+ set (NEWLINE "-1" )
74
+ endif (PCRE_NEWLINE STREQUAL "ANY" )
75
+ if (PCRE_NEWLINE STREQUAL "ANYCRLF" )
76
+ set (NEWLINE "-2" )
77
+ endif (PCRE_NEWLINE STREQUAL "ANYCRLF" )
78
+
79
+ if (NEWLINE STREQUAL "" )
80
+ message (FATAL_ERROR "The PCRE_NEWLINE variable must be set to one of the following values: \" LF\" , \" CR\" , \" CRLF\" , \" ANY\" , \" ANYCRLF\" ." )
81
+ endif (NEWLINE STREQUAL "" )
82
82
83
83
# Output files
84
- CONFIGURE_FILE (config.h.in
84
+ configure_file (config.h.in
85
85
${PROJECT_BINARY_DIR} /src/pcre/config.h
86
86
@ONLY)
87
87
88
88
# Source code
89
89
90
- SET (PCRE_HEADERS ${PROJECT_BINARY_DIR} /src/pcre/config.h)
90
+ set (PCRE_HEADERS ${PROJECT_BINARY_DIR} /src/pcre/config.h)
91
91
92
- SET (PCRE_SOURCES
92
+ set (PCRE_SOURCES
93
93
pcre_byte_order.c
94
94
pcre_chartables.c
95
95
pcre_compile.c
@@ -113,28 +113,28 @@ SET(PCRE_SOURCES
113
113
pcre_xclass.c
114
114
)
115
115
116
- SET (PCREPOSIX_HEADERS pcreposix.h)
116
+ set (PCREPOSIX_HEADERS pcreposix.h)
117
117
118
- SET (PCREPOSIX_SOURCES pcreposix.c)
118
+ set (PCREPOSIX_SOURCES pcreposix.c)
119
119
120
120
# Fix static compilation with MSVC: https://bugs.exim.org/show_bug.cgi?id=1681
121
121
# This code was taken from the CMake wiki, not from WebM.
122
122
123
123
# Build setup
124
124
125
- ADD_DEFINITIONS (-DHAVE_CONFIG_H)
125
+ add_definitions (-DHAVE_CONFIG_H)
126
126
127
- IF (MSVC )
128
- ADD_DEFINITIONS (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
129
- ENDIF (MSVC )
127
+ if (MSVC )
128
+ add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
129
+ endif (MSVC )
130
130
131
- SET (CMAKE_INCLUDE_CURRENT_DIR 1)
131
+ set (CMAKE_INCLUDE_CURRENT_DIR 1)
132
132
133
- SET (targets)
133
+ set (targets)
134
134
135
135
# Libraries
136
136
# pcre
137
- INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR} /src/pcre)
138
- ADD_LIBRARY (pcre OBJECT ${PCRE_HEADERS} ${PCRE_SOURCES} ${PCREPOSIX_SOURCES} )
137
+ include_directories (${PROJECT_BINARY_DIR} /src/pcre)
138
+ add_library (pcre OBJECT ${PCRE_HEADERS} ${PCRE_SOURCES} ${PCREPOSIX_SOURCES} )
139
139
140
140
# end CMakeLists.txt
0 commit comments