summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt27
-rw-r--r--NON-UNIX-USE58
-rw-r--r--config-cmake.h.in1
3 files changed, 78 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a732fb..960736d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,13 @@
# CMakeLists.txt
#
+#
# This file allows building PCRE with the CMake configuration and build
# tool. Download CMake in source or binary form from http://www.cmake.org/
#
# Original listfile by Christian Ehrlicher <Ch.Ehrlicher@gmx.de>
# Refined and expanded by Daniel Richard G. <skunk@iSKUNK.ORG>
+# 2007-09-14 mod by Sheri so 7.4 supported configuration options can be entered
+# 2007-09-19 Adjusted by PH to retain previous default settings
#
PROJECT(PCRE C CXX)
@@ -56,7 +59,7 @@ SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" CACHE STRING
"Default limit on internal recursion. See MATCH_LIMIT_RECURSION in config.h.in for details.")
SET(PCRE_NEWLINE "LF" CACHE STRING
- "What to recognize as a newline (one of CR, LF, CRLF, ANY).")
+ "What to recognize as a newline (one of CR, LF, CRLF, ANY, ANYCRLF).")
SET(PCRE_NO_RECURSE OFF CACHE BOOL
"If ON, then don't use stack recursion when matching. See NO_RECURSE in config.h.in for details.")
@@ -70,6 +73,9 @@ SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL
SET(PCRE_SUPPORT_UTF8 OFF CACHE BOOL
"Enable support for the Unicode UTF-8 encoding.")
+SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL
+ "ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks")
+
# Prepare build configuration
SET(pcre_have_type_traits 0)
@@ -98,6 +104,10 @@ IF(NOT BUILD_SHARED_LIBS)
SET(PCRE_STATIC 1)
ENDIF(NOT BUILD_SHARED_LIBS)
+IF(PCRE_SUPPORT_BSR_ANYCRLF)
+ SET(BSR_ANYCRLF 1)
+ENDIF(PCRE_SUPPORT_BSR_ANYCRLF)
+
IF(PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)
SET(SUPPORT_UTF8 1)
ENDIF(PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)
@@ -120,9 +130,12 @@ ENDIF(PCRE_NEWLINE STREQUAL "CRLF")
IF(PCRE_NEWLINE STREQUAL "ANY")
SET(NEWLINE "-1")
ENDIF(PCRE_NEWLINE STREQUAL "ANY")
+IF(PCRE_NEWLINE STREQUAL "ANYCRLF")
+ SET(NEWLINE "-2")
+ENDIF(PCRE_NEWLINE STREQUAL "ANYCRLF")
IF(NEWLINE STREQUAL "")
- MESSAGE(FATAL_ERROR "The PCRE_NEWLINE variable must be set to one of the following values: \"LF\", \"CR\", \"CRLF\", \"ANY\".")
+ MESSAGE(FATAL_ERROR "The PCRE_NEWLINE variable must be set to one of the following values: \"LF\", \"CR\", \"CRLF\", \"ANY\", \"ANYCRLF\".")
ENDIF(NEWLINE STREQUAL "")
IF(PCRE_EBCDIC)
@@ -232,6 +245,10 @@ ADD_LIBRARY(pcre ${PCRE_HEADERS} ${PCRE_SOURCES})
ADD_LIBRARY(pcreposix ${PCREPOSIX_HEADERS} ${PCREPOSIX_SOURCES})
TARGET_LINK_LIBRARIES(pcreposix pcre)
+SET_TARGET_PROPERTIES(pcre pcreposix
+ PROPERTIES PREFIX ""
+)
+
IF(PCRE_BUILD_PCRECPP)
ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})
TARGET_LINK_LIBRARIES(pcrecpp pcre)
@@ -317,9 +334,9 @@ FILE(GLOB man3 ${CMAKE_SOURCE_DIR}/doc/*.3)
IF(PCRE_BUILD_PCRECPP)
INSTALL(TARGETS pcrecpp
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include)
ELSE(PCRE_BUILD_PCRECPP)
# Remove pcrecpp.3
diff --git a/NON-UNIX-USE b/NON-UNIX-USE
index 8a98294..c154ff1 100644
--- a/NON-UNIX-USE
+++ b/NON-UNIX-USE
@@ -9,6 +9,7 @@ This document contains the following sections:
Building for virtual Pascal
Stack size in Windows environments
Comments about Win32 builds
+ Building PCRE with Cmake
Building under Windows with BCC5.5
Building PCRE on OpenVMS
@@ -31,8 +32,9 @@ successfully on any system that has a Standard C compiler and library. The C++
wrapper functions are a separate issue (see below).
The PCRE distribution contains some experimental support for "cmake", but this
-is incomplete and not documented. However if you are a "cmake" user you might
-like to try building with "cmake".
+is incomplete and not fully documented. However if you are a "cmake" user you
+might like to try building with "cmake". There are some instructions in the
+section entitled "Building PCRE with Cmake" below.
GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY
@@ -246,6 +248,56 @@ terminators in order to get some of the tests to work. We hope to improve
things in this area in future.
+BUILDING PCRE WITH CMAKE
+
+These instructions were contributed by a PCRE user.
+
+1. Download CMake 2.4.7 or above from http://www.cmake.org/, install and ensure
+ that cmake\bin is on your path.
+
+2. Unzip (retaining folder structure) the PCRE source tree into a source
+ directory such as C:\pcre.
+
+3. Create a new, empty build directory: C:\pcre\build\
+
+4. Run CMakeSetup from the Shell envirornment of your build tool, e.g., Msys
+ for Msys/MinGW or Visual Studio Command Prompt for VC/VC++
+
+5. Enter C:\pcre\pcre-xx and C:\pcre\build for the source and build
+ directories, respectively
+
+6. Hit the "Configure" button.
+
+7. Select the particular IDE / build tool that you are using (Visual Studio,
+ MSYS makefiles, MinGW makefiles, etc.)
+
+8. The GUI will then list several configuration options. This is where you can
+ enable UTF-8 support, etc.
+
+9. Hit "Configure" again. The adjacent "OK" button should now be active.
+
+10. Hit "OK".
+
+11. The build directory should now contain a usable build system, be it a
+ solution file for Visual Studio, makefiles for MinGW, etc.
+
+Testing with RunTest.bat
+
+1. Copy RunTest.bat into the directory where pcretest.exe has been created.
+
+2. Edit RunTest.bat and insert a line that indentifies the relative location of
+ the pcre source, e.g.:
+
+ set srcdir=..\pcre-7.4-RC3
+
+3. Run RunTest.bat from a command shell environment. Test outputs will
+ automatically be compared to expected results, and discrepancies will
+ identified in the console output.
+
+4. To test pcrecpp, run pcrecpp_unittest.exe, pcre_stringpiece_unittest.exe and
+ pcre_scanner_unittest.exe.
+
+
BUILDING UNDER WINDOWS WITH BCC5.5
Michael Roy sent these comments about building PCRE under Windows with BCC5.5:
@@ -258,7 +310,7 @@ Michael Roy sent these comments about building PCRE under Windows with BCC5.5:
When linking a project with BCC5.5, pcre.lib must be included before any of
the libraries cw32.lib, cw32i.lib, cw32mt.lib, and cw32mti.lib on the command
line.
-
+
BUILDING PCRE ON OPENVMS
diff --git a/config-cmake.h.in b/config-cmake.h.in
index 9ca7f5b..27a2d02 100644
--- a/config-cmake.h.in
+++ b/config-cmake.h.in
@@ -16,6 +16,7 @@
#cmakedefine SUPPORT_UTF8
#cmakedefine SUPPORT_UCP
#cmakedefine EBCDIC
+#cmakedefine BSR_ANYCRLF
#cmakedefine NO_RECURSE
#define NEWLINE @NEWLINE@