| 1 |
ph10 |
137 |
# CMakeLists.txt |
| 2 |
|
|
# |
| 3 |
ph10 |
258 |
# |
| 4 |
ph10 |
137 |
# This file allows building PCRE with the CMake configuration and build |
| 5 |
|
|
# tool. Download CMake in source or binary form from http://www.cmake.org/ |
| 6 |
|
|
# |
| 7 |
|
|
# Original listfile by Christian Ehrlicher <Ch.Ehrlicher@gmx.de> |
| 8 |
|
|
# Refined and expanded by Daniel Richard G. <skunk@iSKUNK.ORG> |
| 9 |
ph10 |
258 |
# 2007-09-14 mod by Sheri so 7.4 supported configuration options can be entered |
| 10 |
|
|
# 2007-09-19 Adjusted by PH to retain previous default settings |
| 11 |
ph10 |
291 |
# 2007-12-26 (a) On UNIX, use names libpcre instead of just pcre |
| 12 |
|
|
# (b) Ensure pcretest and pcregrep link with the local library, |
| 13 |
|
|
# not a previously-installed one. |
| 14 |
|
|
# (c) Add PCRE_SUPPORT_LIBREADLINE, PCRE_SUPPORT_LIBZ, and |
| 15 |
|
|
# PCRE_SUPPORT_LIBBZ2. |
| 16 |
ph10 |
303 |
# 2008-01-20 Brought up to date to include several new features by Christian |
| 17 |
|
|
# Ehrlicher. |
| 18 |
ph10 |
405 |
# 2008-01-22 Sheri added options for backward compatibility of library names |
| 19 |
|
|
# when building with minGW: |
| 20 |
ph10 |
311 |
# if "ON", NON_STANDARD_LIB_PREFIX causes shared libraries to |
| 21 |
ph10 |
405 |
# be built without "lib" as prefix. (The libraries will be named |
| 22 |
|
|
# pcre.dll, pcreposix.dll and pcrecpp.dll). |
| 23 |
ph10 |
311 |
# if "ON", NON_STANDARD_LIB_SUFFIX causes shared libraries to |
| 24 |
|
|
# be built with suffix of "-0.dll". (The libraries will be named |
| 25 |
|
|
# libpcre-0.dll, libpcreposix-0.dll and libpcrecpp-0.dll - same names |
| 26 |
|
|
# built by default with Configure and Make. |
| 27 |
ph10 |
312 |
# 2008-01-23 PH removed the automatic build of pcredemo. |
| 28 |
ph10 |
344 |
# 2008-04-22 PH modified READLINE support so it finds NCURSES when needed. |
| 29 |
ph10 |
351 |
# 2008-07-03 PH updated for revised UCP property support (change of files) |
| 30 |
ph10 |
407 |
# 2009-03-23 PH applied Steven Van Ingelgem's patch to change the name |
| 31 |
ph10 |
405 |
# CMAKE_BINARY_DIR to PROJECT_BINARY_DIR so that it works when PCRE |
| 32 |
|
|
# is included within another project. |
| 33 |
ph10 |
407 |
# 2009-03-23 PH applied a modified version of Steven Van Ingelgem's patches to |
| 34 |
|
|
# add options to stop the building of pcregrep and the tests, and |
| 35 |
|
|
# to disable the final configuration report. |
| 36 |
ph10 |
413 |
# 2009-04-11 PH applied Christian Ehrlicher's patch to show compiler flags that |
| 37 |
|
|
# are set by specifying a release type. |
| 38 |
ph10 |
475 |
# 2010-01-02 PH added test for stdint.h |
| 39 |
ph10 |
650 |
# 2010-03-02 PH added test for inttypes.h |
| 40 |
|
|
# 2011-08-01 PH added PCREGREP_BUFSIZE |
| 41 |
ph10 |
667 |
# 2011-08-22 PH added PCRE_SUPPORT_JIT |
| 42 |
ph10 |
684 |
# 2011-09-06 PH modified WIN32 ADD_TEST line as suggested by Sergey Cherepanov |
| 43 |
ph10 |
685 |
# 2011-09-06 PH added PCRE_SUPPORT_PCREGREP_JIT |
| 44 |
ph10 |
719 |
# 2011-10-04 Sheri added support for including coff data in windows shared libraries |
| 45 |
|
|
# compiled with MINGW if pcre.rc and/or pcreposix.rc are placed in |
| 46 |
|
|
# the source dir by the user prior to building |
| 47 |
|
|
# 2011-10-04 Sheri changed various add_test's to use exes' location built instead |
| 48 |
|
|
# of DEBUG location only (likely only matters in MSVC) |
| 49 |
|
|
# 2011-10-04 Sheri added scripts to provide needed variables to RunTest and |
| 50 |
|
|
# RunGrepTest (used for UNIX and Msys) |
| 51 |
|
|
# 2011-10-04 Sheri added scripts to provide needed variables and to execute |
| 52 |
|
|
# RunTest.bat in Win32 (for effortless testing with "make test") |
| 53 |
|
|
# 2011-10-04 Sheri Increased minimum required cmake version |
| 54 |
ph10 |
853 |
# 2012-01-06 PH removed pcre_info.c and added pcre_string_utils.c |
| 55 |
zherczeg |
863 |
# 2012-01-10 Zoltan Herczeg added libpcre16 support |
| 56 |
zherczeg |
864 |
# 2012-01-13 Stephen Kelly added out of source build support |
| 57 |
ph10 |
137 |
|
| 58 |
|
|
PROJECT(PCRE C CXX) |
| 59 |
|
|
|
| 60 |
ph10 |
719 |
# Increased minimum to 2.8.0 to support newer add_test features |
| 61 |
ph10 |
137 |
|
| 62 |
ph10 |
719 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) |
| 63 |
|
|
|
| 64 |
ph10 |
405 |
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake |
| 65 |
ph10 |
303 |
|
| 66 |
|
|
# external packages |
| 67 |
|
|
FIND_PACKAGE( BZip2 ) |
| 68 |
|
|
FIND_PACKAGE( ZLIB ) |
| 69 |
|
|
FIND_PACKAGE( Readline ) |
| 70 |
|
|
|
| 71 |
ph10 |
137 |
# Configuration checks |
| 72 |
|
|
|
| 73 |
|
|
INCLUDE(CheckIncludeFile) |
| 74 |
|
|
INCLUDE(CheckIncludeFileCXX) |
| 75 |
|
|
INCLUDE(CheckFunctionExists) |
| 76 |
|
|
INCLUDE(CheckTypeSize) |
| 77 |
|
|
|
| 78 |
ph10 |
318 |
CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H) |
| 79 |
ph10 |
475 |
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H) |
| 80 |
ph10 |
495 |
CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H) |
| 81 |
ph10 |
318 |
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H) |
| 82 |
|
|
CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H) |
| 83 |
|
|
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H) |
| 84 |
|
|
CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H) |
| 85 |
ph10 |
137 |
|
| 86 |
ph10 |
318 |
CHECK_INCLUDE_FILE_CXX(type_traits.h HAVE_TYPE_TRAITS_H) |
| 87 |
|
|
CHECK_INCLUDE_FILE_CXX(bits/type_traits.h HAVE_BITS_TYPE_TRAITS_H) |
| 88 |
ph10 |
137 |
|
| 89 |
ph10 |
318 |
CHECK_FUNCTION_EXISTS(bcopy HAVE_BCOPY) |
| 90 |
|
|
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE) |
| 91 |
|
|
CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR) |
| 92 |
|
|
CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL) |
| 93 |
|
|
CHECK_FUNCTION_EXISTS(strtoq HAVE_STRTOQ) |
| 94 |
ph10 |
303 |
CHECK_FUNCTION_EXISTS(_strtoi64 HAVE__STRTOI64) |
| 95 |
ph10 |
137 |
|
| 96 |
ph10 |
318 |
CHECK_TYPE_SIZE("long long" LONG_LONG) |
| 97 |
|
|
CHECK_TYPE_SIZE("unsigned long long" UNSIGNED_LONG_LONG) |
| 98 |
ph10 |
137 |
|
| 99 |
|
|
# User-configurable options |
| 100 |
|
|
# |
| 101 |
|
|
# (Note: CMakeSetup displays these in alphabetical order, regardless of |
| 102 |
|
|
# the order we use here) |
| 103 |
|
|
|
| 104 |
ph10 |
144 |
SET(BUILD_SHARED_LIBS OFF CACHE BOOL |
| 105 |
|
|
"Build shared libraries instead of static ones.") |
| 106 |
ph10 |
137 |
|
| 107 |
zherczeg |
863 |
OPTION(PCRE_BUILD_PCRE8 "Build 8 bit PCRE library" ON) |
| 108 |
|
|
|
| 109 |
|
|
OPTION(PCRE_BUILD_PCRE16 "Build 16 bit PCRE library" OFF) |
| 110 |
|
|
|
| 111 |
ph10 |
137 |
OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON) |
| 112 |
|
|
|
| 113 |
ph10 |
144 |
SET(PCRE_EBCDIC OFF CACHE BOOL |
| 114 |
ph10 |
137 |
"Use EBCDIC coding instead of ASCII. (This is rarely used outside of mainframe systems)") |
| 115 |
|
|
|
| 116 |
|
|
SET(PCRE_LINK_SIZE "2" CACHE STRING |
| 117 |
|
|
"Internal link size (2, 3 or 4 allowed). See LINK_SIZE in config.h.in for details.") |
| 118 |
|
|
|
| 119 |
|
|
SET(PCRE_MATCH_LIMIT "10000000" CACHE STRING |
| 120 |
|
|
"Default limit on internal looping. See MATCH_LIMIT in config.h.in for details.") |
| 121 |
|
|
|
| 122 |
|
|
SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" CACHE STRING |
| 123 |
|
|
"Default limit on internal recursion. See MATCH_LIMIT_RECURSION in config.h.in for details.") |
| 124 |
|
|
|
| 125 |
ph10 |
650 |
SET(PCREGREP_BUFSIZE "20480" CACHE STRING |
| 126 |
|
|
"Buffer size parameter for pcregrep. See PCREGREP_BUFSIZE in config.h.in for details.") |
| 127 |
|
|
|
| 128 |
ph10 |
137 |
SET(PCRE_NEWLINE "LF" CACHE STRING |
| 129 |
ph10 |
258 |
"What to recognize as a newline (one of CR, LF, CRLF, ANY, ANYCRLF).") |
| 130 |
ph10 |
137 |
|
| 131 |
ph10 |
199 |
SET(PCRE_NO_RECURSE OFF CACHE BOOL |
| 132 |
ph10 |
137 |
"If ON, then don't use stack recursion when matching. See NO_RECURSE in config.h.in for details.") |
| 133 |
|
|
|
| 134 |
|
|
SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING |
| 135 |
|
|
"Threshold for malloc() usage. See POSIX_MALLOC_THRESHOLD in config.h.in for details.") |
| 136 |
|
|
|
| 137 |
ph10 |
667 |
SET(PCRE_SUPPORT_JIT OFF CACHE BOOL |
| 138 |
|
|
"Enable support for Just-in-time compiling.") |
| 139 |
ph10 |
691 |
|
| 140 |
ph10 |
685 |
SET(PCRE_SUPPORT_PCREGREP_JIT ON CACHE BOOL |
| 141 |
|
|
"Enable use of Just-in-time compiling in pcregrep.") |
| 142 |
ph10 |
691 |
|
| 143 |
zherczeg |
863 |
SET(PCRE_SUPPORT_UTF OFF CACHE BOOL |
| 144 |
|
|
"Enable support for the Unicode Transformation Format (UTF) encoding.") |
| 145 |
|
|
|
| 146 |
ph10 |
144 |
SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL |
| 147 |
ph10 |
137 |
"Enable support for Unicode properties. (If set, UTF-8 support will be enabled as well)") |
| 148 |
|
|
|
| 149 |
ph10 |
144 |
SET(PCRE_SUPPORT_UTF8 OFF CACHE BOOL |
| 150 |
ph10 |
137 |
"Enable support for the Unicode UTF-8 encoding.") |
| 151 |
|
|
|
| 152 |
ph10 |
258 |
SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL |
| 153 |
|
|
"ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks") |
| 154 |
|
|
|
| 155 |
ph10 |
407 |
OPTION(PCRE_SHOW_REPORT "Show the final configuration report" ON) |
| 156 |
|
|
OPTION(PCRE_BUILD_PCREGREP "Build pcregrep" ON) |
| 157 |
|
|
OPTION(PCRE_BUILD_TESTS "Build the tests" ON) |
| 158 |
ph10 |
311 |
|
| 159 |
ph10 |
318 |
IF (MINGW) |
| 160 |
|
|
OPTION(NON_STANDARD_LIB_PREFIX |
| 161 |
|
|
"ON=Shared libraries built in mingw will be named pcre.dll, etc., instead of libpcre.dll, etc." |
| 162 |
|
|
OFF) |
| 163 |
ph10 |
311 |
|
| 164 |
ph10 |
318 |
OPTION(NON_STANDARD_LIB_SUFFIX |
| 165 |
|
|
"ON=Shared libraries built in mingw will be named libpcre-0.dll, etc., instead of libpcre.dll, etc." |
| 166 |
|
|
OFF) |
| 167 |
|
|
ENDIF(MINGW) |
| 168 |
|
|
|
| 169 |
ph10 |
303 |
# bzip2 lib |
| 170 |
|
|
IF(BZIP2_FOUND) |
| 171 |
|
|
OPTION (PCRE_SUPPORT_LIBBZ2 "Enable support for linking pcregrep with libbz2." ON) |
| 172 |
|
|
ENDIF(BZIP2_FOUND) |
| 173 |
|
|
IF(PCRE_SUPPORT_LIBBZ2) |
| 174 |
|
|
INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR}) |
| 175 |
|
|
ENDIF(PCRE_SUPPORT_LIBBZ2) |
| 176 |
ph10 |
292 |
|
| 177 |
ph10 |
303 |
# zlib |
| 178 |
|
|
IF(ZLIB_FOUND) |
| 179 |
|
|
OPTION (PCRE_SUPPORT_LIBZ "Enable support for linking pcregrep with libz." ON) |
| 180 |
|
|
ENDIF(ZLIB_FOUND) |
| 181 |
|
|
IF(PCRE_SUPPORT_LIBZ) |
| 182 |
|
|
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) |
| 183 |
|
|
ENDIF(PCRE_SUPPORT_LIBZ) |
| 184 |
ph10 |
292 |
|
| 185 |
ph10 |
303 |
# readline lib |
| 186 |
|
|
IF(READLINE_FOUND) |
| 187 |
|
|
OPTION (PCRE_SUPPORT_LIBREADLINE "Enable support for linking pcretest with libreadline." ON) |
| 188 |
|
|
ENDIF(READLINE_FOUND) |
| 189 |
|
|
IF(PCRE_SUPPORT_LIBREADLINE) |
| 190 |
|
|
INCLUDE_DIRECTORIES(${READLINE_INCLUDE_DIR}) |
| 191 |
|
|
ENDIF(PCRE_SUPPORT_LIBREADLINE) |
| 192 |
ph10 |
291 |
|
| 193 |
ph10 |
137 |
# Prepare build configuration |
| 194 |
|
|
|
| 195 |
|
|
SET(pcre_have_type_traits 0) |
| 196 |
|
|
SET(pcre_have_bits_type_traits 0) |
| 197 |
|
|
|
| 198 |
|
|
IF(HAVE_TYPE_TRAITS_H) |
| 199 |
ph10 |
318 |
SET(pcre_have_type_traits 1) |
| 200 |
ph10 |
137 |
ENDIF(HAVE_TYPE_TRAITS_H) |
| 201 |
|
|
|
| 202 |
|
|
IF(HAVE_BITS_TYPE_TRAITS_H) |
| 203 |
ph10 |
318 |
SET(pcre_have_bits_type_traits 1) |
| 204 |
ph10 |
137 |
ENDIF(HAVE_BITS_TYPE_TRAITS_H) |
| 205 |
|
|
|
| 206 |
|
|
SET(pcre_have_long_long 0) |
| 207 |
|
|
SET(pcre_have_ulong_long 0) |
| 208 |
|
|
|
| 209 |
|
|
IF(HAVE_LONG_LONG) |
| 210 |
ph10 |
318 |
SET(pcre_have_long_long 1) |
| 211 |
ph10 |
137 |
ENDIF(HAVE_LONG_LONG) |
| 212 |
|
|
|
| 213 |
|
|
IF(HAVE_UNSIGNED_LONG_LONG) |
| 214 |
ph10 |
318 |
SET(pcre_have_ulong_long 1) |
| 215 |
ph10 |
137 |
ENDIF(HAVE_UNSIGNED_LONG_LONG) |
| 216 |
|
|
|
| 217 |
ph10 |
144 |
IF(NOT BUILD_SHARED_LIBS) |
| 218 |
ph10 |
318 |
SET(PCRE_STATIC 1) |
| 219 |
ph10 |
144 |
ENDIF(NOT BUILD_SHARED_LIBS) |
| 220 |
|
|
|
| 221 |
zherczeg |
863 |
IF(NOT PCRE_BUILD_PCRE8 AND NOT PCRE_BUILD_PCRE16) |
| 222 |
|
|
MESSAGE(FATAL_ERROR "Either PCRE_BUILD_PCRE8 or PCRE_BUILD_PCRE16 must be enabled") |
| 223 |
|
|
ENDIF(NOT PCRE_BUILD_PCRE8 AND NOT PCRE_BUILD_PCRE16) |
| 224 |
|
|
|
| 225 |
|
|
IF(PCRE_BUILD_PCRE8) |
| 226 |
|
|
SET(SUPPORT_PCRE8 1) |
| 227 |
|
|
ENDIF(PCRE_BUILD_PCRE8) |
| 228 |
|
|
|
| 229 |
|
|
IF(PCRE_BUILD_PCRE16) |
| 230 |
|
|
SET(SUPPORT_PCRE16 1) |
| 231 |
|
|
ENDIF(PCRE_BUILD_PCRE16) |
| 232 |
|
|
|
| 233 |
|
|
IF(PCRE_BUILD_PCRECPP AND NOT PCRE_BUILD_PCRE8) |
| 234 |
|
|
MESSAGE(STATUS "** PCRE_BUILD_PCRE8 must be enabled for the C++ library support") |
| 235 |
|
|
SET(PCRE_BUILD_PCRECPP OFF) |
| 236 |
|
|
ENDIF(PCRE_BUILD_PCRECPP AND NOT PCRE_BUILD_PCRE8) |
| 237 |
|
|
|
| 238 |
|
|
IF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUILD_PCRE8) |
| 239 |
|
|
MESSAGE(STATUS "** PCRE_BUILD_PCRE8 must be enabled for the pcregrep program") |
| 240 |
|
|
SET(PCRE_BUILD_PCREGREP OFF) |
| 241 |
|
|
ENDIF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUILD_PCRE8) |
| 242 |
|
|
|
| 243 |
ph10 |
258 |
IF(PCRE_SUPPORT_BSR_ANYCRLF) |
| 244 |
ph10 |
318 |
SET(BSR_ANYCRLF 1) |
| 245 |
ph10 |
258 |
ENDIF(PCRE_SUPPORT_BSR_ANYCRLF) |
| 246 |
|
|
|
| 247 |
zherczeg |
863 |
IF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES) |
| 248 |
|
|
SET(SUPPORT_UTF 1) |
| 249 |
|
|
SET(PCRE_SUPPORT_UTF ON) |
| 250 |
|
|
ENDIF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES) |
| 251 |
ph10 |
137 |
|
| 252 |
|
|
IF(PCRE_SUPPORT_UNICODE_PROPERTIES) |
| 253 |
ph10 |
318 |
SET(SUPPORT_UCP 1) |
| 254 |
ph10 |
137 |
ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES) |
| 255 |
|
|
|
| 256 |
ph10 |
667 |
IF(PCRE_SUPPORT_JIT) |
| 257 |
|
|
SET(SUPPORT_JIT 1) |
| 258 |
ph10 |
691 |
ENDIF(PCRE_SUPPORT_JIT) |
| 259 |
ph10 |
667 |
|
| 260 |
ph10 |
685 |
IF(PCRE_SUPPORT_PCREGREP_JIT) |
| 261 |
|
|
SET(SUPPORT_PCREGREP_JIT 1) |
| 262 |
ph10 |
691 |
ENDIF(PCRE_SUPPORT_PCREGREP_JIT) |
| 263 |
ph10 |
685 |
|
| 264 |
ph10 |
344 |
# This next one used to contain |
| 265 |
|
|
# SET(PCRETEST_LIBS ${READLINE_LIBRARY}) |
| 266 |
|
|
# but I was advised to add the NCURSES test as well, along with |
| 267 |
|
|
# some modifications to cmake/FindReadline.cmake which should |
| 268 |
|
|
# make it possible to override the default if necessary. PH |
| 269 |
|
|
|
| 270 |
ph10 |
291 |
IF(PCRE_SUPPORT_LIBREADLINE) |
| 271 |
|
|
SET(SUPPORT_LIBREADLINE 1) |
| 272 |
ph10 |
344 |
SET(PCRETEST_LIBS ${READLINE_LIBRARY} ${NCURSES_LIBRARY}) |
| 273 |
ph10 |
291 |
ENDIF(PCRE_SUPPORT_LIBREADLINE) |
| 274 |
|
|
|
| 275 |
|
|
IF(PCRE_SUPPORT_LIBZ) |
| 276 |
|
|
SET(SUPPORT_LIBZ 1) |
| 277 |
ph10 |
303 |
SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${ZLIB_LIBRARIES}) |
| 278 |
ph10 |
291 |
ENDIF(PCRE_SUPPORT_LIBZ) |
| 279 |
|
|
|
| 280 |
|
|
IF(PCRE_SUPPORT_LIBBZ2) |
| 281 |
|
|
SET(SUPPORT_LIBBZ2 1) |
| 282 |
ph10 |
303 |
SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${BZIP2_LIBRARIES}) |
| 283 |
ph10 |
292 |
ENDIF(PCRE_SUPPORT_LIBBZ2) |
| 284 |
ph10 |
291 |
|
| 285 |
ph10 |
144 |
SET(NEWLINE "") |
| 286 |
|
|
|
| 287 |
ph10 |
137 |
IF(PCRE_NEWLINE STREQUAL "LF") |
| 288 |
ph10 |
318 |
SET(NEWLINE "10") |
| 289 |
ph10 |
144 |
ENDIF(PCRE_NEWLINE STREQUAL "LF") |
| 290 |
|
|
IF(PCRE_NEWLINE STREQUAL "CR") |
| 291 |
ph10 |
318 |
SET(NEWLINE "13") |
| 292 |
ph10 |
144 |
ENDIF(PCRE_NEWLINE STREQUAL "CR") |
| 293 |
|
|
IF(PCRE_NEWLINE STREQUAL "CRLF") |
| 294 |
ph10 |
318 |
SET(NEWLINE "3338") |
| 295 |
ph10 |
144 |
ENDIF(PCRE_NEWLINE STREQUAL "CRLF") |
| 296 |
|
|
IF(PCRE_NEWLINE STREQUAL "ANY") |
| 297 |
ph10 |
318 |
SET(NEWLINE "-1") |
| 298 |
ph10 |
144 |
ENDIF(PCRE_NEWLINE STREQUAL "ANY") |
| 299 |
ph10 |
258 |
IF(PCRE_NEWLINE STREQUAL "ANYCRLF") |
| 300 |
ph10 |
318 |
SET(NEWLINE "-2") |
| 301 |
ph10 |
258 |
ENDIF(PCRE_NEWLINE STREQUAL "ANYCRLF") |
| 302 |
ph10 |
144 |
|
| 303 |
|
|
IF(NEWLINE STREQUAL "") |
| 304 |
ph10 |
318 |
MESSAGE(FATAL_ERROR "The PCRE_NEWLINE variable must be set to one of the following values: \"LF\", \"CR\", \"CRLF\", \"ANY\", \"ANYCRLF\".") |
| 305 |
ph10 |
144 |
ENDIF(NEWLINE STREQUAL "") |
| 306 |
ph10 |
137 |
|
| 307 |
|
|
IF(PCRE_EBCDIC) |
| 308 |
ph10 |
318 |
SET(EBCDIC 1) |
| 309 |
ph10 |
137 |
ENDIF(PCRE_EBCDIC) |
| 310 |
|
|
|
| 311 |
|
|
IF(PCRE_NO_RECURSE) |
| 312 |
ph10 |
318 |
SET(NO_RECURSE 1) |
| 313 |
ph10 |
137 |
ENDIF(PCRE_NO_RECURSE) |
| 314 |
|
|
|
| 315 |
|
|
# Output files |
| 316 |
|
|
CONFIGURE_FILE(config-cmake.h.in |
| 317 |
ph10 |
405 |
${PROJECT_BINARY_DIR}/config.h |
| 318 |
ph10 |
137 |
@ONLY) |
| 319 |
|
|
|
| 320 |
|
|
CONFIGURE_FILE(pcre.h.generic |
| 321 |
ph10 |
405 |
${PROJECT_BINARY_DIR}/pcre.h |
| 322 |
ph10 |
137 |
COPYONLY) |
| 323 |
|
|
|
| 324 |
|
|
# What about pcre-config and libpcre.pc? |
| 325 |
|
|
|
| 326 |
|
|
IF(PCRE_BUILD_PCRECPP) |
| 327 |
ph10 |
318 |
CONFIGURE_FILE(pcre_stringpiece.h.in |
| 328 |
ph10 |
405 |
${PROJECT_BINARY_DIR}/pcre_stringpiece.h |
| 329 |
ph10 |
318 |
@ONLY) |
| 330 |
ph10 |
137 |
|
| 331 |
ph10 |
318 |
CONFIGURE_FILE(pcrecpparg.h.in |
| 332 |
ph10 |
405 |
${PROJECT_BINARY_DIR}/pcrecpparg.h |
| 333 |
ph10 |
318 |
@ONLY) |
| 334 |
ph10 |
137 |
ENDIF(PCRE_BUILD_PCRECPP) |
| 335 |
|
|
|
| 336 |
|
|
# Character table generation |
| 337 |
|
|
|
| 338 |
ph10 |
303 |
OPTION(PCRE_REBUILD_CHARTABLES "Rebuild char tables" OFF) |
| 339 |
|
|
IF(PCRE_REBUILD_CHARTABLES) |
| 340 |
|
|
ADD_EXECUTABLE(dftables dftables.c) |
| 341 |
ph10 |
137 |
|
| 342 |
ph10 |
303 |
GET_TARGET_PROPERTY(DFTABLES_EXE dftables LOCATION) |
| 343 |
ph10 |
137 |
|
| 344 |
ph10 |
303 |
ADD_CUSTOM_COMMAND( |
| 345 |
|
|
COMMENT "Generating character tables (pcre_chartables.c) for current locale" |
| 346 |
|
|
DEPENDS dftables |
| 347 |
|
|
COMMAND ${DFTABLES_EXE} |
| 348 |
ph10 |
405 |
ARGS ${PROJECT_BINARY_DIR}/pcre_chartables.c |
| 349 |
|
|
OUTPUT ${PROJECT_BINARY_DIR}/pcre_chartables.c |
| 350 |
ph10 |
303 |
) |
| 351 |
|
|
ELSE(PCRE_REBUILD_CHARTABLES) |
| 352 |
ph10 |
405 |
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/pcre_chartables.c.dist |
| 353 |
|
|
${PROJECT_BINARY_DIR}/pcre_chartables.c |
| 354 |
ph10 |
303 |
COPYONLY) |
| 355 |
|
|
ENDIF(PCRE_REBUILD_CHARTABLES) |
| 356 |
ph10 |
137 |
|
| 357 |
|
|
# Source code |
| 358 |
|
|
|
| 359 |
ph10 |
405 |
SET(PCRE_HEADERS ${PROJECT_BINARY_DIR}/pcre.h) |
| 360 |
ph10 |
137 |
|
| 361 |
zherczeg |
863 |
IF(PCRE_BUILD_PCRE8) |
| 362 |
ph10 |
137 |
SET(PCRE_SOURCES |
| 363 |
zherczeg |
864 |
pcre_byte_order.c |
| 364 |
ph10 |
836 |
pcre_chartables.c |
| 365 |
ph10 |
303 |
pcre_compile.c |
| 366 |
|
|
pcre_config.c |
| 367 |
|
|
pcre_dfa_exec.c |
| 368 |
|
|
pcre_exec.c |
| 369 |
|
|
pcre_fullinfo.c |
| 370 |
|
|
pcre_get.c |
| 371 |
|
|
pcre_globals.c |
| 372 |
ph10 |
667 |
pcre_jit_compile.c |
| 373 |
ph10 |
853 |
pcre_maketables.c |
| 374 |
ph10 |
303 |
pcre_newline.c |
| 375 |
|
|
pcre_ord2utf8.c |
| 376 |
|
|
pcre_refcount.c |
| 377 |
ph10 |
853 |
pcre_string_utils.c |
| 378 |
ph10 |
303 |
pcre_study.c |
| 379 |
|
|
pcre_tables.c |
| 380 |
ph10 |
351 |
pcre_ucd.c |
| 381 |
ph10 |
303 |
pcre_valid_utf8.c |
| 382 |
|
|
pcre_version.c |
| 383 |
|
|
pcre_xclass.c |
| 384 |
ph10 |
137 |
) |
| 385 |
|
|
|
| 386 |
|
|
SET(PCREPOSIX_HEADERS pcreposix.h) |
| 387 |
|
|
|
| 388 |
|
|
SET(PCREPOSIX_SOURCES pcreposix.c) |
| 389 |
|
|
|
| 390 |
zherczeg |
863 |
ENDIF(PCRE_BUILD_PCRE8) |
| 391 |
|
|
|
| 392 |
|
|
IF(PCRE_BUILD_PCRE16) |
| 393 |
|
|
SET(PCRE16_SOURCES |
| 394 |
|
|
pcre16_byte_order.c |
| 395 |
|
|
pcre16_chartables.c |
| 396 |
|
|
pcre16_compile.c |
| 397 |
|
|
pcre16_config.c |
| 398 |
|
|
pcre16_dfa_exec.c |
| 399 |
|
|
pcre16_exec.c |
| 400 |
|
|
pcre16_fullinfo.c |
| 401 |
|
|
pcre16_get.c |
| 402 |
|
|
pcre16_globals.c |
| 403 |
|
|
pcre16_jit_compile.c |
| 404 |
|
|
pcre16_maketables.c |
| 405 |
|
|
pcre16_newline.c |
| 406 |
|
|
pcre16_ord2utf16.c |
| 407 |
|
|
pcre16_refcount.c |
| 408 |
|
|
pcre16_string_utils.c |
| 409 |
|
|
pcre16_study.c |
| 410 |
|
|
pcre16_tables.c |
| 411 |
|
|
pcre16_ucd.c |
| 412 |
|
|
pcre16_utf16_utils.c |
| 413 |
|
|
pcre16_valid_utf16.c |
| 414 |
|
|
pcre16_version.c |
| 415 |
|
|
pcre16_xclass.c |
| 416 |
|
|
) |
| 417 |
|
|
ENDIF(PCRE_BUILD_PCRE16) |
| 418 |
|
|
|
| 419 |
ph10 |
719 |
IF(MINGW AND NOT PCRE_STATIC) |
| 420 |
|
|
IF (EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc) |
| 421 |
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/pcre.o |
| 422 |
|
|
PRE-LINK |
| 423 |
|
|
COMMAND windres ARGS pcre.rc pcre.o |
| 424 |
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
| 425 |
|
|
COMMENT Using pcre coff info in mingw build) |
| 426 |
|
|
SET(PCRE_SOURCES |
| 427 |
|
|
${PCRE_SOURCES} ${PROJECT_SOURCE_DIR}/pcre.o |
| 428 |
|
|
) |
| 429 |
|
|
ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc) |
| 430 |
|
|
IF (EXISTS ${PROJECT_SOURCE_DIR}/pcreposix.rc) |
| 431 |
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/pcreposix.o |
| 432 |
|
|
PRE-LINK |
| 433 |
|
|
COMMAND windres ARGS pcreposix.rc pcreposix.o |
| 434 |
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
| 435 |
|
|
COMMENT Using pcreposix coff info in mingw build) |
| 436 |
|
|
SET(PCREPOSIX_SOURCES |
| 437 |
|
|
${PCREPOSIX_SOURCES} ${PROJECT_SOURCE_DIR}/pcreposix.o |
| 438 |
|
|
) |
| 439 |
|
|
ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/pcreposix.rc) |
| 440 |
|
|
ENDIF(MINGW AND NOT PCRE_STATIC) |
| 441 |
|
|
|
| 442 |
ph10 |
137 |
SET(PCRECPP_HEADERS |
| 443 |
ph10 |
303 |
pcrecpp.h |
| 444 |
|
|
pcre_scanner.h |
| 445 |
ph10 |
405 |
${PROJECT_BINARY_DIR}/pcrecpparg.h |
| 446 |
|
|
${PROJECT_BINARY_DIR}/pcre_stringpiece.h |
| 447 |
ph10 |
137 |
) |
| 448 |
|
|
|
| 449 |
|
|
SET(PCRECPP_SOURCES |
| 450 |
ph10 |
318 |
pcrecpp.cc |
| 451 |
|
|
pcre_scanner.cc |
| 452 |
|
|
pcre_stringpiece.cc |
| 453 |
ph10 |
137 |
) |
| 454 |
|
|
|
| 455 |
|
|
# Build setup |
| 456 |
|
|
|
| 457 |
|
|
ADD_DEFINITIONS(-DHAVE_CONFIG_H) |
| 458 |
|
|
|
| 459 |
ph10 |
303 |
IF(MSVC) |
| 460 |
ph10 |
318 |
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) |
| 461 |
ph10 |
303 |
ENDIF(MSVC) |
| 462 |
ph10 |
137 |
|
| 463 |
|
|
SET(CMAKE_INCLUDE_CURRENT_DIR 1) |
| 464 |
ph10 |
303 |
# needed to make sure to not link debug libs |
| 465 |
|
|
# against release libs and vice versa |
| 466 |
|
|
IF(WIN32) |
| 467 |
|
|
SET(CMAKE_DEBUG_POSTFIX "d") |
| 468 |
|
|
ENDIF(WIN32) |
| 469 |
ph10 |
137 |
|
| 470 |
ph10 |
407 |
SET(targets) |
| 471 |
|
|
|
| 472 |
ph10 |
137 |
# Libraries |
| 473 |
ph10 |
318 |
# pcre |
| 474 |
zherczeg |
863 |
IF(PCRE_BUILD_PCRE8) |
| 475 |
ph10 |
405 |
ADD_LIBRARY(pcre ${PCRE_HEADERS} ${PCRE_SOURCES} ${PROJECT_BINARY_DIR}/config.h) |
| 476 |
ph10 |
407 |
SET(targets ${targets} pcre) |
| 477 |
ph10 |
137 |
ADD_LIBRARY(pcreposix ${PCREPOSIX_HEADERS} ${PCREPOSIX_SOURCES}) |
| 478 |
ph10 |
407 |
SET(targets ${targets} pcreposix) |
| 479 |
ph10 |
137 |
TARGET_LINK_LIBRARIES(pcreposix pcre) |
| 480 |
zherczeg |
863 |
|
| 481 |
ph10 |
318 |
IF(MINGW AND NOT PCRE_STATIC) |
| 482 |
|
|
IF(NON_STANDARD_LIB_PREFIX) |
| 483 |
|
|
SET_TARGET_PROPERTIES(pcre pcreposix |
| 484 |
ph10 |
311 |
PROPERTIES PREFIX "" |
| 485 |
ph10 |
318 |
) |
| 486 |
|
|
ENDIF(NON_STANDARD_LIB_PREFIX) |
| 487 |
ph10 |
311 |
|
| 488 |
ph10 |
318 |
IF(NON_STANDARD_LIB_SUFFIX) |
| 489 |
|
|
SET_TARGET_PROPERTIES(pcre pcreposix |
| 490 |
ph10 |
311 |
PROPERTIES SUFFIX "-0.dll" |
| 491 |
ph10 |
318 |
) |
| 492 |
|
|
ENDIF(NON_STANDARD_LIB_SUFFIX) |
| 493 |
|
|
ENDIF(MINGW AND NOT PCRE_STATIC) |
| 494 |
ph10 |
311 |
|
| 495 |
zherczeg |
863 |
ENDIF(PCRE_BUILD_PCRE8) |
| 496 |
ph10 |
318 |
|
| 497 |
zherczeg |
863 |
IF(PCRE_BUILD_PCRE16) |
| 498 |
|
|
ADD_LIBRARY(pcre16 ${PCRE_HEADERS} ${PCRE16_SOURCES} ${PROJECT_BINARY_DIR}/config.h) |
| 499 |
|
|
SET(targets ${targets} pcre16) |
| 500 |
|
|
|
| 501 |
|
|
IF(MINGW AND NOT PCRE_STATIC) |
| 502 |
|
|
IF(NON_STANDARD_LIB_PREFIX) |
| 503 |
|
|
SET_TARGET_PROPERTIES(pcre16 |
| 504 |
|
|
PROPERTIES PREFIX "" |
| 505 |
|
|
) |
| 506 |
|
|
ENDIF(NON_STANDARD_LIB_PREFIX) |
| 507 |
|
|
|
| 508 |
|
|
IF(NON_STANDARD_LIB_SUFFIX) |
| 509 |
|
|
SET_TARGET_PROPERTIES(pcre16 |
| 510 |
|
|
PROPERTIES SUFFIX "-0.dll" |
| 511 |
|
|
) |
| 512 |
|
|
ENDIF(NON_STANDARD_LIB_SUFFIX) |
| 513 |
|
|
ENDIF(MINGW AND NOT PCRE_STATIC) |
| 514 |
|
|
|
| 515 |
|
|
ENDIF(PCRE_BUILD_PCRE16) |
| 516 |
|
|
|
| 517 |
ph10 |
318 |
# pcrecpp |
| 518 |
ph10 |
137 |
IF(PCRE_BUILD_PCRECPP) |
| 519 |
zherczeg |
863 |
ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES}) |
| 520 |
ph10 |
407 |
SET(targets ${targets} pcrecpp) |
| 521 |
zherczeg |
863 |
TARGET_LINK_LIBRARIES(pcrecpp pcre) |
| 522 |
ph10 |
311 |
|
| 523 |
ph10 |
318 |
IF(MINGW AND NOT PCRE_STATIC) |
| 524 |
|
|
IF(NON_STANDARD_LIB_PREFIX) |
| 525 |
|
|
SET_TARGET_PROPERTIES(pcrecpp |
| 526 |
|
|
PROPERTIES PREFIX "" |
| 527 |
|
|
) |
| 528 |
|
|
ENDIF(NON_STANDARD_LIB_PREFIX) |
| 529 |
|
|
|
| 530 |
|
|
IF(NON_STANDARD_LIB_SUFFIX) |
| 531 |
|
|
SET_TARGET_PROPERTIES(pcrecpp |
| 532 |
|
|
PROPERTIES SUFFIX "-0.dll" |
| 533 |
|
|
) |
| 534 |
|
|
ENDIF(NON_STANDARD_LIB_SUFFIX) |
| 535 |
|
|
ENDIF(MINGW AND NOT PCRE_STATIC) |
| 536 |
ph10 |
137 |
ENDIF(PCRE_BUILD_PCRECPP) |
| 537 |
|
|
|
| 538 |
ph10 |
318 |
|
| 539 |
ph10 |
137 |
# Executables |
| 540 |
|
|
|
| 541 |
ph10 |
312 |
# Removed by PH (2008-01-23) because pcredemo shouldn't really be built |
| 542 |
|
|
# automatically, and it gave trouble in some environments anyway. |
| 543 |
|
|
# ADD_EXECUTABLE(pcredemo pcredemo.c) |
| 544 |
|
|
# TARGET_LINK_LIBRARIES(pcredemo pcreposix) |
| 545 |
|
|
# IF(NOT BUILD_SHARED_LIBS) |
| 546 |
|
|
# # make sure to not use declspec(dllimport) in static mode on windows |
| 547 |
ph10 |
318 |
# SET_TARGET_PROPERTIES(pcredemo PROPERTIES COMPILE_FLAGS "-DPCRE_STATIC") |
| 548 |
ph10 |
312 |
# ENDIF(NOT BUILD_SHARED_LIBS) |
| 549 |
ph10 |
303 |
|
| 550 |
zherczeg |
863 |
IF(PCRE_BUILD_PCREGREP) |
| 551 |
ph10 |
407 |
ADD_EXECUTABLE(pcregrep pcregrep.c) |
| 552 |
|
|
SET(targets ${targets} pcregrep) |
| 553 |
|
|
TARGET_LINK_LIBRARIES(pcregrep pcreposix ${PCREGREP_LIBS}) |
| 554 |
zherczeg |
863 |
ENDIF(PCRE_BUILD_PCREGREP) |
| 555 |
ph10 |
144 |
|
| 556 |
ph10 |
407 |
# Testing |
| 557 |
|
|
IF(PCRE_BUILD_TESTS) |
| 558 |
|
|
ENABLE_TESTING() |
| 559 |
ph10 |
144 |
|
| 560 |
zherczeg |
863 |
SET(PCRETEST_SOURCES pcretest.c) |
| 561 |
|
|
IF(PCRE_BUILD_PCRE8) |
| 562 |
|
|
LIST(APPEND PCRETEST_SOURCES pcre_printint.c) |
| 563 |
|
|
ENDIF(PCRE_BUILD_PCRE8) |
| 564 |
|
|
IF(PCRE_BUILD_PCRE16) |
| 565 |
|
|
LIST(APPEND PCRETEST_SOURCES pcre16_printint.c) |
| 566 |
|
|
ENDIF(PCRE_BUILD_PCRE16) |
| 567 |
|
|
|
| 568 |
|
|
ADD_EXECUTABLE(pcretest ${PCRETEST_SOURCES}) |
| 569 |
ph10 |
407 |
SET(targets ${targets} pcretest) |
| 570 |
zherczeg |
863 |
IF(PCRE_BUILD_PCRE8) |
| 571 |
|
|
LIST(APPEND PCRETEST_LIBS pcreposix pcre) |
| 572 |
|
|
ENDIF(PCRE_BUILD_PCRE8) |
| 573 |
|
|
IF(PCRE_BUILD_PCRE16) |
| 574 |
|
|
LIST(APPEND PCRETEST_LIBS pcre16) |
| 575 |
|
|
ENDIF(PCRE_BUILD_PCRE16) |
| 576 |
|
|
TARGET_LINK_LIBRARIES(pcretest ${PCRETEST_LIBS}) |
| 577 |
ph10 |
691 |
|
| 578 |
ph10 |
698 |
IF(PCRE_SUPPORT_JIT) |
| 579 |
ph10 |
667 |
ADD_EXECUTABLE(pcre_jit_test pcre_jit_test.c) |
| 580 |
|
|
SET(targets ${targets} pcre_jit_test) |
| 581 |
zherczeg |
863 |
SET(PCRE_JIT_TEST_LIBS ) |
| 582 |
|
|
IF(PCRE_BUILD_PCRE8) |
| 583 |
|
|
LIST(APPEND PCRE_JIT_TEST_LIBS pcre) |
| 584 |
|
|
ENDIF(PCRE_BUILD_PCRE8) |
| 585 |
|
|
IF(PCRE_BUILD_PCRE16) |
| 586 |
|
|
LIST(APPEND PCRE_JIT_TEST_LIBS pcre16) |
| 587 |
|
|
ENDIF(PCRE_BUILD_PCRE16) |
| 588 |
|
|
TARGET_LINK_LIBRARIES(pcre_jit_test ${PCRE_JIT_TEST_LIBS}) |
| 589 |
ph10 |
698 |
ENDIF(PCRE_SUPPORT_JIT) |
| 590 |
ph10 |
144 |
|
| 591 |
ph10 |
407 |
IF(PCRE_BUILD_PCRECPP) |
| 592 |
|
|
ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc) |
| 593 |
|
|
SET(targets ${targets} pcrecpp_unittest) |
| 594 |
|
|
TARGET_LINK_LIBRARIES(pcrecpp_unittest pcrecpp) |
| 595 |
|
|
IF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC) |
| 596 |
|
|
SET_TARGET_PROPERTIES(pcrecpp |
| 597 |
|
|
PROPERTIES PREFIX "" |
| 598 |
|
|
) |
| 599 |
|
|
ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC) |
| 600 |
ph10 |
137 |
|
| 601 |
ph10 |
407 |
ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc) |
| 602 |
|
|
SET(targets ${targets} pcre_scanner_unittest) |
| 603 |
|
|
TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp) |
| 604 |
ph10 |
144 |
|
| 605 |
ph10 |
407 |
ADD_EXECUTABLE(pcre_stringpiece_unittest pcre_stringpiece_unittest.cc) |
| 606 |
|
|
SET(targets ${targets} pcre_stringpiece_unittest) |
| 607 |
|
|
TARGET_LINK_LIBRARIES(pcre_stringpiece_unittest pcrecpp) |
| 608 |
|
|
ENDIF(PCRE_BUILD_PCRECPP) |
| 609 |
ph10 |
144 |
|
| 610 |
ph10 |
719 |
# exes in Debug location tested by the RunTest shell script |
| 611 |
|
|
# via "make test" |
| 612 |
zherczeg |
863 |
IF(PCRE_BUILD_PCREGREP) |
| 613 |
|
|
GET_TARGET_PROPERTY(PCREGREP_EXE pcregrep DEBUG_LOCATION) |
| 614 |
|
|
ENDIF(PCRE_BUILD_PCREGREP) |
| 615 |
|
|
|
| 616 |
ph10 |
407 |
GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION) |
| 617 |
ph10 |
137 |
|
| 618 |
ph10 |
719 |
# ================================================= |
| 619 |
|
|
# Write out a CTest configuration file |
| 620 |
ph10 |
407 |
# |
| 621 |
|
|
FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest |
| 622 |
|
|
"# This is a generated file. |
| 623 |
ph10 |
719 |
MESSAGE(\"When testing is complete, review test output in the |
| 624 |
|
|
${PROJECT_BINARY_DIR}/Testing/Temporary folder.\") |
| 625 |
|
|
MESSAGE(\"\") |
| 626 |
|
|
") |
| 627 |
ph10 |
144 |
|
| 628 |
zherczeg |
863 |
FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.sh |
| 629 |
|
|
"#! /bin/sh |
| 630 |
ph10 |
719 |
# This is a generated file. |
| 631 |
|
|
srcdir=${PROJECT_SOURCE_DIR} |
| 632 |
|
|
pcretest=${PCRETEST_EXE} |
| 633 |
|
|
source ${PROJECT_SOURCE_DIR}/RunTest |
| 634 |
|
|
if test \"$?\" != \"0\"; then exit 1; fi |
| 635 |
|
|
# End |
| 636 |
|
|
") |
| 637 |
|
|
|
| 638 |
zherczeg |
863 |
IF(UNIX) |
| 639 |
|
|
ADD_TEST(pcre_test sh ${PROJECT_BINARY_DIR}/pcre_test.sh) |
| 640 |
|
|
ENDIF(UNIX) |
| 641 |
|
|
|
| 642 |
|
|
IF(PCRE_BUILD_PCREGREP) |
| 643 |
|
|
FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_grep_test.sh |
| 644 |
|
|
"#! /bin/sh |
| 645 |
ph10 |
719 |
# This is a generated file. |
| 646 |
|
|
srcdir=${PROJECT_SOURCE_DIR} |
| 647 |
|
|
pcregrep=${PCREGREP_EXE} |
| 648 |
|
|
pcretest=${PCRETEST_EXE} |
| 649 |
|
|
source ${PROJECT_SOURCE_DIR}/RunGrepTest |
| 650 |
|
|
if test \"$?\" != \"0\"; then exit 1; fi |
| 651 |
|
|
# End |
| 652 |
|
|
") |
| 653 |
|
|
|
| 654 |
zherczeg |
863 |
IF(UNIX) |
| 655 |
|
|
ADD_TEST(pcre_grep_test sh ${PROJECT_BINARY_DIR}/pcre_grep_test.sh) |
| 656 |
|
|
ENDIF(UNIX) |
| 657 |
|
|
ENDIF(PCRE_BUILD_PCREGREP) |
| 658 |
ph10 |
706 |
|
| 659 |
ph10 |
407 |
IF(WIN32) |
| 660 |
ph10 |
719 |
# Provide environment for executing the bat file version of RunTest |
| 661 |
|
|
string(REPLACE "/" "\\" winsrc "${PROJECT_SOURCE_DIR}") |
| 662 |
|
|
|
| 663 |
|
|
FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.txt |
| 664 |
|
|
"\@REM This is a generated file. |
| 665 |
|
|
\@Echo off |
| 666 |
|
|
setlocal |
| 667 |
|
|
SET\ srcdir=\${srcdir} |
| 668 |
|
|
SET\ pcretest=\${pcretest} |
| 669 |
|
|
call \"\${srcdir}\\RunTest.Bat\" |
| 670 |
|
|
if errorlevel 1 exit /b 1 |
| 671 |
|
|
echo RunTest.bat tests successfully completed |
| 672 |
|
|
") |
| 673 |
|
|
|
| 674 |
|
|
FILE(WRITE ${PROJECT_BINARY_DIR}/BatDriver.cmake |
| 675 |
|
|
"# This is a generated file. |
| 676 |
|
|
# this script is run with arguments via the cmake command in add_test(NAME pcre_test_bat) |
| 677 |
zherczeg |
863 |
# BatDriver feeds the actual location of pcretest.exe |
| 678 |
ph10 |
719 |
FILE(TO_NATIVE_PATH \${pcretestx} pcretest) |
| 679 |
|
|
FILE(TO_NATIVE_PATH \${srcdirx} srcdir) |
| 680 |
|
|
configure_file(\"\${bindirx}/pcre_test.txt\" \"\${bindirx}/pcre_test.bat\") |
| 681 |
|
|
# MESSAGE(\"cmake\ variable\ pcretest\ is\ \${pcretest}\") |
| 682 |
|
|
# STRING(REPLACE \" \" \"\\ \" bindir \${bindirx}) |
| 683 |
|
|
MESSAGE(\"COMMAND pcre_test.bat \") |
| 684 |
|
|
EXECUTE_PROCESS(COMMAND pcre_test.bat |
| 685 |
|
|
WORKING_DIRECTORY . |
| 686 |
|
|
OUTPUT_VARIABLE batoutput) |
| 687 |
|
|
MESSAGE(\"OUTPUT: \${batoutput}\") |
| 688 |
|
|
") |
| 689 |
|
|
|
| 690 |
|
|
ADD_TEST(NAME pcre_test_bat |
| 691 |
zherczeg |
863 |
COMMAND ${CMAKE_COMMAND} -D bindirx=${PROJECT_BINARY_DIR} -D srcdirx=${PROJECT_SOURCE_DIR} -D pcretestx=$<TARGET_FILE:pcretest> -P "${PROJECT_BINARY_DIR}/BatDriver.cmake") |
| 692 |
ph10 |
719 |
SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES |
| 693 |
|
|
PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed") |
| 694 |
|
|
|
| 695 |
ph10 |
706 |
IF("$ENV{OSTYPE}" STREQUAL "msys") |
| 696 |
zherczeg |
863 |
# Both the sh and bat file versions of RunTest are run if make test is used |
| 697 |
|
|
# in msys |
| 698 |
ph10 |
719 |
ADD_TEST(pcre_test_sh sh.exe ${PROJECT_BINARY_DIR}/pcre_test.sh) |
| 699 |
zherczeg |
863 |
IF(PCRE_BUILD_PCREGREP) |
| 700 |
|
|
ADD_TEST(pcre_grep_test sh.exe ${PROJECT_BINARY_DIR}/pcre_grep_test.sh) |
| 701 |
|
|
ENDIF(PCRE_BUILD_PCREGREP) |
| 702 |
|
|
ENDIF("$ENV{OSTYPE}" STREQUAL "msys") |
| 703 |
ph10 |
719 |
|
| 704 |
ph10 |
407 |
ENDIF(WIN32) |
| 705 |
ph10 |
144 |
|
| 706 |
ph10 |
719 |
# Changed to accommodate testing whichever location was just built |
| 707 |
|
|
|
| 708 |
ph10 |
698 |
IF(PCRE_SUPPORT_JIT) |
| 709 |
zherczeg |
863 |
ADD_TEST(pcre_jit_test pcre_jit_test) |
| 710 |
ph10 |
698 |
ENDIF(PCRE_SUPPORT_JIT) |
| 711 |
ph10 |
667 |
|
| 712 |
ph10 |
719 |
IF(PCRE_BUILD_PCRECPP) |
| 713 |
|
|
ADD_TEST(pcrecpp_test pcrecpp_unittest) |
| 714 |
|
|
ADD_TEST(pcre_scanner_test pcre_scanner_unittest) |
| 715 |
|
|
ADD_TEST(pcre_stringpiece_test pcre_stringpiece_unittest) |
| 716 |
zherczeg |
863 |
ENDIF(PCRE_BUILD_PCRECPP) |
| 717 |
ph10 |
144 |
|
| 718 |
ph10 |
407 |
ENDIF(PCRE_BUILD_TESTS) |
| 719 |
|
|
|
| 720 |
ph10 |
137 |
# Installation |
| 721 |
|
|
SET(CMAKE_INSTALL_ALWAYS 1) |
| 722 |
|
|
|
| 723 |
ph10 |
407 |
INSTALL(TARGETS ${targets} |
| 724 |
ph10 |
137 |
RUNTIME DESTINATION bin |
| 725 |
|
|
LIBRARY DESTINATION lib |
| 726 |
|
|
ARCHIVE DESTINATION lib) |
| 727 |
|
|
|
| 728 |
|
|
INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include) |
| 729 |
|
|
|
| 730 |
ph10 |
405 |
FILE(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html) |
| 731 |
|
|
FILE(GLOB man1 ${PROJECT_SOURCE_DIR}/doc/*.1) |
| 732 |
|
|
FILE(GLOB man3 ${PROJECT_SOURCE_DIR}/doc/*.3) |
| 733 |
ph10 |
137 |
|
| 734 |
|
|
IF(PCRE_BUILD_PCRECPP) |
| 735 |
ph10 |
318 |
INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include) |
| 736 |
ph10 |
137 |
ELSE(PCRE_BUILD_PCRECPP) |
| 737 |
ph10 |
318 |
# Remove pcrecpp.3 |
| 738 |
|
|
FOREACH(man ${man3}) |
| 739 |
|
|
GET_FILENAME_COMPONENT(man_tmp ${man} NAME) |
| 740 |
|
|
IF(NOT man_tmp STREQUAL "pcrecpp.3") |
| 741 |
|
|
SET(man3_new ${man3} ${man}) |
| 742 |
|
|
ENDIF(NOT man_tmp STREQUAL "pcrecpp.3") |
| 743 |
|
|
ENDFOREACH(man ${man3}) |
| 744 |
|
|
SET(man3 ${man3_new}) |
| 745 |
ph10 |
137 |
ENDIF(PCRE_BUILD_PCRECPP) |
| 746 |
|
|
|
| 747 |
|
|
INSTALL(FILES ${man1} DESTINATION man/man1) |
| 748 |
|
|
INSTALL(FILES ${man3} DESTINATION man/man3) |
| 749 |
ph10 |
199 |
INSTALL(FILES ${html} DESTINATION share/doc/pcre/html) |
| 750 |
ph10 |
137 |
|
| 751 |
ph10 |
303 |
# help, only for nice output |
| 752 |
|
|
IF(BUILD_SHARED_LIBS) |
| 753 |
|
|
SET(BUILD_STATIC_LIBS OFF) |
| 754 |
|
|
ELSE(BUILD_SHARED_LIBS) |
| 755 |
|
|
SET(BUILD_STATIC_LIBS ON) |
| 756 |
|
|
ENDIF(BUILD_SHARED_LIBS) |
| 757 |
|
|
|
| 758 |
ph10 |
407 |
IF(PCRE_SHOW_REPORT) |
| 759 |
ph10 |
414 |
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) |
| 760 |
ph10 |
413 |
IF (CMAKE_C_FLAGS) |
| 761 |
|
|
SET(cfsp " ") |
| 762 |
ph10 |
416 |
ENDIF(CMAKE_C_FLAGS) |
| 763 |
ph10 |
413 |
IF (CMAKE_CXX_FLAGS) |
| 764 |
|
|
SET(cxxfsp " ") |
| 765 |
ph10 |
416 |
ENDIF(CMAKE_CXX_FLAGS) |
| 766 |
ph10 |
407 |
MESSAGE(STATUS "") |
| 767 |
|
|
MESSAGE(STATUS "") |
| 768 |
|
|
MESSAGE(STATUS "PCRE configuration summary:") |
| 769 |
|
|
MESSAGE(STATUS "") |
| 770 |
ph10 |
413 |
MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") |
| 771 |
|
|
MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") |
| 772 |
|
|
MESSAGE(STATUS " C++ compiler .................... : ${CMAKE_CXX_COMPILER}") |
| 773 |
|
|
MESSAGE(STATUS " C compiler flags ................ : ${CMAKE_C_FLAGS}${cfsp}${CMAKE_C_FLAGS_${buildtype}}") |
| 774 |
|
|
MESSAGE(STATUS " C++ compiler flags .............. : ${CMAKE_CXX_FLAGS}${cxxfsp}${CMAKE_CXX_FLAGS_${buildtype}}") |
| 775 |
ph10 |
407 |
MESSAGE(STATUS "") |
| 776 |
zherczeg |
863 |
MESSAGE(STATUS " Build 8 bit PCRE library ........ : ${PCRE_BUILD_PCRE8}") |
| 777 |
|
|
MESSAGE(STATUS " Build 16 bit PCRE library ....... : ${PCRE_BUILD_PCRE16}") |
| 778 |
ph10 |
413 |
MESSAGE(STATUS " Build C++ library ............... : ${PCRE_BUILD_PCRECPP}") |
| 779 |
ph10 |
667 |
MESSAGE(STATUS " Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}") |
| 780 |
zherczeg |
863 |
MESSAGE(STATUS " Enable UTF support .............. : ${PCRE_SUPPORT_UTF}") |
| 781 |
ph10 |
413 |
MESSAGE(STATUS " Unicode properties .............. : ${PCRE_SUPPORT_UNICODE_PROPERTIES}") |
| 782 |
|
|
MESSAGE(STATUS " Newline char/sequence ........... : ${PCRE_NEWLINE}") |
| 783 |
|
|
MESSAGE(STATUS " \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}") |
| 784 |
|
|
MESSAGE(STATUS " EBCDIC coding ................... : ${PCRE_EBCDIC}") |
| 785 |
|
|
MESSAGE(STATUS " Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}") |
| 786 |
|
|
MESSAGE(STATUS " No stack recursion .............. : ${PCRE_NO_RECURSE}") |
| 787 |
|
|
MESSAGE(STATUS " POSIX mem threshold ............. : ${PCRE_POSIX_MALLOC_THRESHOLD}") |
| 788 |
|
|
MESSAGE(STATUS " Internal link size .............. : ${PCRE_LINK_SIZE}") |
| 789 |
|
|
MESSAGE(STATUS " Match limit ..................... : ${PCRE_MATCH_LIMIT}") |
| 790 |
|
|
MESSAGE(STATUS " Match limit recursion ........... : ${PCRE_MATCH_LIMIT_RECURSION}") |
| 791 |
|
|
MESSAGE(STATUS " Build shared libs ............... : ${BUILD_SHARED_LIBS}") |
| 792 |
|
|
MESSAGE(STATUS " Build static libs ............... : ${BUILD_STATIC_LIBS}") |
| 793 |
|
|
MESSAGE(STATUS " Build pcregrep .................. : ${PCRE_BUILD_PCREGREP}") |
| 794 |
ph10 |
685 |
MESSAGE(STATUS " Enable JIT in pcregrep .......... : ${PCRE_SUPPORT_PCREGREP_JIT}") |
| 795 |
ph10 |
655 |
MESSAGE(STATUS " Buffer size for pcregrep ........ : ${PCREGREP_BUFSIZE}") |
| 796 |
ph10 |
719 |
MESSAGE(STATUS " Build tests (implies pcretest .. : ${PCRE_BUILD_TESTS}") |
| 797 |
|
|
MESSAGE(STATUS " and pcregrep)") |
| 798 |
ph10 |
407 |
IF(ZLIB_FOUND) |
| 799 |
ph10 |
413 |
MESSAGE(STATUS " Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}") |
| 800 |
ph10 |
407 |
ELSE(ZLIB_FOUND) |
| 801 |
|
|
MESSAGE(STATUS " Link pcregrep with libz ......... : None" ) |
| 802 |
|
|
ENDIF(ZLIB_FOUND) |
| 803 |
|
|
IF(BZIP2_FOUND) |
| 804 |
ph10 |
413 |
MESSAGE(STATUS " Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}") |
| 805 |
ph10 |
407 |
ELSE(BZIP2_FOUND) |
| 806 |
|
|
MESSAGE(STATUS " Link pcregrep with libbz2 ....... : None" ) |
| 807 |
|
|
ENDIF(BZIP2_FOUND) |
| 808 |
|
|
IF(NOT PCRE_SUPPORT_LIBREADLINE) |
| 809 |
|
|
MESSAGE(STATUS " Link pcretest with libreadline .. : None" ) |
| 810 |
|
|
ELSE(NOT PCRE_SUPPORT_LIBREADLINE) |
| 811 |
ph10 |
413 |
MESSAGE(STATUS " Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}") |
| 812 |
ph10 |
407 |
ENDIF(NOT PCRE_SUPPORT_LIBREADLINE) |
| 813 |
|
|
IF(MINGW AND NOT PCRE_STATIC) |
| 814 |
ph10 |
413 |
MESSAGE(STATUS " Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}") |
| 815 |
|
|
MESSAGE(STATUS " Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}") |
| 816 |
ph10 |
407 |
ENDIF(MINGW AND NOT PCRE_STATIC) |
| 817 |
|
|
MESSAGE(STATUS "") |
| 818 |
|
|
ENDIF(PCRE_SHOW_REPORT) |
| 819 |
ph10 |
303 |
|
| 820 |
ph10 |
137 |
# end CMakeLists.txt |