/[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 351 by ph10, Fri Jul 4 18:27:16 2008 UTC revision 685 by ph10, Tue Sep 6 15:02:07 2011 UTC
# Line 15  Line 15 
15  #                PCRE_SUPPORT_LIBBZ2.  #                PCRE_SUPPORT_LIBBZ2.
16  # 2008-01-20 Brought up to date to include several new features by Christian  # 2008-01-20 Brought up to date to include several new features by Christian
17  #            Ehrlicher.  #            Ehrlicher.
18  # 2008-01-22 Sheri added options for backward compatibility of library names when  # 2008-01-22 Sheri added options for backward compatibility of library names
19  #            building with minGW:  #            when building with minGW:
20  #            if "ON", NON_STANDARD_LIB_PREFIX causes shared libraries to  #            if "ON", NON_STANDARD_LIB_PREFIX causes shared libraries to
21  #            be built without "lib" as prefix. (The libraries will be named pcre.dll,  #            be built without "lib" as prefix. (The libraries will be named
22  #            pcreposix.dll and pcrecpp.dll).  #            pcre.dll, pcreposix.dll and pcrecpp.dll).
23  #            if "ON", NON_STANDARD_LIB_SUFFIX causes shared libraries to  #            if "ON", NON_STANDARD_LIB_SUFFIX causes shared libraries to
24  #            be built with suffix of "-0.dll". (The libraries will be named  #            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  #            libpcre-0.dll, libpcreposix-0.dll and libpcrecpp-0.dll - same names
# Line 27  Line 27 
27  # 2008-01-23 PH removed the automatic build of pcredemo.  # 2008-01-23 PH removed the automatic build of pcredemo.
28  # 2008-04-22 PH modified READLINE support so it finds NCURSES when needed.  # 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)  # 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    
45  PROJECT(PCRE C CXX)  PROJECT(PCRE C CXX)
46    
47  CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6)  CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6)
48    
49  SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # for FindReadline.cmake  SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
50    
51  # external packages  # external packages
52  FIND_PACKAGE( BZip2 )  FIND_PACKAGE( BZip2 )
# Line 47  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 87  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 96  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 105  SET(PCRE_SUPPORT_UTF8 OFF CACHE BOOL Line 130  SET(PCRE_SUPPORT_UTF8 OFF CACHE BOOL
130  SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL  SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL
131      "ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks")      "ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks")
132    
133    OPTION(PCRE_SHOW_REPORT    "Show the final configuration report" ON)
134    OPTION(PCRE_BUILD_PCREGREP "Build pcregrep" ON)
135    OPTION(PCRE_BUILD_TESTS    "Build the tests" ON)
136    
137    IF (PCRE_BUILD_TESTS)
138      IF (NOT PCRE_BUILD_PCREGREP)
139        MESSAGE(STATUS "** Building tests requires pcregrep: PCRE_BUILD_PCREGREP forced ON")
140        SET(PCRE_BUILD_PCREGREP ON)
141      ENDIF(NOT PCRE_BUILD_PCREGREP)
142    ENDIF(PCRE_BUILD_TESTS)
143    
144  IF (MINGW)  IF (MINGW)
145    OPTION(NON_STANDARD_LIB_PREFIX    OPTION(NON_STANDARD_LIB_PREFIX
# Line 180  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 232  IF(PCRE_NO_RECURSE) Line 277  IF(PCRE_NO_RECURSE)
277  ENDIF(PCRE_NO_RECURSE)  ENDIF(PCRE_NO_RECURSE)
278    
279  # Output files  # Output files
   
280  CONFIGURE_FILE(config-cmake.h.in  CONFIGURE_FILE(config-cmake.h.in
281                 ${CMAKE_BINARY_DIR}/config.h                 ${PROJECT_BINARY_DIR}/config.h
282                 @ONLY)                 @ONLY)
283    
284  CONFIGURE_FILE(pcre.h.generic  CONFIGURE_FILE(pcre.h.generic
285                 ${CMAKE_BINARY_DIR}/pcre.h                 ${PROJECT_BINARY_DIR}/pcre.h
286                 COPYONLY)                 COPYONLY)
287    
288  # What about pcre-config and libpcre.pc?  # What about pcre-config and libpcre.pc?
289    
290  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCRECPP)
291          CONFIGURE_FILE(pcre_stringpiece.h.in          CONFIGURE_FILE(pcre_stringpiece.h.in
292                         ${CMAKE_BINARY_DIR}/pcre_stringpiece.h                         ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
293                         @ONLY)                         @ONLY)
294    
295          CONFIGURE_FILE(pcrecpparg.h.in          CONFIGURE_FILE(pcrecpparg.h.in
296                         ${CMAKE_BINARY_DIR}/pcrecpparg.h                         ${PROJECT_BINARY_DIR}/pcrecpparg.h
297                         @ONLY)                         @ONLY)
298  ENDIF(PCRE_BUILD_PCRECPP)  ENDIF(PCRE_BUILD_PCRECPP)
299    
# Line 265  IF(PCRE_REBUILD_CHARTABLES) Line 309  IF(PCRE_REBUILD_CHARTABLES)
309      COMMENT "Generating character tables (pcre_chartables.c) for current locale"      COMMENT "Generating character tables (pcre_chartables.c) for current locale"
310      DEPENDS dftables      DEPENDS dftables
311      COMMAND ${DFTABLES_EXE}      COMMAND ${DFTABLES_EXE}
312      ARGS        ${CMAKE_BINARY_DIR}/pcre_chartables.c      ARGS        ${PROJECT_BINARY_DIR}/pcre_chartables.c
313      OUTPUT      ${CMAKE_BINARY_DIR}/pcre_chartables.c      OUTPUT      ${PROJECT_BINARY_DIR}/pcre_chartables.c
314    )    )
315  ELSE(PCRE_REBUILD_CHARTABLES)  ELSE(PCRE_REBUILD_CHARTABLES)
316    CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/pcre_chartables.c.dist    CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/pcre_chartables.c.dist
317                      ${CMAKE_BINARY_DIR}/pcre_chartables.c                      ${PROJECT_BINARY_DIR}/pcre_chartables.c
318                      COPYONLY)                      COPYONLY)
319  ENDIF(PCRE_REBUILD_CHARTABLES)  ENDIF(PCRE_REBUILD_CHARTABLES)
320    
321  # Source code  # Source code
322    
323  SET(PCRE_HEADERS ${CMAKE_BINARY_DIR}/pcre.h)  SET(PCRE_HEADERS ${PROJECT_BINARY_DIR}/pcre.h)
324    
325  SET(PCRE_SOURCES  SET(PCRE_SOURCES
326    ${CMAKE_BINARY_DIR}/pcre_chartables.c    ${PROJECT_BINARY_DIR}/pcre_chartables.c
327    pcre_compile.c    pcre_compile.c
328    pcre_config.c    pcre_config.c
329    pcre_dfa_exec.c    pcre_dfa_exec.c
# Line 288  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 308  SET(PCREPOSIX_SOURCES pcreposix.c) Line 353  SET(PCREPOSIX_SOURCES pcreposix.c)
353  SET(PCRECPP_HEADERS  SET(PCRECPP_HEADERS
354    pcrecpp.h    pcrecpp.h
355    pcre_scanner.h    pcre_scanner.h
356    ${CMAKE_BINARY_DIR}/pcrecpparg.h    ${PROJECT_BINARY_DIR}/pcrecpparg.h
357    ${CMAKE_BINARY_DIR}/pcre_stringpiece.h    ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
358  )  )
359    
360  SET(PCRECPP_SOURCES  SET(PCRECPP_SOURCES
# Line 333  IF(WIN32) Line 378  IF(WIN32)
378    SET(CMAKE_DEBUG_POSTFIX "d")    SET(CMAKE_DEBUG_POSTFIX "d")
379  ENDIF(WIN32)  ENDIF(WIN32)
380    
381    SET(targets)
382    
383  # Libraries  # Libraries
384  # pcre  # pcre
385  ADD_LIBRARY(pcre ${PCRE_HEADERS} ${PCRE_SOURCES} ${CMAKE_BINARY_DIR}/config.h)  ADD_LIBRARY(pcre ${PCRE_HEADERS} ${PCRE_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
386    SET(targets ${targets} pcre)
387  ADD_LIBRARY(pcreposix ${PCREPOSIX_HEADERS} ${PCREPOSIX_SOURCES})  ADD_LIBRARY(pcreposix ${PCREPOSIX_HEADERS} ${PCREPOSIX_SOURCES})
388    SET(targets ${targets} pcreposix)
389  TARGET_LINK_LIBRARIES(pcreposix pcre)  TARGET_LINK_LIBRARIES(pcreposix pcre)
390  IF(MINGW AND NOT PCRE_STATIC)  IF(MINGW AND NOT PCRE_STATIC)
391    IF(NON_STANDARD_LIB_PREFIX)    IF(NON_STANDARD_LIB_PREFIX)
# Line 356  ENDIF(MINGW AND NOT PCRE_STATIC) Line 405  ENDIF(MINGW AND NOT PCRE_STATIC)
405  # pcrecpp  # pcrecpp
406  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCRECPP)
407    ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})    ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})
408    SET(targets ${targets} pcrecpp)
409    TARGET_LINK_LIBRARIES(pcrecpp pcre)    TARGET_LINK_LIBRARIES(pcrecpp pcre)
410    
411    IF(MINGW AND NOT PCRE_STATIC)    IF(MINGW AND NOT PCRE_STATIC)
# Line 376  ENDIF(PCRE_BUILD_PCRECPP) Line 426  ENDIF(PCRE_BUILD_PCRECPP)
426    
427  # Executables  # Executables
428    
 ADD_EXECUTABLE(pcretest pcretest.c)  
 TARGET_LINK_LIBRARIES(pcretest pcreposix ${PCRETEST_LIBS})  
   
 ADD_EXECUTABLE(pcregrep pcregrep.c)  
 TARGET_LINK_LIBRARIES(pcregrep pcreposix ${PCREGREP_LIBS})  
   
429  # Removed by PH (2008-01-23) because pcredemo shouldn't really be built  # Removed by PH (2008-01-23) because pcredemo shouldn't really be built
430  # automatically, and it gave trouble in some environments anyway.  # automatically, and it gave trouble in some environments anyway.
431  # ADD_EXECUTABLE(pcredemo pcredemo.c)  # ADD_EXECUTABLE(pcredemo pcredemo.c)
# Line 391  TARGET_LINK_LIBRARIES(pcregrep pcreposix Line 435  TARGET_LINK_LIBRARIES(pcregrep pcreposix
435  #         SET_TARGET_PROPERTIES(pcredemo PROPERTIES COMPILE_FLAGS "-DPCRE_STATIC")  #         SET_TARGET_PROPERTIES(pcredemo PROPERTIES COMPILE_FLAGS "-DPCRE_STATIC")
436  # ENDIF(NOT BUILD_SHARED_LIBS)  # ENDIF(NOT BUILD_SHARED_LIBS)
437    
438  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCREGREP)
439          ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)    ADD_EXECUTABLE(pcregrep pcregrep.c)
440          TARGET_LINK_LIBRARIES(pcrecpp_unittest pcrecpp)    SET(targets ${targets} pcregrep)
441  IF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)    TARGET_LINK_LIBRARIES(pcregrep pcreposix ${PCREGREP_LIBS})
442  SET_TARGET_PROPERTIES(pcrecpp  ENDIF(PCRE_BUILD_PCREGREP)
                         PROPERTIES PREFIX ""  
 )  
 ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)  
   
