/[pcre]/code/trunk/CMakeLists.txt
ViewVC logotype

Diff of /code/trunk/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 411 by ph10, Fri Apr 10 15:40:21 2009 UTC revision 685 by ph10, Tue Sep 6 15:02:07 2011 UTC
# Line 33  Line 33 
33  # 2009-03-23 PH applied a modified version of Steven Van Ingelgem's patches to  # 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  #            add options to stop the building of pcregrep and the tests, and
35  #            to disable the final configuration report.  #            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    
45  PROJECT(PCRE C CXX)  PROJECT(PCRE C CXX)
46    
# Line 53  INCLUDE(CheckFunctionExists) Line 61  INCLUDE(CheckFunctionExists)
61  INCLUDE(CheckTypeSize)  INCLUDE(CheckTypeSize)
62    
63  CHECK_INCLUDE_FILE(dirent.h     HAVE_DIRENT_H)  CHECK_INCLUDE_FILE(dirent.h     HAVE_DIRENT_H)
64    CHECK_INCLUDE_FILE(stdint.h     HAVE_STDINT_H)
65    CHECK_INCLUDE_FILE(inttypes.h   HAVE_INTTYPES_H)
66  CHECK_INCLUDE_FILE(sys/stat.h   HAVE_SYS_STAT_H)  CHECK_INCLUDE_FILE(sys/stat.h   HAVE_SYS_STAT_H)
67  CHECK_INCLUDE_FILE(sys/types.h  HAVE_SYS_TYPES_H)  CHECK_INCLUDE_FILE(sys/types.h  HAVE_SYS_TYPES_H)
68  CHECK_INCLUDE_FILE(unistd.h     HAVE_UNISTD_H)  CHECK_INCLUDE_FILE(unistd.h     HAVE_UNISTD_H)
# Line 93  SET(PCRE_MATCH_LIMIT "10000000" CACHE ST Line 103  SET(PCRE_MATCH_LIMIT "10000000" CACHE ST
103  SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" CACHE STRING  SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" CACHE STRING
104      "Default limit on internal recursion. See MATCH_LIMIT_RECURSION in config.h.in for details.")      "Default limit on internal recursion. See MATCH_LIMIT_RECURSION in config.h.in for details.")
105    
106    SET(PCREGREP_BUFSIZE "20480" CACHE STRING
107        "Buffer size parameter for pcregrep. See PCREGREP_BUFSIZE in config.h.in for details.")
108    
109  SET(PCRE_NEWLINE "LF" CACHE STRING  SET(PCRE_NEWLINE "LF" CACHE STRING
110      "What to recognize as a newline (one of CR, LF, CRLF, ANY, ANYCRLF).")      "What to recognize as a newline (one of CR, LF, CRLF, ANY, ANYCRLF).")
111    
# Line 102  SET(PCRE_NO_RECURSE OFF CACHE BOOL Line 115  SET(PCRE_NO_RECURSE OFF CACHE BOOL
115  SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING  SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING
116      "Threshold for malloc() usage. See POSIX_MALLOC_THRESHOLD in config.h.in for details.")      "Threshold for malloc() usage. See POSIX_MALLOC_THRESHOLD in config.h.in for details.")
117    
118    SET(PCRE_SUPPORT_JIT OFF CACHE BOOL
119        "Enable support for Just-in-time compiling.")
120    
121    SET(PCRE_SUPPORT_PCREGREP_JIT ON CACHE BOOL
122        "Enable use of Just-in-time compiling in pcregrep.")
123    
124  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL
125      "Enable support for Unicode properties. (If set, UTF-8 support will be enabled as well)")      "Enable support for Unicode properties. (If set, UTF-8 support will be enabled as well)")
126    
# Line 196  IF(PCRE_SUPPORT_UNICODE_PROPERTIES) Line 215  IF(PCRE_SUPPORT_UNICODE_PROPERTIES)
215          SET(SUPPORT_UCP 1)          SET(SUPPORT_UCP 1)
216  ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)  ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)
217    
218    IF(PCRE_SUPPORT_JIT)
219            SET(SUPPORT_JIT 1)
220    ELSE
221            SET(PCRE_SUPPORT_PCREGREP_JIT 0)
222    ENDIF(PCRE_SUPPORT_JIT)
223    
224    IF(PCRE_SUPPORT_PCREGREP_JIT)
225            SET(SUPPORT_PCREGREP_JIT 1)
226    ENDIF(PCRE_SUPPORT_PCREGREP_JIT)
227    
228  # This next one used to contain  # This next one used to contain
229  #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})  #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})
230  # but I was advised to add the NCURSES test as well, along with  # but I was advised to add the NCURSES test as well, along with
# Line 303  SET(PCRE_SOURCES Line 332  SET(PCRE_SOURCES
332    pcre_get.c    pcre_get.c
333    pcre_globals.c    pcre_globals.c
334    pcre_info.c    pcre_info.c
335      pcre_jit_compile.c
336    pcre_newline.c    pcre_newline.c
337    pcre_maketables.c    pcre_maketables.c
338    pcre_ord2utf8.c    pcre_ord2utf8.c
# Line 419  IF(PCRE_BUILD_TESTS) Line 449  IF(PCRE_BUILD_TESTS)
449    ADD_EXECUTABLE(pcretest pcretest.c)    ADD_EXECUTABLE(pcretest pcretest.c)
450    SET(targets ${targets} pcretest)    SET(targets ${targets} pcretest)
451    TARGET_LINK_LIBRARIES(pcretest pcreposix ${PCRETEST_LIBS})    TARGET_LINK_LIBRARIES(pcretest pcreposix ${PCRETEST_LIBS})
452    
453      IF(PCRE_SUPPORT_JIT)
454        ADD_EXECUTABLE(pcre_jit_test pcre_jit_test.c)
455        SET(targets ${targets} pcre_jit_test)
456        TARGET_LINK_LIBRARIES(pcre_jit_test pcre)
457      ENDIF(PCRE_SUPPORT_JIT)
458    
459    IF(PCRE_BUILD_PCRECPP)    IF(PCRE_BUILD_PCRECPP)
460      ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)      ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)
# Line 430  IF(PCRE_BUILD_TESTS) Line 466  IF(PCRE_BUILD_TESTS)
466        )        )
467      ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)      ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)
468    
   
