/[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 1234 by ph10, Sat Dec 8 16:35:42 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    # 2012-12-08 PH added patch from Daniel Richard G to quash some MSVC warnings
64    
65  PROJECT(PCRE C CXX)  PROJECT(PCRE C CXX)
66    
# Line 67  SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_D Line 74  SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_D
74  FIND_PACKAGE( BZip2 )  FIND_PACKAGE( BZip2 )
75  FIND_PACKAGE( ZLIB )  FIND_PACKAGE( ZLIB )
76  FIND_PACKAGE( Readline )  FIND_PACKAGE( Readline )
77    FIND_PACKAGE( Editline )
78    
79  # Configuration checks  # Configuration checks
80    
# Line 108  OPTION(PCRE_BUILD_PCRE8 "Build 8 bit PCR Line 116  OPTION(PCRE_BUILD_PCRE8 "Build 8 bit PCR
116    
117  OPTION(PCRE_BUILD_PCRE16 "Build 16 bit PCRE library" OFF)  OPTION(PCRE_BUILD_PCRE16 "Build 16 bit PCRE library" OFF)
118    
119    OPTION(PCRE_BUILD_PCRE32 "Build 32 bit PCRE library" OFF)
120    
121  OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON)  OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON)
122    
123  SET(PCRE_EBCDIC OFF CACHE BOOL  SET(PCRE_EBCDIC OFF CACHE BOOL
124      "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.)")
125    
126    SET(PCRE_EBCDIC_NL25 OFF CACHE BOOL
127        "Use 0x25 as EBCDIC NL character instead of 0x15; implies EBCDIC.")
128    
129  SET(PCRE_LINK_SIZE "2" CACHE STRING  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.")      "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 154  SET(PCRE_SUPPORT_PCREGREP_JIT ON CACHE B
154      "Enable use of Just-in-time compiling in pcregrep.")      "Enable use of Just-in-time compiling in pcregrep.")
155    
156  SET(PCRE_SUPPORT_UTF OFF CACHE BOOL  SET(PCRE_SUPPORT_UTF OFF CACHE BOOL
157      "Enable support for the Unicode Transformation Format (UTF) encoding.")      "Enable support for Unicode Transformation Format (UTF-8/UTF-16/UTF-32) encoding.")
158    
159  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL
160      "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.")  
161    
162  SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL  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")      "ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks")
164    
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    
171  OPTION(PCRE_SHOW_REPORT    "Show the final configuration report" ON)  OPTION(PCRE_SHOW_REPORT    "Show the final configuration report" ON)
172  OPTION(PCRE_BUILD_PCREGREP "Build pcregrep" ON)  OPTION(PCRE_BUILD_PCREGREP "Build pcregrep" ON)
173  OPTION(PCRE_BUILD_TESTS    "Build the tests" ON)  OPTION(PCRE_BUILD_TESTS    "Build the tests" ON)
# Line 182  IF(PCRE_SUPPORT_LIBZ) Line 198  IF(PCRE_SUPPORT_LIBZ)
198    INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})    INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
199  ENDIF(PCRE_SUPPORT_LIBZ)  ENDIF(PCRE_SUPPORT_LIBZ)
200    
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    
209  # readline lib  # readline lib
210  IF(READLINE_FOUND)  IF(READLINE_FOUND)
211    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 242  IF(NOT BUILD_SHARED_LIBS)
242          SET(PCRE_STATIC 1)          SET(PCRE_STATIC 1)
243  ENDIF(NOT BUILD_SHARED_LIBS)  ENDIF(NOT BUILD_SHARED_LIBS)
244    
245  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)
246          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")
247  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)
248    
249  IF(PCRE_BUILD_PCRE8)  IF(PCRE_BUILD_PCRE8)
250          SET(SUPPORT_PCRE8 1)          SET(SUPPORT_PCRE8 1)
# Line 230  IF(PCRE_BUILD_PCRE16) Line 254  IF(PCRE_BUILD_PCRE16)
254          SET(SUPPORT_PCRE16 1)          SET(SUPPORT_PCRE16 1)
255  ENDIF(PCRE_BUILD_PCRE16)  ENDIF(PCRE_BUILD_PCRE16)
256    
257    IF(PCRE_BUILD_PCRE32)
258            SET(SUPPORT_PCRE32 1)
259    ENDIF(PCRE_BUILD_PCRE32)
260    
261  IF(PCRE_BUILD_PCRECPP AND NOT PCRE_BUILD_PCRE8)  IF(PCRE_BUILD_PCRECPP AND NOT PCRE_BUILD_PCRE8)
262          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")
263          SET(PCRE_BUILD_PCRECPP OFF)          SET(PCRE_BUILD_PCRECPP OFF)
# Line 240  IF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUIL Line 268  IF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUIL
268          SET(PCRE_BUILD_PCREGREP OFF)          SET(PCRE_BUILD_PCREGREP OFF)
269  ENDIF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUILD_PCRE8)  ENDIF(PCRE_BUILD_PCREGREP AND NOT PCRE_BUILD_PCRE8)
270    
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    
275  IF(PCRE_SUPPORT_BSR_ANYCRLF)  IF(PCRE_SUPPORT_BSR_ANYCRLF)
276          SET(BSR_ANYCRLF 1)          SET(BSR_ANYCRLF 1)
277  ENDIF(PCRE_SUPPORT_BSR_ANYCRLF)  ENDIF(PCRE_SUPPORT_BSR_ANYCRLF)
278    
279  IF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)  IF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UNICODE_PROPERTIES)
280          SET(SUPPORT_UTF 1)          SET(SUPPORT_UTF 1)
281          SET(PCRE_SUPPORT_UTF ON)          SET(PCRE_SUPPORT_UTF ON)
282  ENDIF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)  ENDIF(PCRE_SUPPORT_UTF OR PCRE_SUPPORT_UNICODE_PROPERTIES)
283    
284  IF(PCRE_SUPPORT_UNICODE_PROPERTIES)  IF(PCRE_SUPPORT_UNICODE_PROPERTIES)
285          SET(SUPPORT_UCP 1)          SET(SUPPORT_UCP 1)
# Line 261  IF(PCRE_SUPPORT_PCREGREP_JIT) Line 293  IF(PCRE_SUPPORT_PCREGREP_JIT)
293          SET(SUPPORT_PCREGREP_JIT 1)          SET(SUPPORT_PCREGREP_JIT 1)
294  ENDIF(PCRE_SUPPORT_PCREGREP_JIT)  ENDIF(PCRE_SUPPORT_PCREGREP_JIT)
295    
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    
307  # This next one used to contain  # This next one used to contain
308  #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})  #       SET(PCRETEST_LIBS ${READLINE_LIBRARY})
309  # 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 315  IF(PCRE_SUPPORT_LIBREADLINE)
315          SET(PCRETEST_LIBS ${READLINE_LIBRARY} ${NCURSES_LIBRARY})          SET(PCRETEST_LIBS ${READLINE_LIBRARY} ${NCURSES_LIBRARY})
316  ENDIF(PCRE_SUPPORT_LIBREADLINE)  ENDIF(PCRE_SUPPORT_LIBREADLINE)
317    
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    
325  IF(PCRE_SUPPORT_LIBZ)  IF(PCRE_SUPPORT_LIBZ)
326          SET(SUPPORT_LIBZ 1)          SET(SUPPORT_LIBZ 1)
327          SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${ZLIB_LIBRARIES})          SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${ZLIB_LIBRARIES})
# Line 306  ENDIF(NEWLINE STREQUAL "") Line 356  ENDIF(NEWLINE STREQUAL "")
356    
357  IF(PCRE_EBCDIC)  IF(PCRE_EBCDIC)
358          SET(EBCDIC 1)          SET(EBCDIC 1)
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")
365  ENDIF(PCRE_EBCDIC)  ENDIF(PCRE_EBCDIC)
366    
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    
378  IF(PCRE_NO_RECURSE)  IF(PCRE_NO_RECURSE)
379          SET(NO_RECURSE 1)          SET(NO_RECURSE 1)
380  ENDIF(PCRE_NO_RECURSE)  ENDIF(PCRE_NO_RECURSE)
# Line 317  CONFIGURE_FILE(config-cmake.h.in Line 384  CONFIGURE_FILE(config-cmake.h.in
384                 ${PROJECT_BINARY_DIR}/config.h                 ${PROJECT_BINARY_DIR}/config.h
385                 @ONLY)                 @ONLY)
386    
387  CONFIGURE_FILE(pcre.h.generic  # 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
408                 ${PROJECT_BINARY_DIR}/pcre.h                 ${PROJECT_BINARY_DIR}/pcre.h
409                 COPYONLY)                 @ONLY)
410    
411  # What about pcre-config and libpcre.pc?  # What about pcre-config and libpcre.pc?
412    
# Line 374  SET(PCRE_SOURCES Line 461  SET(PCRE_SOURCES
461    pcre_newline.c    pcre_newline.c
462    pcre_ord2utf8.c    pcre_ord2utf8.c
463    pcre_refcount.c    pcre_refcount.c
464    pcre_string_utils.c    pcre_string_utils.c
465    pcre_study.c    pcre_study.c
466    pcre_tables.c    pcre_tables.c
467    pcre_ucd.c    pcre_ucd.c
# Line 416  SET(PCRE16_SOURCES Line 503  SET(PCRE16_SOURCES
503  )  )
504  ENDIF(PCRE_BUILD_PCRE16)  ENDIF(PCRE_BUILD_PCRE16)
505    
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    
533  IF(MINGW AND NOT PCRE_STATIC)  IF(MINGW AND NOT PCRE_STATIC)
534  IF (EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc)  IF (EXISTS ${PROJECT_SOURCE_DIR}/pcre.rc)
535  ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/pcre.o  ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/pcre.o
# Line 457  SET(PCRECPP_SOURCES Line 571  SET(PCRECPP_SOURCES
571  ADD_DEFINITIONS(-DHAVE_CONFIG_H)  ADD_DEFINITIONS(-DHAVE_CONFIG_H)
572    
573  IF(MSVC)  IF(MSVC)
574          ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)          ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
575  ENDIF(MSVC)  ENDIF(MSVC)
576    
577  SET(CMAKE_INCLUDE_CURRENT_DIR 1)  SET(CMAKE_INCLUDE_CURRENT_DIR 1)
# Line 514  ENDIF(MINGW AND NOT PCRE_STATIC) Line 628  ENDIF(MINGW AND NOT PCRE_STATIC)
628    
629  ENDIF(PCRE_BUILD_PCRE16)  ENDIF(PCRE_BUILD_PCRE16)
630    
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    
651  # pcrecpp  # pcrecpp
652  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCRECPP)
653  ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})  ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})
# Line 564  IF(PCRE_BUILD_TESTS) Line 698  IF(PCRE_BUILD_TESTS)
698    IF(PCRE_BUILD_PCRE16)    IF(PCRE_BUILD_PCRE16)
699      LIST(APPEND PCRETEST_SOURCES pcre16_printint.c)      LIST(APPEND PCRETEST_SOURCES pcre16_printint.c)
700    ENDIF(PCRE_BUILD_PCRE16)    ENDIF(PCRE_BUILD_PCRE16)
701      IF(PCRE_BUILD_PCRE32)
702        LIST(APPEND PCRETEST_SOURCES pcre32_printint.c)
703      ENDIF(PCRE_BUILD_PCRE32)
704    
705    ADD_EXECUTABLE(pcretest ${PCRETEST_SOURCES})    ADD_EXECUTABLE(pcretest ${PCRETEST_SOURCES})
706    SET(targets ${targets} pcretest)    SET(targets ${targets} pcretest)
# Line 573  IF(PCRE_BUILD_TESTS) Line 710  IF(PCRE_BUILD_TESTS)
710    IF(PCRE_BUILD_PCRE16)    IF(PCRE_BUILD_PCRE16)
711      LIST(APPEND PCRETEST_LIBS pcre16)      LIST(APPEND PCRETEST_LIBS pcre16)
712    ENDIF(PCRE_BUILD_PCRE16)    ENDIF(PCRE_BUILD_PCRE16)
713      IF(PCRE_BUILD_PCRE32)
714        LIST(APPEND PCRETEST_LIBS pcre32)
715      ENDIF(PCRE_BUILD_PCRE32)
716    TARGET_LINK_LIBRARIES(pcretest ${PCRETEST_LIBS})    TARGET_LINK_LIBRARIES(pcretest ${PCRETEST_LIBS})
717    
718    IF(PCRE_SUPPORT_JIT)    IF(PCRE_SUPPORT_JIT)
# Line 585  IF(PCRE_BUILD_TESTS) Line 725  IF(PCRE_BUILD_TESTS)
725      IF(PCRE_BUILD_PCRE16)      IF(PCRE_BUILD_PCRE16)
726        LIST(APPEND PCRE_JIT_TEST_LIBS pcre16)        LIST(APPEND PCRE_JIT_TEST_LIBS pcre16)
727      ENDIF(PCRE_BUILD_PCRE16)      ENDIF(PCRE_BUILD_PCRE16)
728        IF(PCRE_BUILD_PCRE32)
729          LIST(APPEND PCRE_JIT_TEST_LIBS pcre32)
730        ENDIF(PCRE_BUILD_PCRE32)
731      TARGET_LINK_LIBRARIES(pcre_jit_test ${PCRE_JIT_TEST_LIBS})      TARGET_LINK_LIBRARIES(pcre_jit_test ${PCRE_JIT_TEST_LIBS})
732    ENDIF(PCRE_SUPPORT_JIT)    ENDIF(PCRE_SUPPORT_JIT)
733    
# Line 621  IF(PCRE_BUILD_TESTS) Line 764  IF(PCRE_BUILD_TESTS)
764    FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest    FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest
765    "# This is a generated file.    "# This is a generated file.
766  MESSAGE(\"When testing is complete, review test output in the  MESSAGE(\"When testing is complete, review test output in the
767  ${PROJECT_BINARY_DIR}/Testing/Temporary folder.\")  \\\"${PROJECT_BINARY_DIR}/Testing/Temporary\\\" folder.\")
768  MESSAGE(\"\")  MESSAGE(\" \")
769  ")  ")
770    
771    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 801  if test \"$?\" != \"0\"; then exit 1; fi
801    
802    IF(WIN32)    IF(WIN32)
803      # Provide environment for executing the bat file version of RunTest      # Provide environment for executing the bat file version of RunTest
804      string(REPLACE "/" "\\" winsrc "${PROJECT_SOURCE_DIR}")      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)
807    
808      FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.txt      FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.bat
809      "\@REM This is a generated file.      "\@REM This is a generated file.
810  \@Echo off  \@echo off
811  setlocal  setlocal
812  SET\ srcdir=\${srcdir}  SET srcdir=\"${winsrc}\"
813  SET\ pcretest=\${pcretest}  SET pcretest=\"${winexe}\"
814  call \"\${srcdir}\\RunTest.Bat\"  if not [%CMAKE_CONFIG_TYPE%]==[] SET pcretest=\"${winbin}\\%CMAKE_CONFIG_TYPE%\\pcretest.exe\"
815    call %srcdir%\\RunTest.Bat
816  if errorlevel 1 exit /b 1  if errorlevel 1 exit /b 1
817  echo RunTest.bat tests successfully completed  echo RunTest.bat tests successfully completed
818  ")  ")
819    
   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}\")  
 ")  
   