443    
         ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)  
         TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)  
   
         ADD_EXECUTABLE(pcre_stringpiece_unittest pcre_stringpiece_unittest.cc)  
         TARGET_LINK_LIBRARIES(pcre_stringpiece_unittest pcrecpp)  
 ENDIF(PCRE_BUILD_PCRECPP)  
444    
445  # Testing  # Testing
446    IF(PCRE_BUILD_TESTS)
447      ENABLE_TESTING()
448    
449  ENABLE_TESTING()    ADD_EXECUTABLE(pcretest pcretest.c)
450      SET(targets ${targets} pcretest)
451  GET_TARGET_PROPERTY(PCREGREP_EXE pcregrep DEBUG_LOCATION)    TARGET_LINK_LIBRARIES(pcretest pcreposix ${PCRETEST_LIBS})
452  GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION)  
453      IF(PCRE_SUPPORT_JIT)
454  # Write out a CTest configuration file that sets some needed environment      ADD_EXECUTABLE(pcre_jit_test pcre_jit_test.c)
455  # variables for the test scripts.      SET(targets ${targets} pcre_jit_test)
456  #      TARGET_LINK_LIBRARIES(pcre_jit_test pcre)
457  FILE(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.ctest    ENDIF(PCRE_SUPPORT_JIT)
458  "# This is a generated file.  
459  SET(ENV{srcdir} ${CMAKE_SOURCE_DIR})    IF(PCRE_BUILD_PCRECPP)
460  SET(ENV{pcregrep} ${PCREGREP_EXE})      ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)
461  SET(ENV{pcretest} ${PCRETEST_EXE})      SET(targets ${targets} pcrecpp_unittest)
462  ")      TARGET_LINK_LIBRARIES(pcrecpp_unittest pcrecpp)
463        IF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)
464  IF(UNIX)        SET_TARGET_PROPERTIES(pcrecpp
465          ADD_TEST(pcre_test      ${CMAKE_SOURCE_DIR}/RunTest)                          PROPERTIES PREFIX ""
466          ADD_TEST(pcre_grep_test ${CMAKE_SOURCE_DIR}/RunGrepTest)        )
467  ENDIF(UNIX)      ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)
 IF(WIN32)  
         ADD_TEST(pcre_test cmd /C ${CMAKE_SOURCE_DIR}/RunTest.bat)  
 ENDIF(WIN32)  
