/[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 864 by zherczeg, Fri Jan 13 04:58:55 2012 UTC revision 1221 by ph10, Sun Nov 11 20:27:03 2012 UTC
# Line 54  Line 54 
54  # 2012-01-06 PH removed pcre_info.c and added pcre_string_utils.c  # 2012-01-06 PH removed pcre_info.c and added pcre_string_utils.c
55  # 2012-01-10 Zoltan Herczeg added libpcre16 support  # 2012-01-10 Zoltan Herczeg added libpcre16 support
56  # 2012-01-13 Stephen Kelly added out of source build support  # 2012-01-13 Stephen Kelly added out of source build support
57    # 2012-01-17 PH applied Stephen Kelly's patch to parse the version data out
58    #            of the configure.ac file
59    # 2012-02-26 PH added support for libedit
60    # 2012-09-06 PH added support for PCRE_EBCDIC_NL25
61    # 2012-09-08 ChPe added PCRE32 support
62    # 2012-10-23 PH added support for VALGRIND and GCOV
63    
64  PROJECT(PCRE C CXX)  PROJECT(PCRE C CXX)
65    
# Line 67  SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_D Line 73  SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_D
73  FIND_PACKAGE( BZip2 )  FIND_PACKAGE( BZip2 )
74  FIND_PACKAGE( ZLIB )  FIND_PACKAGE( ZLIB )
75  FIND_PACKAGE( Readline )  FIND_PACKAGE( Readline )
76    FIND_PACKAGE( Editline )
77    
78  # Configuration checks  # Configuration checks
79    
# Line 108  OPTION(PCRE_BUILD_PCRE8 "Build 8 bit PCR Line 115  OPTION(PCRE_BUILD_PCRE8 "Build 8 bit PCR
115    
116  OPTION(PCRE_BUILD_PCRE16 "Build 16 bit PCRE library" OFF)  OPTION(PCRE_BUILD_PCRE16 "Build 16 bit PCRE library" OFF)
117    
118    OPTION(PCRE_BUILD_PCRE32 "Build 32 bit PCRE library" OFF)
119    
120  OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON)  OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON)
121    
122  SET(PCRE_EBCDIC OFF CACHE BOOL  SET(PCRE_EBCDIC OFF CACHE BOOL
123      "Use EBCDIC coding instead of ASCII. (This is rarely used outside of mainframe systems)")      "Use EBCDIC coding instead of ASCII. (This is rarely used outside of mainframe systems.)")
124    
125    SET(PCRE_EBCDIC_NL25 OFF CACHE BOOL
126        "Use 0x25 as EBCDIC NL character instead of 0x15; implies EBCDIC.")
127    
128  SET(PCRE_LINK_SIZE "2" CACHE STRING  SET(PCRE_LINK_SIZE "2" CACHE STRING
129      "Internal link size (2, 3 or 4 allowed). See LINK_SIZE in config.h.in for details.")      "Internal link size (2, 3 or 4 allowed). See LINK_SIZE in config.h.in for details.")
# Line 141  SET(PCRE_SUPPORT_PCREGREP_JIT ON CACHE B Line 153  SET(PCRE_SUPPORT_PCREGREP_JIT ON CACHE B
153      "Enable use of Just-in-time compiling in pcregrep.")      "Enable use of Just-in-time compiling in pcregrep.")
154    
155  SET(PCRE_SUPPORT_UTF OFF CACHE BOOL  SET(PCRE_SUPPORT_UTF OFF CACHE BOOL
156      "Enable support for the Unicode Transformation Format (UTF) encoding.")      "Enable support for Unicode Transformation Format (UTF-8/UTF-16/UTF-32) encoding.")
157    
158  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL
159      "Enable support for Unicode properties. (If set, UTF-8 support will be enabled as well)")      "Enable support for Unicode properties (if set, UTF support will be enabled as well).")
   
 SET(PCRE_SUPPORT_UTF8 OFF CACHE BOOL  
     "Enable support for the Unicode UTF-8 encoding.")  