469      ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)      ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)
470      SET(targets ${targets} pcre_scanner_unittest)      SET(targets ${targets} pcre_scanner_unittest)
471      TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)      TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)
# Line 458  IF(PCRE_BUILD_TESTS) Line 493  IF(PCRE_BUILD_TESTS)
493            ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest)            ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest)
494    ENDIF(UNIX)    ENDIF(UNIX)
495    IF(WIN32)    IF(WIN32)
496            ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat)            # ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat)
497              ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest.bat)
498    ENDIF(WIN32)    ENDIF(WIN32)
499    
500      IF(PCRE_SUPPORT_JIT)
501      GET_TARGET_PROPERTY(PCRE_JIT_TEST_EXE
502                          pcre_jit_test
503                          DEBUG_LOCATION)
504      ENDIF(PCRE_SUPPORT_JIT)
505    
506    GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE    GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE
507                        pcrecpp_unittest                        pcrecpp_unittest
508                        DEBUG_LOCATION)                        DEBUG_LOCATION)
# Line 473  IF(PCRE_BUILD_TESTS) Line 515  IF(PCRE_BUILD_TESTS)
515                        pcre_stringpiece_unittest                        pcre_stringpiece_unittest
516                        DEBUG_LOCATION)                        DEBUG_LOCATION)
517    
518      IF(PCRE_SUPPORT_JIT)
519      ADD_TEST(pcre_jit_test         ${PCRE_JIT_TEST_EXE})
520      ENDIF(PCRE_SUPPORT_JIT)
521    ADD_TEST(pcrecpp_test          ${PCRECPP_UNITTEST_EXE})    ADD_TEST(pcrecpp_test          ${PCRECPP_UNITTEST_EXE})
522    ADD_TEST(pcre_scanner_test     ${PCRE_SCANNER_UNITTEST_EXE})    ADD_TEST(pcre_scanner_test     ${PCRE_SCANNER_UNITTEST_EXE})
523    ADD_TEST(pcre_stringpiece_test ${PCRE_STRINGPIECE_UNITTEST_EXE})    ADD_TEST(pcre_stringpiece_test ${PCRE_STRINGPIECE_UNITTEST_EXE})
# Line 518  ELSE(BUILD_SHARED_LIBS) Line 563  ELSE(BUILD_SHARED_LIBS)
563  ENDIF(BUILD_SHARED_LIBS)  ENDIF(BUILD_SHARED_LIBS)
564    
565  IF(PCRE_SHOW_REPORT)  IF(PCRE_SHOW_REPORT)
566      STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
567      IF (CMAKE_C_FLAGS)
568        SET(cfsp " ")
569      ENDIF(CMAKE_C_FLAGS)
570      IF (CMAKE_CXX_FLAGS)
571        SET(cxxfsp " ")
572      ENDIF(CMAKE_CXX_FLAGS)
573    MESSAGE(STATUS "")    MESSAGE(STATUS "")
574    MESSAGE(STATUS "")    MESSAGE(STATUS "")
575    MESSAGE(STATUS "PCRE configuration summary:")    MESSAGE(STATUS "PCRE configuration summary:")
576    MESSAGE(STATUS "")    MESSAGE(STATUS "")
577    MESSAGE(STATUS "  Install prefix .................. : " ${CMAKE_INSTALL_PREFIX})    MESSAGE(STATUS "  Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
578    MESSAGE(STATUS "  C compiler ...................... : " ${CMAKE_C_COMPILER})    MESSAGE(STATUS "  C compiler ...................... : ${CMAKE_C_COMPILER}")
579    MESSAGE(STATUS "  C++ compiler .................... : " ${CMAKE_CXX_COMPILER})    MESSAGE(STATUS "  C++ compiler .................... : ${CMAKE_CXX_COMPILER}")
580    MESSAGE(STATUS "  C compiler flags ................ : " ${CMAKE_C_FLAGS})   #FIXME    MESSAGE(STATUS "  C compiler flags ................ : ${CMAKE_C_FLAGS}${cfsp}${CMAKE_C_FLAGS_${buildtype}}")
581    MESSAGE(STATUS "  C++ compiler flags .............. : " ${CMAKE_CXX_FLAGS}) #FIXME    MESSAGE(STATUS "  C++ compiler flags .............. : ${CMAKE_CXX_FLAGS}${cxxfsp}${CMAKE_CXX_FLAGS_${buildtype}}")
582    MESSAGE(STATUS "")    MESSAGE(STATUS "")
583    MESSAGE(STATUS "  Build C++ library ............... : " ${PCRE_BUILD_PCRECPP})    MESSAGE(STATUS "  Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")
584    MESSAGE(STATUS "  Enable UTF-8 support ............ : " ${PCRE_SUPPORT_UNICODE_PROPERTIES})    MESSAGE(STATUS "  Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}")
585    MESSAGE(STATUS "  Unicode properties .............. : " ${PCRE_SUPPORT_UNICODE_PROPERTIES})    MESSAGE(STATUS "  Enable UTF-8 support ............ : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
586    MESSAGE(STATUS "  Newline char/sequence ........... : " ${PCRE_NEWLINE})    MESSAGE(STATUS "  Unicode properties .............. : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
587    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : " ${PCRE_SUPPORT_BSR_ANYCRLF})    MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE_NEWLINE}")
588    MESSAGE(STATUS "  EBCDIC coding ................... : " ${PCRE_EBCDIC})    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")
589    MESSAGE(STATUS "  Rebuild char tables ............. : " ${PCRE_REBUILD_CHARTABLES})    MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE_EBCDIC}")
590    MESSAGE(STATUS "  No stack recursion .............. : " ${PCRE_NO_RECURSE})    MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")
591    MESSAGE(STATUS "  POSIX mem threshold ............. : " ${PCRE_POSIX_MALLOC_THRESHOLD})    MESSAGE(STATUS "  No stack recursion .............. : ${PCRE_NO_RECURSE}")
592    MESSAGE(STATUS "  Internal link size .............. : " ${PCRE_LINK_SIZE})    MESSAGE(STATUS "  POSIX mem threshold ............. : ${PCRE_POSIX_MALLOC_THRESHOLD}")
593    MESSAGE(STATUS "  Match limit ..................... : " ${PCRE_MATCH_LIMIT})    MESSAGE(STATUS "  Internal link size .............. : ${PCRE_LINK_SIZE}")
594    MESSAGE(STATUS "  Match limit recursion ........... : " ${PCRE_MATCH_LIMIT_RECURSION})    MESSAGE(STATUS "  Match limit ..................... : ${PCRE_MATCH_LIMIT}")
595    MESSAGE(STATUS "  Build shared libs ............... : " ${BUILD_SHARED_LIBS})    MESSAGE(STATUS "  Match limit recursion ........... : ${PCRE_MATCH_LIMIT_RECURSION}")
596    MESSAGE(STATUS "  Build static libs ............... : " ${BUILD_STATIC_LIBS})    MESSAGE(STATUS "  Build shared libs ............... : ${BUILD_SHARED_LIBS}")
597    MESSAGE(STATUS "  Build pcregrep .................. : " ${PCRE_BUILD_PCREGREP})    MESSAGE(STATUS "  Build static libs ............... : ${BUILD_STATIC_LIBS}")
598    MESSAGE(STATUS "  Build tests (implies pcretest) .. : " ${PCRE_BUILD_TESTS})    MESSAGE(STATUS "  Build pcregrep .................. : ${PCRE_BUILD_PCREGREP}")
599      MESSAGE(STATUS "  Enable JIT in pcregrep .......... : ${PCRE_SUPPORT_PCREGREP_JIT}")
600      MESSAGE(STATUS "  Buffer size for pcregrep ........ : ${PCREGREP_BUFSIZE}")
601      MESSAGE(STATUS "  Build tests (implies pcretest) .. : ${PCRE_BUILD_TESTS}")
602    IF(ZLIB_FOUND)    IF(ZLIB_FOUND)
603      MESSAGE(STATUS "  Link pcregrep with libz ......... : " ${PCRE_SUPPORT_LIBZ})      MESSAGE(STATUS "  Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")
604    ELSE(ZLIB_FOUND)    ELSE(ZLIB_FOUND)
605      MESSAGE(STATUS "  Link pcregrep with libz ......... : None" )      MESSAGE(STATUS "  Link pcregrep with libz ......... : None" )
606    ENDIF(ZLIB_FOUND)    ENDIF(ZLIB_FOUND)
607    IF(BZIP2_FOUND)    IF(BZIP2_FOUND)
608      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : " ${PCRE_SUPPORT_LIBBZ2})      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")
609    ELSE(BZIP2_FOUND)    ELSE(BZIP2_FOUND)
610      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : None" )      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : None" )
611    ENDIF(BZIP2_FOUND)    ENDIF(BZIP2_FOUND)
612    IF(NOT PCRE_SUPPORT_LIBREADLINE)    IF(NOT PCRE_SUPPORT_LIBREADLINE)
613      MESSAGE(STATUS "  Link pcretest with libreadline .. : None" )      MESSAGE(STATUS "  Link pcretest with libreadline .. : None" )
614    ELSE(NOT PCRE_SUPPORT_LIBREADLINE)    ELSE(NOT PCRE_SUPPORT_LIBREADLINE)
615      MESSAGE(STATUS "  Link pcretest with libreadline .. : " ${PCRE_SUPPORT_LIBREADLINE})      MESSAGE(STATUS "  Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")
616    ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)    ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)
617    IF(MINGW AND NOT PCRE_STATIC)    IF(MINGW AND NOT PCRE_STATIC)
618      MESSAGE(STATUS "  Non-standard dll names (prefix) . : " ${NON_STANDARD_LIB_PREFIX})      MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
619      MESSAGE(STATUS "  Non-standard dll names (suffix) . : " ${NON_STANDARD_LIB_SUFFIX})      MESSAGE(STATUS "  Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}")
620    ENDIF(MINGW AND NOT PCRE_STATIC)    ENDIF(MINGW AND NOT PCRE_STATIC)
621    MESSAGE(STATUS "")    MESSAGE(STATUS "")
622  ENDIF(PCRE_SHOW_REPORT)  ENDIF(PCRE_SHOW_REPORT)

Legend:
Removed from v.411  
changed lines
  Added in v.685

  ViewVC Help
Powered by ViewVC 1.1.5