468    
469  GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE      ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)
470                      pcrecpp_unittest      SET(targets ${targets} pcre_scanner_unittest)
471                      DEBUG_LOCATION)      TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)
472    
473  GET_TARGET_PROPERTY(PCRE_SCANNER_UNITTEST_EXE      ADD_EXECUTABLE(pcre_stringpiece_unittest pcre_stringpiece_unittest.cc)
474                      pcre_scanner_unittest      SET(targets ${targets} pcre_stringpiece_unittest)
475                      DEBUG_LOCATION)      TARGET_LINK_LIBRARIES(pcre_stringpiece_unittest pcrecpp)
476      ENDIF(PCRE_BUILD_PCRECPP)
477  GET_TARGET_PROPERTY(PCRE_STRINGPIECE_UNITTEST_EXE  
478                      pcre_stringpiece_unittest    GET_TARGET_PROPERTY(PCREGREP_EXE pcregrep DEBUG_LOCATION)
479                      DEBUG_LOCATION)    GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION)
480    
481  ADD_TEST(pcrecpp_test          ${PCRECPP_UNITTEST_EXE})    # Write out a CTest configuration file that sets some needed environment
482  ADD_TEST(pcre_scanner_test     ${PCRE_SCANNER_UNITTEST_EXE})    # variables for the test scripts.
483  ADD_TEST(pcre_stringpiece_test ${PCRE_STRINGPIECE_UNITTEST_EXE})    #
484      FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest
485      "# This is a generated file.
486      SET(ENV{srcdir} ${PROJECT_SOURCE_DIR})
487      SET(ENV{pcregrep} ${PCREGREP_EXE})
488      SET(ENV{pcretest} ${PCRETEST_EXE})
489      ")
490    
491      IF(UNIX)
492              ADD_TEST(pcre_test      ${PROJECT_SOURCE_DIR}/RunTest)
493              ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest)
494      ENDIF(UNIX)
495      IF(WIN32)
496              # ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat)
497              ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest.bat)
498      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
507                          pcrecpp_unittest
508                          DEBUG_LOCATION)
509    
510      GET_TARGET_PROPERTY(PCRE_SCANNER_UNITTEST_EXE
511                          pcre_scanner_unittest
512                          DEBUG_LOCATION)
513    
514      GET_TARGET_PROPERTY(PCRE_STRINGPIECE_UNITTEST_EXE
515                          pcre_stringpiece_unittest
516                          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})
522      ADD_TEST(pcre_scanner_test     ${PCRE_SCANNER_UNITTEST_EXE})
523      ADD_TEST(pcre_stringpiece_test ${PCRE_STRINGPIECE_UNITTEST_EXE})
524    ENDIF(PCRE_BUILD_TESTS)
525    
526  # Installation  # Installation
   