160    
161  SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL  SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL
162      "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")
163    
164    SET(PCRE_SUPPORT_VALGRIND OFF CACHE BOOL
165        "Enable Valgrind support.")
166    
167    SET(PCRE_SUPPORT_COVERAGE OFF CACHE BOOL
168        "Enable code coverage support using gcov.")
169    
170  OPTION(PCRE_SHOW_REPORT    "Show the final configuration report" ON)  OPTION(PCRE_SHOW_REPORT    "Show the final configuration report" ON)
171  OPTION(PCRE_BUILD_PCREGREP "Build pcregrep" ON)  OPTION(PCRE_BUILD_PCREGREP "Build pcregrep" ON)
172  OPTION(PCRE_BUILD_TESTS    "Build the tests" ON)  OPTION(PCRE_BUILD_TESTS    "Build the tests" ON)
# Line 182  IF(PCRE_SUPPORT_LIBZ) Line 197  IF(PCRE_SUPPORT_LIBZ)
197    INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})    INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
198  ENDIF(PCRE_SUPPORT_LIBZ)  ENDIF(PCRE_SUPPORT_LIBZ)
199    
200    # editline lib
201    IF(EDITLINE_FOUND)
202      OPTION (PCRE_SUPPORT_LIBEDIT  "Enable support for linking pcretest with libedit." OFF)
203    ENDIF(EDITLINE_FOUND)
204    IF(PCRE_SUPPORT_LIBEDIT)
205      INCLUDE_DIRECTORIES(${EDITLINE_INCLUDE_DIR})
206    ENDIF(PCRE_SUPPORT_LIBEDIT)
207    
208  # readline lib  # readline lib
209  IF(READLINE_FOUND)  IF(READLINE_FOUND)
210    OPTION (PCRE_SUPPORT_LIBREADLINE  "Enable support for linking pcretest with libreadline." ON)    OPTION (PCRE_SUPPORT_LIBREADLINE  "Enable support for linking pcretest with libreadline." ON)
# Line 218  IF(NOT BUILD_SHARED_LIBS) Line 241  IF(NOT BUILD_SHARED_LIBS)
241          SET(PCRE_STATIC 1)          SET(PCRE_STATIC 1)
242  ENDIF(NOT BUILD_SHARED_LIBS)  ENDIF(NOT BUILD_SHARED_LIBS)
243    
244  IF(NOT PCRE_BUILD_PCRE8 AND NOT PCRE_BUILD_PCRE16)  IF(NOT PCRE_BUILD_PCRE8 AND NOT PCRE_BUILD_PCRE16 AND NOT PCRE_BUILD_PCRE32)
245          MESSAGE(FATAL_ERROR "Either PCRE_BUILD_PCRE8 or PCRE_BUILD_PCRE16 must be enabled")          MESSAGE(FATAL_ERROR "At least one of PCRE_BUILD_PCRE8, PCRE_BUILD_PCRE16 or PCRE_BUILD_PCRE32 must be enabled")
246  ENDIF(NOT PCRE_BUILD_PCRE8 AND NOT PCRE_BUILD_PCRE16)  ENDIF(NOT PCRE_BUILD_PCRE8 AND NOT PCRE_BUILD_PCRE16 AND NOT PCRE_BUILD_PCRE32)
247    
248  IF(PCRE_BUILD_PCRE8)  IF(PCRE_BUILD_PCRE8)
249          SET(SUPPORT_PCRE8 1)          SET(SUPPORT_PCRE8 1)
# Line 230  IF(PCRE_BUILD_PCRE16) Line 253  IF(PCRE_BUILD_PCRE16)
253          SET(SUPPORT_PCRE16 1)          SET(SUPPORT_PCRE16 1)
254  ENDIF(PCRE_BUILD_PCRE16)  ENDIF(PCRE_BUILD_PCRE16)
255    
256    IF(PCRE_BUILD_PCRE32)
257            SET(SUPPORT_PCRE32 1)
258    ENDIF(PCRE_BUILD_PCRE32)
259    
260  IF(PCRE_BUILD_PCRECPP AND NOT PCRE_BUILD_PCRE8)  IF(PCRE_BUILD_PCRECPP AND NOT PCRE_BUILD_PCRE8)
261          MESSAGE(STATUS "** PCRE_BUILD_PCRE8 must be enabled for the C++ library support")          MESSAGE(STATUS "** PCRE_BUILD_PCRE8 must be enabled for the C++ library support")
262          SET(PCRE_BUILD_PCRECPP OFF)          SET(PCRE_BUILD_PCRECPP OFF)
# Line 240  IF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUIL Line 267  IF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUIL
267          SET(PCRE_BUILD_PCREGREP OFF)          SET(PCRE_BUILD_PCREGREP OFF)
268  ENDIF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUILD_PCRE8)  ENDIF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUILD_PCRE8)
269    
270    IF(PCRE_SUPPORT_LIBREADLINE AND PCRE_SUPPORT_LIBEDIT)
271            MESSAGE(FATAL_ERROR "Only one of libreadline or libeditline can be specified")
272    ENDIF(PCRE_SUPPORT_LIBREADLINE AND PCRE_SUPPORT_LIBEDIT)
273    
274  IF(PCRE_SUPPORT_BSR_ANYCRLF)  IF(PCRE_SUPPORT_BSR_ANYCRLF)
275          SET(BSR_ANYCRLF 1)          SET(BSR_ANYCRLF 1)
276  ENDIF(PCRE_SUPPORT_BSR_ANYCRLF)  ENDIF(PCRE_SUPPORT_BSR_ANYCRLF)
277    
278  IF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)  IF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UNICODE_PROPERTIES)
279          SET(SUPPORT_UTF 1)          SET(SUPPORT_UTF 1)
280          SET(PCRE_SUPPORT_UTF ON)          SET(PCRE_SUPPORT_UTF ON)
281  ENDIF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)  ENDIF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UNICODE_PROPERTIES)
282    
283  IF(PCRE_SUPPORT_UNICODE_PROPERTIES)  IF(PCRE_SUPPORT_UNICODE_PROPERTIES)
284          SET(SUPPORT_UCP 1)          SET(SUPPORT_UCP 1)
# Line 261  IF(PCRE_SUPPORT_PCREGREP_JIT) Line 292  IF(PCRE_SUPPORT_PCREGREP_JIT)
292          SET(SUPPORT_PCREGREP_JIT 1)          SET(SUPPORT_PCREGREP_JIT 1)
293  ENDIF(PCRE_SUPPORT_PCREGREP_JIT)  ENDIF(PCRE_SUPPORT_PCREGREP_JIT)
294    
295    IF(PCRE_SUPPORT_VALGRIND)
296            SET(SUPPORT_VALGRIND 1)
297    ENDIF(PCRE_SUPPORT_VALGRIND)
298    
299    IF(PCRE_SUPPORT_COVERAGE)
300            SET(SUPPORT_GCOV 1)
301            IF(NOT CMAKE_COMPILER_IS_GNUCC)
302                MESSAGE(FATAL_ERROR "Code coverage reports can only be generated when using GCC")
303            ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
304    ENDIF(PCRE_SUPPORT_COVERAGE)
305    
306  # This next one used to contain  # This next one used to contain
307  #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})  #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})
308  # 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 272  IF(PCRE_SUPPORT_LIBREADLINE) Line 314  IF(PCRE_SUPPORT_LIBREADLINE)
314          SET(PCRETEST_LIBS ${READLINE_LIBRARY} ${NCURSES_LIBRARY})          SET(PCRETEST_LIBS ${READLINE_LIBRARY} ${NCURSES_LIBRARY})
315  ENDIF(PCRE_SUPPORT_LIBREADLINE)  ENDIF(PCRE_SUPPORT_LIBREADLINE)
316    
317    # libedit is a plug-compatible alternative to libreadline
318    
319    IF(PCRE_SUPPORT_LIBEDIT)
320            SET(SUPPORT_LIBEDIT 1)
321            SET(PCRETEST_LIBS ${EDITLINE_LIBRARY} ${NCURSES_LIBRARY})
322    ENDIF(PCRE_SUPPORT_LIBEDIT)
323    
324  IF(PCRE_SUPPORT_LIBZ)  IF(PCRE_SUPPORT_LIBZ)
325          SET(SUPPORT_LIBZ 1)          SET(SUPPORT_LIBZ 1)
326          SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${ZLIB_LIBRARIES})          SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${ZLIB_LIBRARIES})
# Line 306  ENDIF(NEWLINE STREQUAL "") Line 355  ENDIF(NEWLINE STREQUAL "")
355    
356  IF(PCRE_EBCDIC)  IF(PCRE_EBCDIC)
357          SET(EBCDIC 1)          SET(EBCDIC 1)
358    IF(PCRE_NEWLINE STREQUAL "LF")
359            SET(NEWLINE "21")
360    ENDIF(PCRE_NEWLINE STREQUAL "LF")
361    IF(PCRE_NEWLINE STREQUAL "CRLF")
362            SET(NEWLINE "3349")
363    ENDIF(PCRE_NEWLINE STREQUAL "CRLF")
364  ENDIF(PCRE_EBCDIC)  ENDIF(PCRE_EBCDIC)
365    
366    IF(PCRE_EBCDIC_NL25)
367            SET(EBCDIC 1)
368            SET(EBCDIC_NL25 1)
369    IF(PCRE_NEWLINE STREQUAL "LF")
370            SET(NEWLINE "37")
371    ENDIF(PCRE_NEWLINE STREQUAL "LF")
372    IF(PCRE_NEWLINE STREQUAL "CRLF")
373            SET(NEWLINE "3365")
374    ENDIF(PCRE_NEWLINE STREQUAL "CRLF")
375    ENDIF(PCRE_EBCDIC_NL25)
376    
377  IF(PCRE_NO_RECURSE)  IF(PCRE_NO_RECURSE)
378          SET(NO_RECURSE 1)          SET(NO_RECURSE 1)
379  ENDIF(PCRE_NO_RECURSE)  ENDIF(PCRE_NO_RECURSE)
# Line 317  CONFIGURE_FILE(config-cmake.h.in Line 383  CONFIGURE_FILE(config-cmake.h.in
383                 ${PROJECT_BINARY_DIR}/config.h                 ${PROJECT_BINARY_DIR}/config.h
384                 @ONLY)                 @ONLY)
385    
386  CONFIGURE_FILE(pcre.h.generic  # Parse version numbers and date out of configure.ac
387    
388    file(STRINGS ${PROJECT_SOURCE_DIR}/configure.ac
389      configure_lines
390      LIMIT_COUNT 50 # Read only the first 50 lines of the file
391    )
392    
393    set(SEARCHED_VARIABLES "pcre_major" "pcre_minor" "pcre_prerelease" "pcre_date")
394    foreach(configure_line ${configure_lines})
395        foreach(_substitution_variable ${SEARCHED_VARIABLES})
396            string(TOUPPER ${_substitution_variable} _substitution_variable_upper)
397            if (NOT ${_substitution_variable_upper})
398                string(REGEX MATCH "m4_define\\(${_substitution_variable}, \\[(.*)\\]" MACTHED_STRING ${configure_line})
399                if (CMAKE_MATCH_1)
400                    set(${_substitution_variable_upper} ${CMAKE_MATCH_1})
401                endif()
402            endif()
403        endforeach()
404    endforeach()
405    
406    CONFIGURE_FILE(pcre.h.in
407                 ${PROJECT_BINARY_DIR}/pcre.h                 ${PROJECT_BINARY_DIR}/pcre.h
408                 COPYONLY)                 @ONLY)
409    
410  # What about pcre-config and libpcre.pc?  # What about pcre-config and libpcre.pc?
411    
# Line 374  SET(PCRE_SOURCES Line 460  SET(PCRE_SOURCES
460    pcre_newline.c    pcre_newline.c
461    pcre_ord2utf8.c    pcre_ord2utf8.c
462    pcre_refcount.c    pcre_refcount.c
463    pcre_string_utils.c    pcre_string_utils.c
464    pcre_study.c    pcre_study.c
465    pcre_tables.c    pcre_tables.c
466    pcre_ucd.c    pcre_ucd.c
# Line 416  SET(PCRE16_SOURCES Line 502  SET(PCRE16_SOURCES
502  )  )
503  ENDIF(PCRE_BUILD_PCRE16)  ENDIF(PCRE_BUILD_PCRE16)
504    
505    IF(PCRE_BUILD_PCRE32)
506    SET(PCRE32_SOURCES
507      pcre32_byte_order.c
508      pcre32_chartables.c
509      pcre32_compile.c
510      pcre32_config.c
511      pcre32_dfa_exec.c
512      pcre32_exec.c
513      pcre32_fullinfo.c
514      pcre32_get.c
515      pcre32_globals.c
516      pcre32_jit_compile.c
517      pcre32_maketables.c
518      pcre32_newline.c
519      pcre32_ord2utf32.c
520      pcre32_refcount.c
521      pcre32_string_utils.c
522      pcre32_study.c
523      pcre32_tables.c
524      pcre32_ucd.c
525      pcre32_utf32_utils.c
526      pcre32_valid_utf32.c
527      pcre32_version.c
528      pcre32_xclass.c
529    )
530    ENDIF(PCRE_BUILD_PCRE32)
531    
532  IF(MINGW AND NOT PCRE_STATIC)  IF(MINGW AND NOT PCRE_STATIC)
533  IF (EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc)  IF (EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc)
534  ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/pcre.o  ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/pcre.o
# Line 514  ENDIF(MINGW AND NOT PCRE_STATIC) Line 627  ENDIF(MINGW AND NOT PCRE_STATIC)
627    
628  ENDIF(PCRE_BUILD_PCRE16)  ENDIF(PCRE_BUILD_PCRE16)
629    
630    IF(PCRE_BUILD_PCRE32)
631    ADD_LIBRARY(pcre32 ${PCRE_HEADERS} ${PCRE32_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
632    SET(targets ${targets} pcre32)
633    
634    IF(MINGW AND NOT PCRE_STATIC)
635      IF(NON_STANDARD_LIB_PREFIX)
636        SET_TARGET_PROPERTIES(pcre32
637                            PROPERTIES PREFIX ""
638        )
639      ENDIF(NON_STANDARD_LIB_PREFIX)
640    
641      IF(NON_STANDARD_LIB_SUFFIX)
642        SET_TARGET_PROPERTIES(pcre32
643                            PROPERTIES SUFFIX "-0.dll"
644        )
645      ENDIF(NON_STANDARD_LIB_SUFFIX)
646    ENDIF(MINGW AND NOT PCRE_STATIC)
647    
648    ENDIF(PCRE_BUILD_PCRE32)
649    
650  # pcrecpp  # pcrecpp
651  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCRECPP)
652  ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})  ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})
# Line 564  IF(PCRE_BUILD_TESTS) Line 697  IF(PCRE_BUILD_TESTS)
697    IF(PCRE_BUILD_PCRE16)    IF(PCRE_BUILD_PCRE16)
698      LIST(APPEND PCRETEST_SOURCES pcre16_printint.c)      LIST(APPEND PCRETEST_SOURCES pcre16_printint.c)
699    ENDIF(PCRE_BUILD_PCRE16)    ENDIF(PCRE_BUILD_PCRE16)
700      IF(PCRE_BUILD_PCRE32)
701        LIST(APPEND PCRETEST_SOURCES pcre32_printint.c)
702      ENDIF(PCRE_BUILD_PCRE32)
703    
704    ADD_EXECUTABLE(pcretest ${PCRETEST_SOURCES})    ADD_EXECUTABLE(pcretest ${PCRETEST_SOURCES})
705    SET(targets ${targets} pcretest)    SET(targets ${targets} pcretest)
# Line 573  IF(PCRE_BUILD_TESTS) Line 709  IF(PCRE_BUILD_TESTS)
709    IF(PCRE_BUILD_PCRE16)    IF(PCRE_BUILD_PCRE16)
710      LIST(APPEND PCRETEST_LIBS pcre16)      LIST(APPEND PCRETEST_LIBS pcre16)
711    ENDIF(PCRE_BUILD_PCRE16)    ENDIF(PCRE_BUILD_PCRE16)
712      IF(PCRE_BUILD_PCRE32)
713        LIST(APPEND PCRETEST_LIBS pcre32)
714      ENDIF(PCRE_BUILD_PCRE32)
715    TARGET_LINK_LIBRARIES(pcretest ${PCRETEST_LIBS})    TARGET_LINK_LIBRARIES(pcretest ${PCRETEST_LIBS})
716    
717    IF(PCRE_SUPPORT_JIT)    IF(PCRE_SUPPORT_JIT)
# Line 585  IF(PCRE_BUILD_TESTS) Line 724  IF(PCRE_BUILD_TESTS)
724      IF(PCRE_BUILD_PCRE16)      IF(PCRE_BUILD_PCRE16)
725        LIST(APPEND PCRE_JIT_TEST_LIBS pcre16)        LIST(APPEND PCRE_JIT_TEST_LIBS pcre16)
726      ENDIF(PCRE_BUILD_PCRE16)      ENDIF(PCRE_BUILD_PCRE16)
727        IF(PCRE_BUILD_PCRE32)
728          LIST(APPEND PCRE_JIT_TEST_LIBS pcre32)
729        ENDIF(PCRE_BUILD_PCRE32)
730      TARGET_LINK_LIBRARIES(pcre_jit_test ${PCRE_JIT_TEST_LIBS})      TARGET_LINK_LIBRARIES(pcre_jit_test ${PCRE_JIT_TEST_LIBS})
731    ENDIF(PCRE_SUPPORT_JIT)    ENDIF(PCRE_SUPPORT_JIT)
732    
# Line 621  IF(PCRE_BUILD_TESTS) Line 763  IF(PCRE_BUILD_TESTS)
763    FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest    FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest
764    "# This is a generated file.    "# This is a generated file.
765  MESSAGE(\"When testing is complete, review test output in the  MESSAGE(\"When testing is complete, review test output in the
766  ${PROJECT_BINARY_DIR}/Testing/Temporary folder.\")  \\\"${PROJECT_BINARY_DIR}/Testing/Temporary\\\" folder.\")
767  MESSAGE(\"\")  MESSAGE(\" \")
768  ")  ")
769    
770    FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.sh    FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.sh
# Line 658  if test \"$?\" != \"0\"; then exit 1; fi Line 800  if test \"$?\" != \"0\"; then exit 1; fi
800    
801    IF(WIN32)    IF(WIN32)
802      # Provide environment for executing the bat file version of RunTest      # Provide environment for executing the bat file version of RunTest
803      string(REPLACE "/" "\\" winsrc "${PROJECT_SOURCE_DIR}")      FILE(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} winsrc)
804        FILE(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} winbin)
805        FILE(TO_NATIVE_PATH ${PCRETEST_EXE} winexe)
806    
807      FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.txt      FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.bat
808      "\@REM This is a generated file.      "\@REM This is a generated file.
809  \@Echo off  \@echo off
810  setlocal  setlocal
811  SET\ srcdir=\${srcdir}  SET srcdir=\"${winsrc}\"
812  SET\ pcretest=\${pcretest}  SET pcretest=\"${winexe}\"
813  call \"\${srcdir}\\RunTest.Bat\"  if not [%CMAKE_CONFIG_TYPE%]==[] SET pcretest=\"${winbin}\\%CMAKE_CONFIG_TYPE%\\pcretest.exe\"
814    call %srcdir%\\RunTest.Bat
815  if errorlevel 1 exit /b 1  if errorlevel 1 exit /b 1
816  echo RunTest.bat tests successfully completed  echo RunTest.bat tests successfully completed
817  ")  ")
818    
   FILE(WRITE ${PROJECT_BINARY_DIR}/BatDriver.cmake  
   "# This is a generated file.  
 # this script is run with arguments via the cmake command in add_test(NAME pcre_test_bat)  
 # BatDriver feeds the actual location of pcretest.exe  
 FILE(TO_NATIVE_PATH \${pcretestx} pcretest)  
 FILE(TO_NATIVE_PATH \${srcdirx} srcdir)  
 configure_file(\"\${bindirx}/pcre_test.txt\" \"\${bindirx}/pcre_test.bat\")  
 # MESSAGE(\"cmake\ variable\ pcretest\ is\ \${pcretest}\")  
 # STRING(REPLACE \" \" \"\\ \" bindir \${bindirx})  
 MESSAGE(\"COMMAND pcre_test.bat \")  
 EXECUTE_PROCESS(COMMAND pcre_test.bat  
 WORKING_DIRECTORY .  
 OUTPUT_VARIABLE batoutput)  
 MESSAGE(\"OUTPUT: \${batoutput}\")  
 ")  
   
819    ADD_TEST(NAME pcre_test_bat    ADD_TEST(NAME pcre_test_bat
820    COMMAND ${CMAKE_COMMAND} -D bindirx=${PROJECT_BINARY_DIR} -D srcdirx=${PROJECT_SOURCE_DIR} -D pcretestx=$<TARGET_FILE:pcretest> -P "${PROJECT_BINARY_DIR}/BatDriver.cmake")    COMMAND pcre_test.bat)
821    SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES    SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES
822    PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed")    PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed")
823    
# Line 775  IF(PCRE_SHOW_REPORT) Line 904  IF(PCRE_SHOW_REPORT)
904    MESSAGE(STATUS "")    MESSAGE(STATUS "")
905    MESSAGE(STATUS "  Build 8 bit PCRE library ........ : ${PCRE_BUILD_PCRE8}")    MESSAGE(STATUS "  Build 8 bit PCRE library ........ : ${PCRE_BUILD_PCRE8}")
906    MESSAGE(STATUS "  Build 16 bit PCRE library ....... : ${PCRE_BUILD_PCRE16}")    MESSAGE(STATUS "  Build 16 bit PCRE library ....... : ${PCRE_BUILD_PCRE16}")
907      MESSAGE(STATUS "  Build 32 bit PCRE library ....... : ${PCRE_BUILD_PCRE32}")
908    MESSAGE(STATUS "  Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")    MESSAGE(STATUS "  Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")
909    MESSAGE(STATUS "  Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}")    MESSAGE(STATUS "  Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}")
910    MESSAGE(STATUS "  Enable UTF support .............. : ${PCRE_SUPPORT_UTF}")    MESSAGE(STATUS "  Enable UTF support .............. : ${PCRE_SUPPORT_UTF}")
# Line 782  IF(PCRE_SHOW_REPORT) Line 912  IF(PCRE_SHOW_REPORT)
912    MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE_NEWLINE}")    MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE_NEWLINE}")
913    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")
914    MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE_EBCDIC}")    MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE_EBCDIC}")
915      MESSAGE(STATUS "  EBCDIC coding with NL=0x25 ...... : ${PCRE_EBCDIC_NL25}")
916    MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")    MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")
917    MESSAGE(STATUS "  No stack recursion .............. : ${PCRE_NO_RECURSE}")    MESSAGE(STATUS "  No stack recursion .............. : ${PCRE_NO_RECURSE}")
918    MESSAGE(STATUS "  POSIX mem threshold ............. : ${PCRE_POSIX_MALLOC_THRESHOLD}")    MESSAGE(STATUS "  POSIX mem threshold ............. : ${PCRE_POSIX_MALLOC_THRESHOLD}")
# Line 798  IF(PCRE_SHOW_REPORT) Line 929  IF(PCRE_SHOW_REPORT)
929    IF(ZLIB_FOUND)    IF(ZLIB_FOUND)
930      MESSAGE(STATUS "  Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")      MESSAGE(STATUS "  Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")
931    ELSE(ZLIB_FOUND)    ELSE(ZLIB_FOUND)
932      MESSAGE(STATUS "  Link pcregrep with libz ......... : None" )      MESSAGE(STATUS "  Link pcregrep with libz ......... : Library not found" )
933    ENDIF(ZLIB_FOUND)    ENDIF(ZLIB_FOUND)
934    IF(BZIP2_FOUND)    IF(BZIP2_FOUND)
935      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")
936    ELSE(BZIP2_FOUND)    ELSE(BZIP2_FOUND)
937      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : None" )      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : Library not found" )
938    ENDIF(BZIP2_FOUND)    ENDIF(BZIP2_FOUND)
939    IF(NOT PCRE_SUPPORT_LIBREADLINE)    IF(EDITLINE_FOUND)
940      MESSAGE(STATUS "  Link pcretest with libreadline .. : None" )      MESSAGE(STATUS "  Link pcretest with libeditline .. : ${PCRE_SUPPORT_LIBEDIT}")
941    ELSE(NOT PCRE_SUPPORT_LIBREADLINE)    ELSE(EDITLINE_FOUND)
942        MESSAGE(STATUS "  Link pcretest with libeditline .. : Library not found" )
943      ENDIF(EDITLINE_FOUND)
944      IF(READLINE_FOUND)
945      MESSAGE(STATUS "  Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")      MESSAGE(STATUS "  Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")
946    ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)    ELSE(READLINE_FOUND)
947        MESSAGE(STATUS "  Link pcretest with libreadline .. : Library not found" )
948      ENDIF(READLINE_FOUND)
949      MESSAGE(STATUS "  Support Valgrind .................: ${PCRE_SUPPORT_VALGRIND}")
950      MESSAGE(STATUS "  Support coverage .................: ${PCRE_SUPPORT_COVERAGE}")
951    
952    IF(MINGW AND NOT PCRE_STATIC)    IF(MINGW AND NOT PCRE_STATIC)
953      MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")      MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
954      MESSAGE(STATUS "  Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}")      MESSAGE(STATUS "  Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}")

Legend:
Removed from v.864  
changed lines
  Added in v.1221

  ViewVC Help
Powered by ViewVC 1.1.5