/[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 684 by ph10, Tue Sep 6 10:44:57 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    
44  PROJECT(PCRE C CXX)  PROJECT(PCRE C CXX)
45    
# Line 53  INCLUDE(CheckFunctionExists) Line 60  INCLUDE(CheckFunctionExists)
60  INCLUDE(CheckTypeSize)  INCLUDE(CheckTypeSize)
61    
62  CHECK_INCLUDE_FILE(dirent.h     HAVE_DIRENT_H)  CHECK_INCLUDE_FILE(dirent.h     HAVE_DIRENT_H)
63    CHECK_INCLUDE_FILE(stdint.h     HAVE_STDINT_H)
64    CHECK_INCLUDE_FILE(inttypes.h   HAVE_INTTYPES_H)
65  CHECK_INCLUDE_FILE(sys/stat.h   HAVE_SYS_STAT_H)  CHECK_INCLUDE_FILE(sys/stat.h   HAVE_SYS_STAT_H)
66  CHECK_INCLUDE_FILE(sys/types.h  HAVE_SYS_TYPES_H)  CHECK_INCLUDE_FILE(sys/types.h  HAVE_SYS_TYPES_H)
67  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 102  SET(PCRE_MATCH_LIMIT "10000000" CACHE ST
102  SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" CACHE STRING  SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" CACHE STRING
103      "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.")
104    
105    SET(PCREGREP_BUFSIZE "20480" CACHE STRING
106        "Buffer size parameter for pcregrep. See PCREGREP_BUFSIZE in config.h.in for details.")
107    
108  SET(PCRE_NEWLINE "LF" CACHE STRING  SET(PCRE_NEWLINE "LF" CACHE STRING
109      "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).")
110    
# Line 102  SET(PCRE_NO_RECURSE OFF CACHE BOOL Line 114  SET(PCRE_NO_RECURSE OFF CACHE BOOL
114  SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING  SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING
115      "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.")
116    
117    SET(PCRE_SUPPORT_JIT OFF CACHE BOOL
118        "Enable support for Just-in-time compiling.")
119    
120  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL
121      "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)")
122    
# Line 196  IF(PCRE_SUPPORT_UNICODE_PROPERTIES) Line 211  IF(PCRE_SUPPORT_UNICODE_PROPERTIES)
211          SET(SUPPORT_UCP 1)          SET(SUPPORT_UCP 1)
212  ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)  ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)
213    
214    IF(PCRE_SUPPORT_JIT)
215            SET(SUPPORT_JIT 1)
216    ENDIF(PCRE_SUPPORT_JIT)
217    
218  # This next one used to contain  # This next one used to contain
219  #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})  #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})
220  # 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 322  SET(PCRE_SOURCES
322    pcre_get.c    pcre_get.c
323    pcre_globals.c    pcre_globals.c
324    pcre_info.c    pcre_info.c
325      pcre_jit_compile.c
326    pcre_newline.c    pcre_newline.c
327    pcre_maketables.c    pcre_maketables.c
328    pcre_ord2utf8.c    pcre_ord2utf8.c
# Line 419  IF(PCRE_BUILD_TESTS) Line 439  IF(PCRE_BUILD_TESTS)
439    ADD_EXECUTABLE(pcretest pcretest.c)    ADD_EXECUTABLE(pcretest pcretest.c)
440    SET(targets ${targets} pcretest)    SET(targets ${targets} pcretest)
441    TARGET_LINK_LIBRARIES(pcretest pcreposix ${PCRETEST_LIBS})    TARGET_LINK_LIBRARIES(pcretest pcreposix ${PCRETEST_LIBS})
442    
443      IF(PCRE_SUPPORT_JIT)
444        ADD_EXECUTABLE(pcre_jit_test pcre_jit_test.c)
445        SET(targets ${targets} pcre_jit_test)
446        TARGET_LINK_LIBRARIES(pcre_jit_test pcre)
447      ENDIF(PCRE_SUPPORT_JIT)
448    
449    IF(PCRE_BUILD_PCRECPP)    IF(PCRE_BUILD_PCRECPP)
450      ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)      ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)
# Line 430  IF(PCRE_BUILD_TESTS) Line 456  IF(PCRE_BUILD_TESTS)
456        )        )
457      ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)      ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)
458    
   