527  SET(CMAKE_INSTALL_ALWAYS 1)  SET(CMAKE_INSTALL_ALWAYS 1)
528    
529  INSTALL(TARGETS pcre pcreposix pcregrep pcretest  INSTALL(TARGETS ${targets}
530          RUNTIME DESTINATION bin          RUNTIME DESTINATION bin
531          LIBRARY DESTINATION lib          LIBRARY DESTINATION lib
532          ARCHIVE DESTINATION lib)          ARCHIVE DESTINATION lib)
533    
534  INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)  INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)
535    
536  FILE(GLOB html ${CMAKE_SOURCE_DIR}/doc/html/*.html)  FILE(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html)
537  FILE(GLOB man1 ${CMAKE_SOURCE_DIR}/doc/*.1)  FILE(GLOB man1 ${PROJECT_SOURCE_DIR}/doc/*.1)
538  FILE(GLOB man3 ${CMAKE_SOURCE_DIR}/doc/*.3)  FILE(GLOB man3 ${PROJECT_SOURCE_DIR}/doc/*.3)
539    
540  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCRECPP)
         INSTALL(TARGETS pcrecpp  
                 RUNTIME DESTINATION bin  
                 LIBRARY DESTINATION lib  
                 ARCHIVE DESTINATION lib)  
541          INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include)          INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include)
542  ELSE(PCRE_BUILD_PCRECPP)  ELSE(PCRE_BUILD_PCRECPP)
543          # Remove pcrecpp.3          # Remove pcrecpp.3
# Line 493  ELSE(BUILD_SHARED_LIBS) Line 562  ELSE(BUILD_SHARED_LIBS)
562    SET(BUILD_STATIC_LIBS ON)    SET(BUILD_STATIC_LIBS ON)
563  ENDIF(BUILD_SHARED_LIBS)  ENDIF(BUILD_SHARED_LIBS)
564    
565  MESSAGE(STATUS "")  IF(PCRE_SHOW_REPORT)
566  MESSAGE(STATUS "")    STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
567  MESSAGE(STATUS "PCRE configuration summary:")    IF (CMAKE_C_FLAGS)
568  MESSAGE(STATUS "")      SET(cfsp " ")
569  MESSAGE(STATUS "  Install prefix .................. : " ${CMAKE_INSTALL_PREFIX})    ENDIF(CMAKE_C_FLAGS)
570  MESSAGE(STATUS "  C compiler ...................... : " ${CMAKE_C_COMPILER})    IF (CMAKE_CXX_FLAGS)
571  MESSAGE(STATUS "  C++ compiler .................... : " ${CMAKE_CXX_COMPILER})      SET(cxxfsp " ")
572  MESSAGE(STATUS "  C compiler flags ................ : " ${CMAKE_C_FLAGS})   #FIXME    ENDIF(CMAKE_CXX_FLAGS)
573  MESSAGE(STATUS "  C++ compiler flags .............. : " ${CMAKE_CXX_FLAGS}) #FIXME    MESSAGE(STATUS "")
574  MESSAGE(STATUS "")    MESSAGE(STATUS "")
575  MESSAGE(STATUS "  Build C++ library ............... : " ${PCRE_BUILD_PCRECPP})    MESSAGE(STATUS "PCRE configuration summary:")
576  MESSAGE(STATUS "  Enable UTF-8 support ............ : " ${PCRE_SUPPORT_UNICODE_PROPERTIES})    MESSAGE(STATUS "")
577  MESSAGE(STATUS "  Unicode properties .............. : " ${PCRE_SUPPORT_UNICODE_PROPERTIES})    MESSAGE(STATUS "  Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
578  MESSAGE(STATUS "  Newline char/sequence ........... : " ${PCRE_NEWLINE})    MESSAGE(STATUS "  C compiler ...................... : ${CMAKE_C_COMPILER}")
579  MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : " ${PCRE_SUPPORT_BSR_ANYCRLF})    MESSAGE(STATUS "  C++ compiler .................... : ${CMAKE_CXX_COMPILER}")
580  MESSAGE(STATUS "  EBCDIC coding ................... : " ${PCRE_EBCDIC})    MESSAGE(STATUS "  C compiler flags ................ : ${CMAKE_C_FLAGS}${cfsp}${CMAKE_C_FLAGS_${buildtype}}")
581  MESSAGE(STATUS "  Rebuild char tables ............. : " ${PCRE_REBUILD_CHARTABLES})    MESSAGE(STATUS "  C++ compiler flags .............. : ${CMAKE_CXX_FLAGS}${cxxfsp}${CMAKE_CXX_FLAGS_${buildtype}}")
582  MESSAGE(STATUS "  No stack recursion .............. : " ${PCRE_NO_RECURSE})    MESSAGE(STATUS "")
583  MESSAGE(STATUS "  POSIX mem threshold ............. : " ${PCRE_POSIX_MALLOC_THRESHOLD})    MESSAGE(STATUS "  Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")
584  MESSAGE(STATUS "  Internal link size .............. : " ${PCRE_LINK_SIZE})    MESSAGE(STATUS "  Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}")
585  MESSAGE(STATUS "  Match limit ..................... : " ${PCRE_MATCH_LIMIT})    MESSAGE(STATUS "  Enable UTF-8 support ............ : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
586  MESSAGE(STATUS "  Match limit recursion ........... : " ${PCRE_MATCH_LIMIT_RECURSION})    MESSAGE(STATUS "  Unicode properties .............. : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
587  MESSAGE(STATUS "  Build shared libs ............... : " ${BUILD_SHARED_LIBS})    MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE_NEWLINE}")
588  MESSAGE(STATUS "  Build static libs ............... : " ${BUILD_STATIC_LIBS})    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")
589  IF(ZLIB_FOUND)    MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE_EBCDIC}")
590    MESSAGE(STATUS "  Link pcregrep with libz ......... : " ${PCRE_SUPPORT_LIBZ})    MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")
591  ELSE(ZLIB_FOUND)    MESSAGE(STATUS "  No stack recursion .............. : ${PCRE_NO_RECURSE}")
592    MESSAGE(STATUS "  Link pcregrep with libz ......... : None" )    MESSAGE(STATUS "  POSIX mem threshold ............. : ${PCRE_POSIX_MALLOC_THRESHOLD}")
593  ENDIF(ZLIB_FOUND)    MESSAGE(STATUS "  Internal link size .............. : ${PCRE_LINK_SIZE}")
594  IF(BZIP2_FOUND)    MESSAGE(STATUS "  Match limit ..................... : ${PCRE_MATCH_LIMIT}")
595    MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : " ${PCRE_SUPPORT_LIBBZ2})    MESSAGE(STATUS "  Match limit recursion ........... : ${PCRE_MATCH_LIMIT_RECURSION}")
596  ELSE(BZIP2_FOUND)    MESSAGE(STATUS "  Build shared libs ............... : ${BUILD_SHARED_LIBS}")
597    MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : None" )    MESSAGE(STATUS "  Build static libs ............... : ${BUILD_STATIC_LIBS}")
598  ENDIF(BZIP2_FOUND)    MESSAGE(STATUS "  Build pcregrep .................. : ${PCRE_BUILD_PCREGREP}")
599  IF(NOT PCRE_SUPPORT_LIBREADLINE)    MESSAGE(STATUS "  Enable JIT in pcregrep .......... : ${PCRE_SUPPORT_PCREGREP_JIT}")
600    MESSAGE(STATUS "  Link pcretest with libreadline .. : None" )    MESSAGE(STATUS "  Buffer size for pcregrep ........ : ${PCREGREP_BUFSIZE}")
601  ELSE(NOT PCRE_SUPPORT_LIBREADLINE)    MESSAGE(STATUS "  Build tests (implies pcretest) .. : ${PCRE_BUILD_TESTS}")
602    MESSAGE(STATUS "  Link pcretest with libreadline .. : " ${PCRE_SUPPORT_LIBREADLINE})    IF(ZLIB_FOUND)
603  ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)      MESSAGE(STATUS "  Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")
604  IF(MINGW AND NOT PCRE_STATIC)    ELSE(ZLIB_FOUND)
605    MESSAGE(STATUS "  Non-standard dll names (prefix) . : " ${NON_STANDARD_LIB_PREFIX})      MESSAGE(STATUS "  Link pcregrep with libz ......... : None" )
606    MESSAGE(STATUS "  Non-standard dll names (suffix) . : " ${NON_STANDARD_LIB_SUFFIX})    ENDIF(ZLIB_FOUND)
607  ENDIF(MINGW AND NOT PCRE_STATIC)    IF(BZIP2_FOUND)
608  MESSAGE(STATUS "")      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")
609      ELSE(BZIP2_FOUND)
610        MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : None" )
611      ENDIF(BZIP2_FOUND)
612      IF(NOT PCRE_SUPPORT_LIBREADLINE)
613        MESSAGE(STATUS "  Link pcretest with libreadline .. : None" )
614      ELSE(NOT PCRE_SUPPORT_LIBREADLINE)
615        MESSAGE(STATUS "  Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")
616      ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)
617      IF(MINGW AND NOT PCRE_STATIC)
618        MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
619        MESSAGE(STATUS "  Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}")
620      ENDIF(MINGW AND NOT PCRE_STATIC)
621      MESSAGE(STATUS "")
622    ENDIF(PCRE_SHOW_REPORT)
623    
624  # end CMakeLists.txt  # end CMakeLists.txt

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

  ViewVC Help
Powered by ViewVC 1.1.5