"Fossies" - the Fresh Open Source Software Archive

Member "pcre-8.43/CMakeLists.txt" (23 Jan 2017, 34139 Bytes) of package /linux/misc/pcre-8.43.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 8.40_vs_8.41.

    1 # CMakeLists.txt
    2 #
    3 #
    4 # 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 # 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 # 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 # 2008-01-20 Brought up to date to include several new features by Christian
   17 #            Ehrlicher.
   18 # 2008-01-22 Sheri added options for backward compatibility of library names
   19 #            when building with minGW:
   20 #            if "ON", NON_STANDARD_LIB_PREFIX causes shared libraries to
   21 #            be built without "lib" as prefix. (The libraries will be named
   22 #            pcre.dll, pcreposix.dll and pcrecpp.dll).
   23 #            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 # 2008-01-23 PH removed the automatic build of pcredemo.
   28 # 2008-04-22 PH modified READLINE support so it finds NCURSES when needed.
   29 # 2008-07-03 PH updated for revised UCP property support (change of files)
   30 # 2009-03-23 PH applied Steven Van Ingelgem's patch to change the name
   31 #            CMAKE_BINARY_DIR to PROJECT_BINARY_DIR so that it works when PCRE
   32 #            is included within another project.
   33 # 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 # 2009-04-11 PH applied Christian Ehrlicher's patch to show compiler flags that
   37 #            are set by specifying a release type.
   38 # 2010-01-02 PH added test for stdint.h
   39 # 2010-03-02 PH added test for inttypes.h
   40 # 2011-08-01 PH added PCREGREP_BUFSIZE
   41 # 2011-08-22 PH added PCRE_SUPPORT_JIT
   42 # 2011-09-06 PH modified WIN32 ADD_TEST line as suggested by Sergey Cherepanov
   43 # 2011-09-06 PH added PCRE_SUPPORT_PCREGREP_JIT
   44 # 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 # 2012-01-06 PH removed pcre_info.c and added pcre_string_utils.c
   55 # 2012-01-10 Zoltan Herczeg added libpcre16 support
   56 # 2012-01-13 Stephen Kelly added out of source build support
   57 # 2012-01-17 PH applied Stephen Kelly's patch to parse the version data out
   58 #            of the configure.ac file
   59 # 2012-02-26 PH added support for libedit
   60 # 2012-09-06 PH added support for PCRE_EBCDIC_NL25
   61 # 2012-09-08 ChPe added PCRE32 support
   62 # 2012-10-23 PH added support for VALGRIND and GCOV
   63 # 2012-12-08 PH added patch from Daniel Richard G to quash some MSVC warnings
   64 # 2013-07-01 PH realized that the "support" for GCOV was a total nonsense and
   65 #            so it has been removed.
   66 # 2013-10-08 PH got rid of the "source" command, which is a bash-ism (use ".")
   67 # 2013-11-05 PH added support for PARENS_NEST_LIMIT
   68 # 2016-03-01 PH applied Chris Wilson's patch for MSVC static build
   69 # 2016-06-24 PH applied Chris Wilson's revised patch (adds a separate option)
   70 
   71 PROJECT(PCRE C CXX)
   72 
   73 # Increased minimum to 2.8.0 to support newer add_test features. Set policy
   74 # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY.
   75 
   76 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
   77 CMAKE_POLICY(SET CMP0026 OLD)
   78 
   79 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
   80 
   81 # external packages
   82 FIND_PACKAGE( BZip2 )
   83 FIND_PACKAGE( ZLIB )
   84 FIND_PACKAGE( Readline )
   85 FIND_PACKAGE( Editline )
   86 
   87 # Configuration checks
   88 
   89 INCLUDE(CheckIncludeFile)
   90 INCLUDE(CheckIncludeFileCXX)
   91 INCLUDE(CheckFunctionExists)
   92 INCLUDE(CheckTypeSize)
   93 
   94 CHECK_INCLUDE_FILE(dirent.h     HAVE_DIRENT_H)
   95 CHECK_INCLUDE_FILE(stdint.h     HAVE_STDINT_H)
   96 CHECK_INCLUDE_FILE(inttypes.h   HAVE_INTTYPES_H)
   97 CHECK_INCLUDE_FILE(sys/stat.h   HAVE_SYS_STAT_H)
   98 CHECK_INCLUDE_FILE(sys/types.h  HAVE_SYS_TYPES_H)
   99 CHECK_INCLUDE_FILE(unistd.h     HAVE_UNISTD_H)
  100 CHECK_INCLUDE_FILE(windows.h    HAVE_WINDOWS_H)
  101 
  102 CHECK_INCLUDE_FILE_CXX(type_traits.h            HAVE_TYPE_TRAITS_H)
  103 CHECK_INCLUDE_FILE_CXX(bits/type_traits.h       HAVE_BITS_TYPE_TRAITS_H)
  104 
  105 CHECK_FUNCTION_EXISTS(bcopy     HAVE_BCOPY)
  106 CHECK_FUNCTION_EXISTS(memmove   HAVE_MEMMOVE)
  107 CHECK_FUNCTION_EXISTS(strerror  HAVE_STRERROR)
  108 CHECK_FUNCTION_EXISTS(strtoll   HAVE_STRTOLL)
  109 CHECK_FUNCTION_EXISTS(strtoq    HAVE_STRTOQ)
  110 CHECK_FUNCTION_EXISTS(_strtoi64 HAVE__STRTOI64)
  111 
  112 CHECK_TYPE_SIZE("long long"             LONG_LONG)
  113 CHECK_TYPE_SIZE("unsigned long long"    UNSIGNED_LONG_LONG)
  114 
  115 # User-configurable options
  116 #
  117 # (Note: CMakeSetup displays these in alphabetical order, regardless of
  118 # the order we use here)
  119 
  120 SET(BUILD_SHARED_LIBS OFF CACHE BOOL
  121     "Build shared libraries instead of static ones.")
  122 
  123 OPTION(PCRE_BUILD_PCRE8 "Build 8 bit PCRE library" ON)
  124 
  125 OPTION(PCRE_BUILD_PCRE16 "Build 16 bit PCRE library" OFF)
  126 
  127 OPTION(PCRE_BUILD_PCRE32 "Build 32 bit PCRE library" OFF)
  128 
  129 OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON)
  130 
  131 SET(PCRE_EBCDIC OFF CACHE BOOL
  132     "Use EBCDIC coding instead of ASCII. (This is rarely used outside of mainframe systems.)")
  133 
  134 SET(PCRE_EBCDIC_NL25 OFF CACHE BOOL
  135     "Use 0x25 as EBCDIC NL character instead of 0x15; implies EBCDIC.")
  136 
  137 SET(PCRE_LINK_SIZE "2" CACHE STRING
  138     "Internal link size (2, 3 or 4 allowed). See LINK_SIZE in config.h.in for details.")
  139 
  140 SET(PCRE_PARENS_NEST_LIMIT "250" CACHE STRING
  141     "Default nested parentheses limit. See PARENS_NEST_LIMIT in config.h.in for details.")
  142 
  143 SET(PCRE_MATCH_LIMIT "10000000" CACHE STRING
  144     "Default limit on internal looping. See MATCH_LIMIT in config.h.in for details.")
  145 
  146 SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" CACHE STRING
  147     "Default limit on internal recursion. See MATCH_LIMIT_RECURSION in config.h.in for details.")
  148 
  149 SET(PCREGREP_BUFSIZE "20480" CACHE STRING
  150     "Buffer size parameter for pcregrep. See PCREGREP_BUFSIZE in config.h.in for details.")
  151 
  152 SET(PCRE_NEWLINE "LF" CACHE STRING
  153     "What to recognize as a newline (one of CR, LF, CRLF, ANY, ANYCRLF).")
  154 
  155 SET(PCRE_NO_RECURSE OFF CACHE BOOL
  156     "If ON, then don't use stack recursion when matching. See NO_RECURSE in config.h.in for details.")
  157 
  158 SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING
  159     "Threshold for malloc() usage. See POSIX_MALLOC_THRESHOLD in config.h.in for details.")
  160 
  161 SET(PCRE_SUPPORT_JIT OFF CACHE BOOL
  162     "Enable support for Just-in-time compiling.")
  163 
  164 SET(PCRE_SUPPORT_PCREGREP_JIT ON CACHE BOOL
  165     "Enable use of Just-in-time compiling in pcregrep.")
  166 
  167 SET(PCRE_SUPPORT_UTF OFF CACHE BOOL
  168     "Enable support for Unicode Transformation Format (UTF-8/UTF-16/UTF-32) encoding.")
  169 
  170 SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL
  171     "Enable support for Unicode properties (if set, UTF support will be enabled as well).")
  172 
  173 SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL
  174     "ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks")
  175 
  176 SET(PCRE_SUPPORT_VALGRIND OFF CACHE BOOL
  177     "Enable Valgrind support.")
  178 
  179 OPTION(PCRE_SHOW_REPORT    "Show the final configuration report" ON)
  180 OPTION(PCRE_BUILD_PCREGREP "Build pcregrep" ON)
  181 OPTION(PCRE_BUILD_TESTS    "Build the tests" ON)
  182 
  183 IF (MINGW)
  184   OPTION(NON_STANDARD_LIB_PREFIX
  185          "ON=Shared libraries built in mingw will be named pcre.dll, etc., instead of libpcre.dll, etc."
  186          OFF)
  187 
  188   OPTION(NON_STANDARD_LIB_SUFFIX
  189          "ON=Shared libraries built in mingw will be named libpcre-0.dll, etc., instead of libpcre.dll, etc."
  190          OFF)
  191 ENDIF(MINGW)
  192 
  193 IF(MSVC)
  194   OPTION(PCRE_STATIC_RUNTIME
  195 	"ON=Compile against the static runtime (/MT)."
  196 	OFF)
  197   OPTION(INSTALL_MSVC_PDB
  198          "ON=Install .pdb files built by MSVC, if generated"
  199          OFF)
  200 ENDIF(MSVC)
  201 
  202 # bzip2 lib
  203 IF(BZIP2_FOUND)
  204   OPTION (PCRE_SUPPORT_LIBBZ2 "Enable support for linking pcregrep with libbz2." ON)
  205 ENDIF(BZIP2_FOUND)
  206 IF(PCRE_SUPPORT_LIBBZ2)
  207   INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR})
  208 ENDIF(PCRE_SUPPORT_LIBBZ2)
  209 
  210 # zlib
  211 IF(ZLIB_FOUND)
  212   OPTION (PCRE_SUPPORT_LIBZ "Enable support for linking pcregrep with libz." ON)
  213 ENDIF(ZLIB_FOUND)
  214 IF(PCRE_SUPPORT_LIBZ)
  215   INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
  216 ENDIF(PCRE_SUPPORT_LIBZ)
  217 
  218 # editline lib
  219 IF(EDITLINE_FOUND)
  220   OPTION (PCRE_SUPPORT_LIBEDIT  "Enable support for linking pcretest with libedit." OFF)
  221 ENDIF(EDITLINE_FOUND)
  222 IF(PCRE_SUPPORT_LIBEDIT)
  223   INCLUDE_DIRECTORIES(${EDITLINE_INCLUDE_DIR})
  224 ENDIF(PCRE_SUPPORT_LIBEDIT)
  225 
  226 # readline lib
  227 IF(READLINE_FOUND)
  228   OPTION (PCRE_SUPPORT_LIBREADLINE  "Enable support for linking pcretest with libreadline." ON)
  229 ENDIF(READLINE_FOUND)
  230 IF(PCRE_SUPPORT_LIBREADLINE)
  231   INCLUDE_DIRECTORIES(${READLINE_INCLUDE_DIR})
  232 ENDIF(PCRE_SUPPORT_LIBREADLINE)
  233 
  234 # Prepare build configuration
  235 
  236 SET(pcre_have_type_traits 0)
  237 SET(pcre_have_bits_type_traits 0)
  238 
  239 IF(HAVE_TYPE_TRAITS_H)
  240         SET(pcre_have_type_traits 1)
  241 ENDIF(HAVE_TYPE_TRAITS_H)
  242 
  243 IF(HAVE_BITS_TYPE_TRAITS_H)
  244         SET(pcre_have_bits_type_traits 1)
  245 ENDIF(HAVE_BITS_TYPE_TRAITS_H)
  246 
  247 SET(pcre_have_long_long 0)
  248 SET(pcre_have_ulong_long 0)
  249 
  250 IF(HAVE_LONG_LONG)
  251         SET(pcre_have_long_long 1)
  252 ENDIF(HAVE_LONG_LONG)
  253 
  254 IF(HAVE_UNSIGNED_LONG_LONG)
  255         SET(pcre_have_ulong_long 1)
  256 ENDIF(HAVE_UNSIGNED_LONG_LONG)
  257 
  258 IF(NOT BUILD_SHARED_LIBS)
  259         SET(PCRE_STATIC 1)
  260 ENDIF(NOT BUILD_SHARED_LIBS)
  261 
  262 IF(NOT PCRE_BUILD_PCRE8 AND NOT PCRE_BUILD_PCRE16 AND NOT PCRE_BUILD_PCRE32)
  263         MESSAGE(FATAL_ERROR "At least one of PCRE_BUILD_PCRE8, PCRE_BUILD_PCRE16 or PCRE_BUILD_PCRE32 must be enabled")
  264 ENDIF(NOT PCRE_BUILD_PCRE8 AND NOT PCRE_BUILD_PCRE16 AND NOT PCRE_BUILD_PCRE32)
  265 
  266 IF(PCRE_BUILD_PCRE8)
  267         SET(SUPPORT_PCRE8 1)
  268 ENDIF(PCRE_BUILD_PCRE8)
  269 
  270 IF(PCRE_BUILD_PCRE16)
  271         SET(SUPPORT_PCRE16 1)
  272 ENDIF(PCRE_BUILD_PCRE16)
  273 
  274 IF(PCRE_BUILD_PCRE32)
  275         SET(SUPPORT_PCRE32 1)
  276 ENDIF(PCRE_BUILD_PCRE32)
  277 
  278 IF(PCRE_BUILD_PCRECPP AND NOT PCRE_BUILD_PCRE8)
  279         MESSAGE(STATUS "** PCRE_BUILD_PCRE8 must be enabled for the C++ library support")
  280         SET(PCRE_BUILD_PCRECPP OFF)
  281 ENDIF(PCRE_BUILD_PCRECPP AND NOT PCRE_BUILD_PCRE8)
  282 
  283 IF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUILD_PCRE8)
  284         MESSAGE(STATUS "** PCRE_BUILD_PCRE8 must be enabled for the pcregrep program")
  285         SET(PCRE_BUILD_PCREGREP OFF)
  286 ENDIF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUILD_PCRE8)
  287 
  288 IF(PCRE_SUPPORT_LIBREADLINE AND PCRE_SUPPORT_LIBEDIT)
  289         MESSAGE(FATAL_ERROR "Only one of libreadline or libeditline can be specified")
  290 ENDIF(PCRE_SUPPORT_LIBREADLINE AND PCRE_SUPPORT_LIBEDIT)
  291 
  292 IF(PCRE_SUPPORT_BSR_ANYCRLF)
  293         SET(BSR_ANYCRLF 1)
  294 ENDIF(PCRE_SUPPORT_BSR_ANYCRLF)
  295 
  296 IF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UNICODE_PROPERTIES)
  297         SET(SUPPORT_UTF 1)
  298         SET(PCRE_SUPPORT_UTF ON)
  299 ENDIF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UNICODE_PROPERTIES)
  300 
  301 IF(PCRE_SUPPORT_UNICODE_PROPERTIES)
  302         SET(SUPPORT_UCP 1)
  303 ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)
  304 
  305 IF(PCRE_SUPPORT_JIT)
  306         SET(SUPPORT_JIT 1)
  307 ENDIF(PCRE_SUPPORT_JIT)
  308 
  309 IF(PCRE_SUPPORT_PCREGREP_JIT)
  310         SET(SUPPORT_PCREGREP_JIT 1)
  311 ENDIF(PCRE_SUPPORT_PCREGREP_JIT)
  312 
  313 IF(PCRE_SUPPORT_VALGRIND)
  314         SET(SUPPORT_VALGRIND 1)
  315 ENDIF(PCRE_SUPPORT_VALGRIND)
  316 
  317 # This next one used to contain
  318 #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})
  319 # but I was advised to add the NCURSES test as well, along with
  320 # some modifications to cmake/FindReadline.cmake which should
  321 # make it possible to override the default if necessary. PH
  322 
  323 IF(PCRE_SUPPORT_LIBREADLINE)
  324         SET(SUPPORT_LIBREADLINE 1)
  325         SET(PCRETEST_LIBS ${READLINE_LIBRARY} ${NCURSES_LIBRARY})
  326 ENDIF(PCRE_SUPPORT_LIBREADLINE)
  327 
  328 # libedit is a plug-compatible alternative to libreadline
  329 
  330 IF(PCRE_SUPPORT_LIBEDIT)
  331         SET(SUPPORT_LIBEDIT 1)
  332         SET(PCRETEST_LIBS ${EDITLINE_LIBRARY} ${NCURSES_LIBRARY})
  333 ENDIF(PCRE_SUPPORT_LIBEDIT)
  334 
  335 IF(PCRE_SUPPORT_LIBZ)
  336         SET(SUPPORT_LIBZ 1)
  337         SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${ZLIB_LIBRARIES})
  338 ENDIF(PCRE_SUPPORT_LIBZ)
  339 
  340 IF(PCRE_SUPPORT_LIBBZ2)
  341         SET(SUPPORT_LIBBZ2 1)
  342         SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${BZIP2_LIBRARIES})
  343 ENDIF(PCRE_SUPPORT_LIBBZ2)
  344 
  345 SET(NEWLINE "")
  346 
  347 IF(PCRE_NEWLINE STREQUAL "LF")
  348         SET(NEWLINE "10")
  349 ENDIF(PCRE_NEWLINE STREQUAL "LF")
  350 IF(PCRE_NEWLINE STREQUAL "CR")
  351         SET(NEWLINE "13")
  352 ENDIF(PCRE_NEWLINE STREQUAL "CR")
  353 IF(PCRE_NEWLINE STREQUAL "CRLF")
  354         SET(NEWLINE "3338")
  355 ENDIF(PCRE_NEWLINE STREQUAL "CRLF")
  356 IF(PCRE_NEWLINE STREQUAL "ANY")
  357         SET(NEWLINE "-1")
  358 ENDIF(PCRE_NEWLINE STREQUAL "ANY")
  359 IF(PCRE_NEWLINE STREQUAL "ANYCRLF")
  360         SET(NEWLINE "-2")
  361 ENDIF(PCRE_NEWLINE STREQUAL "ANYCRLF")
  362 
  363 IF(NEWLINE STREQUAL "")
  364         MESSAGE(FATAL_ERROR "The PCRE_NEWLINE variable must be set to one of the following values: \"LF\", \"CR\", \"CRLF\", \"ANY\", \"ANYCRLF\".")
  365 ENDIF(NEWLINE STREQUAL "")
  366 
  367 IF(PCRE_EBCDIC)
  368         SET(EBCDIC 1)
  369 IF(PCRE_NEWLINE STREQUAL "LF")
  370         SET(NEWLINE "21")
  371 ENDIF(PCRE_NEWLINE STREQUAL "LF")
  372 IF(PCRE_NEWLINE STREQUAL "CRLF")
  373         SET(NEWLINE "3349")
  374 ENDIF(PCRE_NEWLINE STREQUAL "CRLF")
  375 ENDIF(PCRE_EBCDIC)
  376 
  377 IF(PCRE_EBCDIC_NL25)
  378         SET(EBCDIC 1)
  379         SET(EBCDIC_NL25 1)
  380 IF(PCRE_NEWLINE STREQUAL "LF")
  381         SET(NEWLINE "37")
  382 ENDIF(PCRE_NEWLINE STREQUAL "LF")
  383 IF(PCRE_NEWLINE STREQUAL "CRLF")
  384         SET(NEWLINE "3365")
  385 ENDIF(PCRE_NEWLINE STREQUAL "CRLF")
  386 ENDIF(PCRE_EBCDIC_NL25)
  387 
  388 IF(PCRE_NO_RECURSE)
  389         SET(NO_RECURSE 1)
  390 ENDIF(PCRE_NO_RECURSE)
  391 
  392 # Output files
  393 CONFIGURE_FILE(config-cmake.h.in
  394                ${PROJECT_BINARY_DIR}/config.h
  395                @ONLY)
  396 
  397 # Parse version numbers and date out of configure.ac
  398 
  399 file(STRINGS ${PROJECT_SOURCE_DIR}/configure.ac
  400   configure_lines
  401   LIMIT_COUNT 50 # Read only the first 50 lines of the file
  402 )
  403 
  404 set(SEARCHED_VARIABLES "pcre_major" "pcre_minor" "pcre_prerelease" "pcre_date")
  405 foreach(configure_line ${configure_lines})
  406     foreach(_substitution_variable ${SEARCHED_VARIABLES})
  407         string(TOUPPER ${_substitution_variable} _substitution_variable_upper)
  408         if (NOT ${_substitution_variable_upper})
  409             string(REGEX MATCH "m4_define\\(${_substitution_variable}, \\[(.*)\\]" MACTHED_STRING ${configure_line})
  410             if (CMAKE_MATCH_1)
  411                 set(${_substitution_variable_upper} ${CMAKE_MATCH_1})
  412             endif()
  413         endif()
  414     endforeach()
  415 endforeach()
  416 
  417 CONFIGURE_FILE(pcre.h.in
  418                ${PROJECT_BINARY_DIR}/pcre.h
  419                @ONLY)
  420 
  421 # What about pcre-config and libpcre.pc?
  422 
  423 IF(PCRE_BUILD_PCRECPP)
  424         CONFIGURE_FILE(pcre_stringpiece.h.in
  425                        ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
  426                        @ONLY)
  427 
  428         CONFIGURE_FILE(pcrecpparg.h.in
  429                        ${PROJECT_BINARY_DIR}/pcrecpparg.h
  430                        @ONLY)
  431 ENDIF(PCRE_BUILD_PCRECPP)
  432 
  433 # Character table generation
  434 
  435 OPTION(PCRE_REBUILD_CHARTABLES "Rebuild char tables" OFF)
  436 IF(PCRE_REBUILD_CHARTABLES)
  437   ADD_EXECUTABLE(dftables dftables.c)
  438 
  439   GET_TARGET_PROPERTY(DFTABLES_EXE dftables LOCATION)
  440 
  441   ADD_CUSTOM_COMMAND(
  442     COMMENT "Generating character tables (pcre_chartables.c) for current locale"
  443     DEPENDS dftables
  444     COMMAND ${DFTABLES_EXE}
  445     ARGS        ${PROJECT_BINARY_DIR}/pcre_chartables.c
  446     OUTPUT      ${PROJECT_BINARY_DIR}/pcre_chartables.c
  447   )
  448 ELSE(PCRE_REBUILD_CHARTABLES)
  449   CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/pcre_chartables.c.dist
  450                     ${PROJECT_BINARY_DIR}/pcre_chartables.c
  451                     COPYONLY)
  452 ENDIF(PCRE_REBUILD_CHARTABLES)
  453 
  454 # Source code
  455 
  456 SET(PCRE_HEADERS ${PROJECT_BINARY_DIR}/pcre.h)
  457 
  458 IF(PCRE_BUILD_PCRE8)
  459 SET(PCRE_SOURCES
  460   pcre_byte_order.c
  461   pcre_chartables.c
  462   pcre_compile.c
  463   pcre_config.c
  464   pcre_dfa_exec.c
  465   pcre_exec.c
  466   pcre_fullinfo.c
  467   pcre_get.c
  468   pcre_globals.c
  469   pcre_jit_compile.c
  470   pcre_maketables.c
  471   pcre_newline.c
  472   pcre_ord2utf8.c
  473   pcre_refcount.c
  474   pcre_string_utils.c
  475   pcre_study.c
  476   pcre_tables.c
  477   pcre_ucd.c
  478   pcre_valid_utf8.c
  479   pcre_version.c
  480   pcre_xclass.c
  481 )
  482 
  483 SET(PCREPOSIX_HEADERS pcreposix.h)
  484 
  485 SET(PCREPOSIX_SOURCES pcreposix.c)
  486 
  487 ENDIF(PCRE_BUILD_PCRE8)
  488 
  489 IF(PCRE_BUILD_PCRE16)
  490 SET(PCRE16_SOURCES
  491   pcre16_byte_order.c
  492   pcre16_chartables.c
  493   pcre16_compile.c
  494   pcre16_config.c
  495   pcre16_dfa_exec.c
  496   pcre16_exec.c
  497   pcre16_fullinfo.c
  498   pcre16_get.c
  499   pcre16_globals.c
  500   pcre16_jit_compile.c
  501   pcre16_maketables.c
  502   pcre16_newline.c
  503   pcre16_ord2utf16.c
  504   pcre16_refcount.c
  505   pcre16_string_utils.c
  506   pcre16_study.c
  507   pcre16_tables.c
  508   pcre16_ucd.c
  509   pcre16_utf16_utils.c
  510   pcre16_valid_utf16.c
  511   pcre16_version.c
  512   pcre16_xclass.c
  513 )
  514 ENDIF(PCRE_BUILD_PCRE16)
  515 
  516 IF(PCRE_BUILD_PCRE32)
  517 SET(PCRE32_SOURCES
  518   pcre32_byte_order.c
  519   pcre32_chartables.c
  520   pcre32_compile.c
  521   pcre32_config.c
  522   pcre32_dfa_exec.c
  523   pcre32_exec.c
  524   pcre32_fullinfo.c
  525   pcre32_get.c
  526   pcre32_globals.c
  527   pcre32_jit_compile.c
  528   pcre32_maketables.c
  529   pcre32_newline.c
  530   pcre32_ord2utf32.c
  531   pcre32_refcount.c
  532   pcre32_string_utils.c
  533   pcre32_study.c
  534   pcre32_tables.c
  535   pcre32_ucd.c
  536   pcre32_utf32_utils.c
  537   pcre32_valid_utf32.c
  538   pcre32_version.c
  539   pcre32_xclass.c
  540 )
  541 ENDIF(PCRE_BUILD_PCRE32)
  542 
  543 IF(MINGW AND NOT PCRE_STATIC)
  544 IF (EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc)
  545 ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/pcre.o
  546 PRE-LINK
  547 COMMAND windres ARGS pcre.rc pcre.o
  548 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
  549 COMMENT Using pcre coff info in mingw build)
  550 SET(PCRE_SOURCES
  551   ${PCRE_SOURCES} ${PROJECT_SOURCE_DIR}/pcre.o
  552 )
  553 ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc)
  554 IF (EXISTS ${PROJECT_SOURCE_DIR}/pcreposix.rc)
  555 ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/pcreposix.o
  556 PRE-LINK
  557 COMMAND windres ARGS pcreposix.rc pcreposix.o
  558 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
  559 COMMENT Using pcreposix coff info in mingw build)
  560 SET(PCREPOSIX_SOURCES
  561   ${PCREPOSIX_SOURCES} ${PROJECT_SOURCE_DIR}/pcreposix.o
  562 )
  563 ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/pcreposix.rc)
  564 ENDIF(MINGW AND NOT PCRE_STATIC)
  565 
  566 IF(MSVC AND NOT PCRE_STATIC)
  567 IF (EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc)
  568 SET(PCRE_SOURCES
  569   ${PCRE_SOURCES} pcre.rc)
  570 ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc)
  571 IF (EXISTS ${PROJECT_SOURCE_DIR}/pcreposix.rc)
  572 SET(PCREPOSIX_SOURCES
  573   ${PCREPOSIX_SOURCES} pcreposix.rc)
  574 ENDIF (EXISTS ${PROJECT_SOURCE_DIR}/pcreposix.rc)
  575 ENDIF(MSVC AND NOT PCRE_STATIC)
  576 
  577 # Fix static compilation with MSVC: https://bugs.exim.org/show_bug.cgi?id=1681
  578 # This code was taken from the CMake wiki, not from WebM.
  579 
  580 IF(MSVC AND PCRE_STATIC_RUNTIME)
  581   MESSAGE(STATUS "** MSVC and PCRE_STATIC_RUNTIME: modifying compiler flags to use static runtime library")
  582   foreach(flag_var
  583           CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
  584           CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
  585           CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
  586           CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
  587     string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
  588   endforeach()
  589 ENDIF(MSVC AND PCRE_STATIC_RUNTIME)
  590 
  591 SET(PCRECPP_HEADERS
  592   pcrecpp.h
  593   pcre_scanner.h
  594   ${PROJECT_BINARY_DIR}/pcrecpparg.h
  595   ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
  596 )
  597 
  598 SET(PCRECPP_SOURCES
  599         pcrecpp.cc
  600         pcre_scanner.cc
  601         pcre_stringpiece.cc
  602 )
  603 
  604 # Build setup
  605 
  606 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
  607 
  608 IF(MSVC)
  609         ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
  610 ENDIF(MSVC)
  611 
  612 SET(CMAKE_INCLUDE_CURRENT_DIR 1)
  613 # needed to make sure to not link debug libs
  614 # against release libs and vice versa
  615 IF(WIN32)
  616   SET(CMAKE_DEBUG_POSTFIX "d")
  617 ENDIF(WIN32)
  618 
  619 SET(targets)
  620 
  621 # Libraries
  622 # pcre
  623 IF(PCRE_BUILD_PCRE8)
  624 ADD_LIBRARY(pcre ${PCRE_HEADERS} ${PCRE_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
  625 SET(targets ${targets} pcre)
  626 ADD_LIBRARY(pcreposix ${PCREPOSIX_HEADERS} ${PCREPOSIX_SOURCES})
  627 SET(targets ${targets} pcreposix)
  628 TARGET_LINK_LIBRARIES(pcreposix pcre)
  629 
  630 IF(MINGW AND NOT PCRE_STATIC)
  631   IF(NON_STANDARD_LIB_PREFIX)
  632     SET_TARGET_PROPERTIES(pcre pcreposix
  633                         PROPERTIES PREFIX ""
  634     )
  635   ENDIF(NON_STANDARD_LIB_PREFIX)
  636 
  637   IF(NON_STANDARD_LIB_SUFFIX)
  638     SET_TARGET_PROPERTIES(pcre pcreposix
  639                         PROPERTIES SUFFIX "-0.dll"
  640     )
  641   ENDIF(NON_STANDARD_LIB_SUFFIX)
  642 ENDIF(MINGW AND NOT PCRE_STATIC)
  643 
  644 ENDIF(PCRE_BUILD_PCRE8)
  645 
  646 IF(PCRE_BUILD_PCRE16)
  647 ADD_LIBRARY(pcre16 ${PCRE_HEADERS} ${PCRE16_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
  648 SET(targets ${targets} pcre16)
  649 
  650 IF(MINGW AND NOT PCRE_STATIC)
  651   IF(NON_STANDARD_LIB_PREFIX)
  652     SET_TARGET_PROPERTIES(pcre16
  653                         PROPERTIES PREFIX ""
  654     )
  655   ENDIF(NON_STANDARD_LIB_PREFIX)
  656 
  657   IF(NON_STANDARD_LIB_SUFFIX)
  658     SET_TARGET_PROPERTIES(pcre16
  659                         PROPERTIES SUFFIX "-0.dll"
  660     )
  661   ENDIF(NON_STANDARD_LIB_SUFFIX)
  662 ENDIF(MINGW AND NOT PCRE_STATIC)
  663 
  664 ENDIF(PCRE_BUILD_PCRE16)
  665 
  666 IF(PCRE_BUILD_PCRE32)
  667 ADD_LIBRARY(pcre32 ${PCRE_HEADERS} ${PCRE32_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
  668 SET(targets ${targets} pcre32)
  669 
  670 IF(MINGW AND NOT PCRE_STATIC)
  671   IF(NON_STANDARD_LIB_PREFIX)
  672     SET_TARGET_PROPERTIES(pcre32
  673                         PROPERTIES PREFIX ""
  674     )
  675   ENDIF(NON_STANDARD_LIB_PREFIX)
  676 
  677   IF(NON_STANDARD_LIB_SUFFIX)
  678     SET_TARGET_PROPERTIES(pcre32
  679                         PROPERTIES SUFFIX "-0.dll"
  680     )
  681   ENDIF(NON_STANDARD_LIB_SUFFIX)
  682 ENDIF(MINGW AND NOT PCRE_STATIC)
  683 
  684 ENDIF(PCRE_BUILD_PCRE32)
  685 
  686 # pcrecpp
  687 IF(PCRE_BUILD_PCRECPP)
  688 ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})
  689 SET(targets ${targets} pcrecpp)
  690 TARGET_LINK_LIBRARIES(pcrecpp pcre)
  691 
  692   IF(MINGW AND NOT PCRE_STATIC)
  693     IF(NON_STANDARD_LIB_PREFIX)
  694       SET_TARGET_PROPERTIES(pcrecpp
  695                             PROPERTIES PREFIX ""
  696       )
  697     ENDIF(NON_STANDARD_LIB_PREFIX)
  698 
  699     IF(NON_STANDARD_LIB_SUFFIX)
  700       SET_TARGET_PROPERTIES(pcrecpp
  701                           PROPERTIES SUFFIX "-0.dll"
  702       )
  703     ENDIF(NON_STANDARD_LIB_SUFFIX)
  704   ENDIF(MINGW AND NOT PCRE_STATIC)
  705 ENDIF(PCRE_BUILD_PCRECPP)
  706 
  707 
  708 # Executables
  709 
  710 # Removed by PH (2008-01-23) because pcredemo shouldn't really be built
  711 # automatically, and it gave trouble in some environments anyway.
  712 # ADD_EXECUTABLE(pcredemo pcredemo.c)
  713 # TARGET_LINK_LIBRARIES(pcredemo pcreposix)
  714 # IF(NOT BUILD_SHARED_LIBS)
  715 #     # make sure to not use declspec(dllimport) in static mode on windows
  716 #         SET_TARGET_PROPERTIES(pcredemo PROPERTIES COMPILE_FLAGS "-DPCRE_STATIC")
  717 # ENDIF(NOT BUILD_SHARED_LIBS)
  718 
  719 IF(PCRE_BUILD_PCREGREP)
  720   ADD_EXECUTABLE(pcregrep pcregrep.c)
  721   SET(targets ${targets} pcregrep)
  722   TARGET_LINK_LIBRARIES(pcregrep pcreposix ${PCREGREP_LIBS})
  723 ENDIF(PCRE_BUILD_PCREGREP)
  724 
  725 # Testing
  726 IF(PCRE_BUILD_TESTS)
  727   ENABLE_TESTING()
  728 
  729   SET(PCRETEST_SOURCES pcretest.c)
  730   IF(PCRE_BUILD_PCRE8)
  731     LIST(APPEND PCRETEST_SOURCES pcre_printint.c)
  732   ENDIF(PCRE_BUILD_PCRE8)
  733   IF(PCRE_BUILD_PCRE16)
  734     LIST(APPEND PCRETEST_SOURCES pcre16_printint.c)
  735   ENDIF(PCRE_BUILD_PCRE16)
  736   IF(PCRE_BUILD_PCRE32)
  737     LIST(APPEND PCRETEST_SOURCES pcre32_printint.c)
  738   ENDIF(PCRE_BUILD_PCRE32)
  739 
  740   ADD_EXECUTABLE(pcretest ${PCRETEST_SOURCES})
  741   SET(targets ${targets} pcretest)
  742   IF(PCRE_BUILD_PCRE8)
  743     LIST(APPEND PCRETEST_LIBS pcreposix pcre)
  744   ENDIF(PCRE_BUILD_PCRE8)
  745   IF(PCRE_BUILD_PCRE16)
  746     LIST(APPEND PCRETEST_LIBS pcre16)
  747   ENDIF(PCRE_BUILD_PCRE16)
  748   IF(PCRE_BUILD_PCRE32)
  749     LIST(APPEND PCRETEST_LIBS pcre32)
  750   ENDIF(PCRE_BUILD_PCRE32)
  751   TARGET_LINK_LIBRARIES(pcretest ${PCRETEST_LIBS})
  752 
  753   IF(PCRE_SUPPORT_JIT)
  754     ADD_EXECUTABLE(pcre_jit_test pcre_jit_test.c)
  755     SET(targets ${targets} pcre_jit_test)
  756     SET(PCRE_JIT_TEST_LIBS )
  757     IF(PCRE_BUILD_PCRE8)
  758       LIST(APPEND PCRE_JIT_TEST_LIBS pcre)
  759     ENDIF(PCRE_BUILD_PCRE8)
  760     IF(PCRE_BUILD_PCRE16)
  761       LIST(APPEND PCRE_JIT_TEST_LIBS pcre16)
  762     ENDIF(PCRE_BUILD_PCRE16)
  763     IF(PCRE_BUILD_PCRE32)
  764       LIST(APPEND PCRE_JIT_TEST_LIBS pcre32)
  765     ENDIF(PCRE_BUILD_PCRE32)
  766     TARGET_LINK_LIBRARIES(pcre_jit_test ${PCRE_JIT_TEST_LIBS})
  767   ENDIF(PCRE_SUPPORT_JIT)
  768 
  769   IF(PCRE_BUILD_PCRECPP)
  770     ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)
  771     SET(targets ${targets} pcrecpp_unittest)
  772     TARGET_LINK_LIBRARIES(pcrecpp_unittest pcrecpp)
  773     IF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)
  774       SET_TARGET_PROPERTIES(pcrecpp
  775                         PROPERTIES PREFIX ""
  776       )
  777     ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)
  778 
  779     ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)
  780     SET(targets ${targets} pcre_scanner_unittest)
  781     TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)
  782 
  783     ADD_EXECUTABLE(pcre_stringpiece_unittest pcre_stringpiece_unittest.cc)
  784     SET(targets ${targets} pcre_stringpiece_unittest)
  785     TARGET_LINK_LIBRARIES(pcre_stringpiece_unittest pcrecpp)
  786   ENDIF(PCRE_BUILD_PCRECPP)
  787 
  788   # exes in Debug location tested by the RunTest shell script
  789   # via "make test"
  790   IF(PCRE_BUILD_PCREGREP)
  791     GET_TARGET_PROPERTY(PCREGREP_EXE pcregrep DEBUG_LOCATION)
  792   ENDIF(PCRE_BUILD_PCREGREP)
  793 
  794   GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION)
  795 
  796 # =================================================
  797   # Write out a CTest configuration file
  798   #
  799   FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest
  800   "# This is a generated file.
  801 MESSAGE(\"When testing is complete, review test output in the
  802 \\\"${PROJECT_BINARY_DIR}/Testing/Temporary\\\" folder.\")
  803 MESSAGE(\" \")
  804 ")
  805 
  806   FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.sh
  807   "#! /bin/sh
  808 # This is a generated file.
  809 srcdir=${PROJECT_SOURCE_DIR}
  810 pcretest=${PCRETEST_EXE}
  811 . ${PROJECT_SOURCE_DIR}/RunTest
  812 if test \"$?\" != \"0\"; then exit 1; fi
  813 # End
  814 ")
  815 
  816   IF(UNIX)
  817     ADD_TEST(pcre_test      sh ${PROJECT_BINARY_DIR}/pcre_test.sh)
  818   ENDIF(UNIX)
  819 
  820   IF(PCRE_BUILD_PCREGREP)
  821     FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_grep_test.sh
  822     "#! /bin/sh
  823 # This is a generated file.
  824 srcdir=${PROJECT_SOURCE_DIR}
  825 pcregrep=${PCREGREP_EXE}
  826 pcretest=${PCRETEST_EXE}
  827 . ${PROJECT_SOURCE_DIR}/RunGrepTest
  828 if test \"$?\" != \"0\"; then exit 1; fi
  829 # End
  830 ")
  831 
  832     IF(UNIX)
  833       ADD_TEST(pcre_grep_test sh ${PROJECT_BINARY_DIR}/pcre_grep_test.sh)
  834     ENDIF(UNIX)
  835   ENDIF(PCRE_BUILD_PCREGREP)
  836 
  837   IF(WIN32)
  838     # Provide environment for executing the bat file version of RunTest
  839     FILE(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} winsrc)
  840     FILE(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} winbin)
  841     FILE(TO_NATIVE_PATH ${PCRETEST_EXE} winexe)
  842 
  843     FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.bat
  844     "\@REM This is a generated file.
  845 \@echo off
  846 setlocal
  847 SET srcdir=\"${winsrc}\"
  848 SET pcretest=\"${winexe}\"
  849 if not [%CMAKE_CONFIG_TYPE%]==[] SET pcretest=\"${winbin}\\%CMAKE_CONFIG_TYPE%\\pcretest.exe\"
  850 call %srcdir%\\RunTest.Bat
  851 if errorlevel 1 exit /b 1
  852 echo RunTest.bat tests successfully completed
  853 ")
  854 
  855   ADD_TEST(NAME pcre_test_bat
  856   COMMAND pcre_test.bat)
  857   SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES
  858   PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed")
  859 
  860     IF("$ENV{OSTYPE}" STREQUAL "msys")
  861       # Both the sh and bat file versions of RunTest are run if make test is used
  862       # in msys
  863       ADD_TEST(pcre_test_sh    sh.exe ${PROJECT_BINARY_DIR}/pcre_test.sh)
  864       IF(PCRE_BUILD_PCREGREP)
  865         ADD_TEST(pcre_grep_test  sh.exe ${PROJECT_BINARY_DIR}/pcre_grep_test.sh)
  866       ENDIF(PCRE_BUILD_PCREGREP)
  867     ENDIF("$ENV{OSTYPE}" STREQUAL "msys")
  868 
  869   ENDIF(WIN32)
  870 
  871   # Changed to accommodate testing whichever location was just built
  872 
  873   IF(PCRE_SUPPORT_JIT)
  874     ADD_TEST(pcre_jit_test         pcre_jit_test)
  875   ENDIF(PCRE_SUPPORT_JIT)
  876 
  877   IF(PCRE_BUILD_PCRECPP)
  878     ADD_TEST(pcrecpp_test          pcrecpp_unittest)
  879     ADD_TEST(pcre_scanner_test     pcre_scanner_unittest)
  880     ADD_TEST(pcre_stringpiece_test pcre_stringpiece_unittest)
  881   ENDIF(PCRE_BUILD_PCRECPP)
  882 
  883 ENDIF(PCRE_BUILD_TESTS)
  884 
  885 # Installation
  886 SET(CMAKE_INSTALL_ALWAYS 1)
  887 
  888 INSTALL(TARGETS ${targets}
  889         RUNTIME DESTINATION bin
  890         LIBRARY DESTINATION lib
  891         ARCHIVE DESTINATION lib)
  892 
  893 INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)
  894 
  895 FILE(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html)
  896 FILE(GLOB man1 ${PROJECT_SOURCE_DIR}/doc/*.1)
  897 FILE(GLOB man3 ${PROJECT_SOURCE_DIR}/doc/*.3)
  898 
  899 IF(PCRE_BUILD_PCRECPP)
  900         INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include)
  901 ELSE(PCRE_BUILD_PCRECPP)
  902         # Remove pcrecpp.3
  903         FOREACH(man ${man3})
  904                 GET_FILENAME_COMPONENT(man_tmp ${man} NAME)
  905                 IF(NOT man_tmp STREQUAL "pcrecpp.3")
  906                         SET(man3_new ${man3} ${man})
  907                 ENDIF(NOT man_tmp STREQUAL "pcrecpp.3")
  908         ENDFOREACH(man ${man3})
  909         SET(man3 ${man3_new})
  910 ENDIF(PCRE_BUILD_PCRECPP)
  911 
  912 INSTALL(FILES ${man1} DESTINATION man/man1)
  913 INSTALL(FILES ${man3} DESTINATION man/man3)
  914 INSTALL(FILES ${html} DESTINATION share/doc/pcre/html)
  915 
  916 IF(MSVC AND INSTALL_MSVC_PDB)
  917     INSTALL(FILES ${PROJECT_BINARY_DIR}/pcre.pdb
  918                   ${PROJECT_BINARY_DIR}/pcreposix.pdb
  919             DESTINATION bin
  920             CONFIGURATIONS RelWithDebInfo)
  921     INSTALL(FILES ${PROJECT_BINARY_DIR}/pcred.pdb
  922                   ${PROJECT_BINARY_DIR}/pcreposixd.pdb
  923             DESTINATION bin
  924             CONFIGURATIONS Debug)
  925 ENDIF(MSVC AND INSTALL_MSVC_PDB)
  926 
  927 # help, only for nice output
  928 IF(BUILD_SHARED_LIBS)
  929   SET(BUILD_STATIC_LIBS OFF)
  930 ELSE(BUILD_SHARED_LIBS)
  931   SET(BUILD_STATIC_LIBS ON)
  932 ENDIF(BUILD_SHARED_LIBS)
  933 
  934 IF(PCRE_SHOW_REPORT)
  935   STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
  936   IF (CMAKE_C_FLAGS)
  937     SET(cfsp " ")
  938   ENDIF(CMAKE_C_FLAGS)
  939   IF (CMAKE_CXX_FLAGS)
  940     SET(cxxfsp " ")
  941   ENDIF(CMAKE_CXX_FLAGS)
  942   MESSAGE(STATUS "")
  943   MESSAGE(STATUS "")
  944   MESSAGE(STATUS "PCRE configuration summary:")
  945   MESSAGE(STATUS "")
  946   MESSAGE(STATUS "  Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
  947   MESSAGE(STATUS "  C compiler ...................... : ${CMAKE_C_COMPILER}")
  948   MESSAGE(STATUS "  C++ compiler .................... : ${CMAKE_CXX_COMPILER}")
  949   MESSAGE(STATUS "  C compiler flags ................ : ${CMAKE_C_FLAGS}${cfsp}${CMAKE_C_FLAGS_${buildtype}}")
  950   MESSAGE(STATUS "  C++ compiler flags .............. : ${CMAKE_CXX_FLAGS}${cxxfsp}${CMAKE_CXX_FLAGS_${buildtype}}")
  951   MESSAGE(STATUS "")
  952   MESSAGE(STATUS "  Build 8 bit PCRE library ........ : ${PCRE_BUILD_PCRE8}")
  953   MESSAGE(STATUS "  Build 16 bit PCRE library ....... : ${PCRE_BUILD_PCRE16}")
  954   MESSAGE(STATUS "  Build 32 bit PCRE library ....... : ${PCRE_BUILD_PCRE32}")
  955   MESSAGE(STATUS "  Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")
  956   MESSAGE(STATUS "  Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}")
  957   MESSAGE(STATUS "  Enable UTF support .............. : ${PCRE_SUPPORT_UTF}")
  958   MESSAGE(STATUS "  Unicode properties .............. : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
  959   MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE_NEWLINE}")
  960   MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")
  961   MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE_EBCDIC}")
  962   MESSAGE(STATUS "  EBCDIC coding with NL=0x25 ...... : ${PCRE_EBCDIC_NL25}")
  963   MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")
  964   MESSAGE(STATUS "  No stack recursion .............. : ${PCRE_NO_RECURSE}")
  965   MESSAGE(STATUS "  POSIX mem threshold ............. : ${PCRE_POSIX_MALLOC_THRESHOLD}")
  966   MESSAGE(STATUS "  Internal link size .............. : ${PCRE_LINK_SIZE}")
  967   MESSAGE(STATUS "  Parentheses nest limit .......... : ${PCRE_PARENS_NEST_LIMIT}")
  968   MESSAGE(STATUS "  Match limit ..................... : ${PCRE_MATCH_LIMIT}")
  969   MESSAGE(STATUS "  Match limit recursion ........... : ${PCRE_MATCH_LIMIT_RECURSION}")
  970   MESSAGE(STATUS "  Build shared libs ............... : ${BUILD_SHARED_LIBS}")
  971   MESSAGE(STATUS "  Build static libs ............... : ${BUILD_STATIC_LIBS}")
  972   MESSAGE(STATUS "  Build pcregrep .................. : ${PCRE_BUILD_PCREGREP}")
  973   MESSAGE(STATUS "  Enable JIT in pcregrep .......... : ${PCRE_SUPPORT_PCREGREP_JIT}")
  974   MESSAGE(STATUS "  Buffer size for pcregrep ........ : ${PCREGREP_BUFSIZE}")
  975   MESSAGE(STATUS "  Build tests (implies pcretest  .. : ${PCRE_BUILD_TESTS}")
  976   MESSAGE(STATUS "               and pcregrep)")
  977   IF(ZLIB_FOUND)
  978     MESSAGE(STATUS "  Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")
  979   ELSE(ZLIB_FOUND)
  980     MESSAGE(STATUS "  Link pcregrep with libz ......... : Library not found" )
  981   ENDIF(ZLIB_FOUND)
  982   IF(BZIP2_FOUND)
  983     MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")
  984   ELSE(BZIP2_FOUND)
  985     MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : Library not found" )
  986   ENDIF(BZIP2_FOUND)
  987   IF(EDITLINE_FOUND)
  988     MESSAGE(STATUS "  Link pcretest with libeditline .. : ${PCRE_SUPPORT_LIBEDIT}")
  989   ELSE(EDITLINE_FOUND)
  990     MESSAGE(STATUS "  Link pcretest with libeditline .. : Library not found" )
  991   ENDIF(EDITLINE_FOUND)
  992   IF(READLINE_FOUND)
  993     MESSAGE(STATUS "  Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")
  994   ELSE(READLINE_FOUND)
  995     MESSAGE(STATUS "  Link pcretest with libreadline .. : Library not found" )
  996   ENDIF(READLINE_FOUND)
  997   MESSAGE(STATUS "  Support Valgrind .................: ${PCRE_SUPPORT_VALGRIND}")
  998   MESSAGE(STATUS "  Support coverage .................: ${PCRE_SUPPORT_COVERAGE}")
  999 
 1000   IF(MINGW AND NOT PCRE_STATIC)
 1001     MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
 1002     MESSAGE(STATUS "  Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}")
 1003   ENDIF(MINGW AND NOT PCRE_STATIC)
 1004 
 1005   IF(MSVC)
 1006     MESSAGE(STATUS "  Install MSVC .pdb files ..........: ${INSTALL_MSVC_PDB}")
 1007   ENDIF(MSVC)
 1008 
 1009   MESSAGE(STATUS "")
 1010 ENDIF(PCRE_SHOW_REPORT)
 1011 
 1012 # end CMakeLists.txt