Annotation of embedaddon/pcre/CMakeLists.txt, revision 1.1.1.4

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>