459      ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)      ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)
460      SET(targets ${targets} pcre_scanner_unittest)      SET(targets ${targets} pcre_scanner_unittest)
461      TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)      TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)
# Line 458  IF(PCRE_BUILD_TESTS) Line 483  IF(PCRE_BUILD_TESTS)
483            ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest)            ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest)
484    ENDIF(UNIX)    ENDIF(UNIX)
485    IF(WIN32)    IF(WIN32)
486            ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat)            # ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat)
487              ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest.bat)
488    ENDIF(WIN32)    ENDIF(WIN32)
489    
490      IF(PCRE_SUPPORT_JIT)
491      GET_TARGET_PROPERTY(PCRE_JIT_TEST_EXE
492                          pcre_jit_test
493                          DEBUG_LOCATION)
494      ENDIF(PCRE_SUPPORT_JIT)
495    
496    GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE    GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE
497                        pcrecpp_unittest                        pcrecpp_unittest
498                        DEBUG_LOCATION)                        DEBUG_LOCATION)
# Line 473  IF(PCRE_BUILD_TESTS) Line 505  IF(PCRE_BUILD_TESTS)
505                        pcre_stringpiece_unittest                        pcre_stringpiece_unittest
506                        DEBUG_LOCATION)                        DEBUG_LOCATION)
507    
508      IF(PCRE_SUPPORT_JIT)
509      ADD_TEST(pcre_jit_test         ${PCRE_JIT_TEST_EXE})
510      ENDIF(PCRE_SUPPORT_JIT)
511    ADD_TEST(pcrecpp_test          ${PCRECPP_UNITTEST_EXE})    ADD_TEST(pcrecpp_test          ${PCRECPP_UNITTEST_EXE})
512    ADD_TEST(pcre_scanner_test     ${PCRE_SCANNER_UNITTEST_EXE})    ADD_TEST(pcre_scanner_test     ${PCRE_SCANNER_UNITTEST_EXE})
513    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 553  ELSE(BUILD_SHARED_LIBS)
553  ENDIF(BUILD_SHARED_LIBS)  ENDIF(BUILD_SHARED_LIBS)
554    
555  IF(PCRE_SHOW_REPORT)  IF(PCRE_SHOW_REPORT)
556      STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
557      IF (CMAKE_C_FLAGS)
558        SET(cfsp " ")
559      ENDIF(CMAKE_C_FLAGS)
560      IF (CMAKE_CXX_FLAGS)
561        SET(cxxfsp " ")
562      ENDIF(CMAKE_CXX_FLAGS)
563    MESSAGE(STATUS "")    MESSAGE(STATUS "")
564    MESSAGE(STATUS "")    MESSAGE(STATUS "")
565    MESSAGE(STATUS "PCRE configuration summary:")    MESSAGE(STATUS "PCRE configuration summary:")
566    MESSAGE(STATUS "")    MESSAGE(STATUS "")
567    MESSAGE(STATUS "  Install prefix .................. : " ${CMAKE_INSTALL_PREFIX})    MESSAGE(STATUS "  Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
568    MESSAGE(STATUS "  C compiler ...................... : " ${CMAKE_C_COMPILER})    MESSAGE(STATUS "  C compiler ...................... : ${CMAKE_C_COMPILER}")
569    MESSAGE(STATUS "  C++ compiler .................... : " ${CMAKE_CXX_COMPILER})    MESSAGE(STATUS "  C++ compiler .................... : ${CMAKE_CXX_COMPILER}")
570    MESSAGE(STATUS "  C compiler flags ................ : " ${CMAKE_C_FLAGS})   #FIXME    MESSAGE(STATUS "  C compiler flags ................ : ${CMAKE_C_FLAGS}${cfsp}${CMAKE_C_FLAGS_${buildtype}}")
571    MESSAGE(STATUS "  C++ compiler flags .............. : " ${CMAKE_CXX_FLAGS}) #FIXME    MESSAGE(STATUS "  C++ compiler flags .............. : ${CMAKE_CXX_FLAGS}${cxxfsp}${CMAKE_CXX_FLAGS_${buildtype}}")
572    MESSAGE(STATUS "")    MESSAGE(STATUS "")
573    MESSAGE(STATUS "  Build C++ library ............... : " ${PCRE_BUILD_PCRECPP})    MESSAGE(STATUS "  Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")
574    MESSAGE(STATUS "  Enable UTF-8 support ............ : " ${PCRE_SUPPORT_UNICODE_PROPERTIES})    MESSAGE(STATUS "  Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}")
575    MESSAGE(STATUS "  Unicode properties .............. : " ${PCRE_SUPPORT_UNICODE_PROPERTIES})    MESSAGE(STATUS "  Enable UTF-8 support ............ : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
576    MESSAGE(STATUS "  Newline char/sequence ........... : " ${PCRE_NEWLINE})    MESSAGE(STATUS "  Unicode properties .............. : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
577    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : " ${PCRE_SUPPORT_BSR_ANYCRLF})    MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE_NEWLINE}")
578    MESSAGE(STATUS "  EBCDIC coding ................... : " ${PCRE_EBCDIC})    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")
579    MESSAGE(STATUS "  Rebuild char tables ............. : " ${PCRE_REBUILD_CHARTABLES})    MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE_EBCDIC}")
580    MESSAGE(STATUS "  No stack recursion .............. : " ${PCRE_NO_RECURSE})    MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")
581    MESSAGE(STATUS "  POSIX mem threshold ............. : " ${PCRE_POSIX_MALLOC_THRESHOLD})    MESSAGE(STATUS "  No stack recursion .............. : ${PCRE_NO_RECURSE}")
582    MESSAGE(STATUS "  Internal link size .............. : " ${PCRE_LINK_SIZE})    MESSAGE(STATUS "  POSIX mem threshold ............. : ${PCRE_POSIX_MALLOC_THRESHOLD}")
583    MESSAGE(STATUS "  Match limit ..................... : " ${PCRE_MATCH_LIMIT})    MESSAGE(STATUS "  Internal link size .............. : ${PCRE_LINK_SIZE}")
584    MESSAGE(STATUS "  Match limit recursion ........... : " ${PCRE_MATCH_LIMIT_RECURSION})    MESSAGE(STATUS "  Match limit ..................... : ${PCRE_MATCH_LIMIT}")
585    MESSAGE(STATUS "  Build shared libs ............... : " ${BUILD_SHARED_LIBS})    MESSAGE(STATUS "  Match limit recursion ........... : ${PCRE_MATCH_LIMIT_RECURSION}")
586    MESSAGE(STATUS "  Build static libs ............... : " ${BUILD_STATIC_LIBS})    MESSAGE(STATUS "  Build shared libs ............... : ${BUILD_SHARED_LIBS}")
587    MESSAGE(STATUS "  Build pcregrep .................. : " ${PCRE_BUILD_PCREGREP})    MESSAGE(STATUS "  Build static libs ............... : ${BUILD_STATIC_LIBS}")
588    MESSAGE(STATUS "  Build tests (implies pcretest) .. : " ${PCRE_BUILD_TESTS})    MESSAGE(STATUS "  Build pcregrep .................. : ${PCRE_BUILD_PCREGREP}")
589      MESSAGE(STATUS "  Buffer size for pcregrep ........ : ${PCREGREP_BUFSIZE}")
590      MESSAGE(STATUS "  Build tests (implies pcretest) .. : ${PCRE_BUILD_TESTS}")
591    IF(ZLIB_FOUND)    IF(ZLIB_FOUND)
592      MESSAGE(STATUS "  Link pcregrep with libz ......... : " ${PCRE_SUPPORT_LIBZ})      MESSAGE(STATUS "  Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")
593    ELSE(ZLIB_FOUND)    ELSE(ZLIB_FOUND)
594      MESSAGE(STATUS "  Link pcregrep with libz ......... : None" )      MESSAGE(STATUS "  Link pcregrep with libz ......... : None" )
595    ENDIF(ZLIB_FOUND)    ENDIF(ZLIB_FOUND)
596    IF(BZIP2_FOUND)    IF(BZIP2_FOUND)
597      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : " ${PCRE_SUPPORT_LIBBZ2})      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")
598    ELSE(BZIP2_FOUND)    ELSE(BZIP2_FOUND)
599      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : None" )      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : None" )
600    ENDIF(BZIP2_FOUND)    ENDIF(BZIP2_FOUND)
601    IF(NOT PCRE_SUPPORT_LIBREADLINE)    IF(NOT PCRE_SUPPORT_LIBREADLINE)
602      MESSAGE(STATUS "  Link pcretest with libreadline .. : None" )      MESSAGE(STATUS "  Link pcretest with libreadline .. : None" )
603    ELSE(NOT PCRE_SUPPORT_LIBREADLINE)    ELSE(NOT PCRE_SUPPORT_LIBREADLINE)
604      MESSAGE(STATUS "  Link pcretest with libreadline .. : " ${PCRE_SUPPORT_LIBREADLINE})      MESSAGE(STATUS "  Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")
605    ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)    ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)
606    IF(MINGW AND NOT PCRE_STATIC)    IF(MINGW AND NOT PCRE_STATIC)
607      MESSAGE(STATUS "  Non-standard dll names (prefix) . : " ${NON_STANDARD_LIB_PREFIX})      MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
608      MESSAGE(STATUS "  Non-standard dll names (suffix) . : " ${NON_STANDARD_LIB_SUFFIX})      MESSAGE(STATUS "  Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}")
609    ENDIF(MINGW AND NOT PCRE_STATIC)    ENDIF(MINGW AND NOT PCRE_STATIC)
610    MESSAGE(STATUS "")    MESSAGE(STATUS "")
611  ENDIF(PCRE_SHOW_REPORT)  ENDIF(PCRE_SHOW_REPORT)

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

  ViewVC Help
Powered by ViewVC 1.1.5