820    ADD_TEST(NAME pcre_test_bat    ADD_TEST(NAME pcre_test_bat
821    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)
822    SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES    SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES
823    PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed")    PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed")
824    
# Line 775  IF(PCRE_SHOW_REPORT) Line 905  IF(PCRE_SHOW_REPORT)
905    MESSAGE(STATUS "")    MESSAGE(STATUS "")
906    MESSAGE(STATUS "  Build 8 bit PCRE library ........ : ${PCRE_BUILD_PCRE8}")    MESSAGE(STATUS "  Build 8 bit PCRE library ........ : ${PCRE_BUILD_PCRE8}")
907    MESSAGE(STATUS "  Build 16 bit PCRE library ....... : ${PCRE_BUILD_PCRE16}")    MESSAGE(STATUS "  Build 16 bit PCRE library ....... : ${PCRE_BUILD_PCRE16}")
908      MESSAGE(STATUS "  Build 32 bit PCRE library ....... : ${PCRE_BUILD_PCRE32}")
909    MESSAGE(STATUS "  Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")    MESSAGE(STATUS "  Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")
910    MESSAGE(STATUS "  Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}")    MESSAGE(STATUS "  Enable JIT compiling support .... : ${PCRE_SUPPORT_JIT}")
911    MESSAGE(STATUS "  Enable UTF support .............. : ${PCRE_SUPPORT_UTF}")    MESSAGE(STATUS "  Enable UTF support .............. : ${PCRE_SUPPORT_UTF}")
# Line 782  IF(PCRE_SHOW_REPORT) Line 913  IF(PCRE_SHOW_REPORT)
913    MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE_NEWLINE}")    MESSAGE(STATUS "  Newline char/sequence ........... : ${PCRE_NEWLINE}")
914    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")    MESSAGE(STATUS "  \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")
915    MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE_EBCDIC}")    MESSAGE(STATUS "  EBCDIC coding ................... : ${PCRE_EBCDIC}")
916      MESSAGE(STATUS "  EBCDIC coding with NL=0x25 ...... : ${PCRE_EBCDIC_NL25}")
917    MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")    MESSAGE(STATUS "  Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")
918    MESSAGE(STATUS "  No stack recursion .............. : ${PCRE_NO_RECURSE}")    MESSAGE(STATUS "  No stack recursion .............. : ${PCRE_NO_RECURSE}")
919    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 930  IF(PCRE_SHOW_REPORT)
930    IF(ZLIB_FOUND)    IF(ZLIB_FOUND)
931      MESSAGE(STATUS "  Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")      MESSAGE(STATUS "  Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")
932    ELSE(ZLIB_FOUND)    ELSE(ZLIB_FOUND)
933      MESSAGE(STATUS "  Link pcregrep with libz ......... : None" )      MESSAGE(STATUS "  Link pcregrep with libz ......... : Library not found" )
934    ENDIF(ZLIB_FOUND)    ENDIF(ZLIB_FOUND)
935    IF(BZIP2_FOUND)    IF(BZIP2_FOUND)
936      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")
937    ELSE(BZIP2_FOUND)    ELSE(BZIP2_FOUND)
938      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : None" )      MESSAGE(STATUS "  Link pcregrep with libbz2 ....... : Library not found" )
939    ENDIF(BZIP2_FOUND)    ENDIF(BZIP2_FOUND)
940    IF(NOT PCRE_SUPPORT_LIBREADLINE)    IF(EDITLINE_FOUND)
941      MESSAGE(STATUS "  Link pcretest with libreadline .. : None" )      MESSAGE(STATUS "  Link pcretest with libeditline .. : ${PCRE_SUPPORT_LIBEDIT}")
942    ELSE(NOT PCRE_SUPPORT_LIBREADLINE)    ELSE(EDITLINE_FOUND)
943        MESSAGE(STATUS "  Link pcretest with libeditline .. : Library not found" )
944      ENDIF(EDITLINE_FOUND)
945      IF(READLINE_FOUND)
946      MESSAGE(STATUS "  Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")      MESSAGE(STATUS "  Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")
947    ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)    ELSE(READLINE_FOUND)
948        MESSAGE(STATUS "  Link pcretest with libreadline .. : Library not found" )
949      ENDIF(READLINE_FOUND)
950      MESSAGE(STATUS "  Support Valgrind .................: ${PCRE_SUPPORT_VALGRIND}")
951      MESSAGE(STATUS "  Support coverage .................: ${PCRE_SUPPORT_COVERAGE}")
952    
953    IF(MINGW AND NOT PCRE_STATIC)    IF(MINGW AND NOT PCRE_STATIC)
954      MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")      MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
955      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.1234

  ViewVC Help
Powered by ViewVC 1.1.5