/[pcre]/code/tags/pcre-7.6/CMakeLists.txt
ViewVC logotype

Diff of /code/tags/pcre-7.6/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 140 by ph10, Fri Mar 30 14:16:42 2007 UTC revision 199 by ph10, Tue Jul 31 14:39:09 2007 UTC
# Line 38  CHECK_TYPE_SIZE("unsigned long long" UNS Line 38  CHECK_TYPE_SIZE("unsigned long long" UNS
38  # (Note: CMakeSetup displays these in alphabetical order, regardless of  # (Note: CMakeSetup displays these in alphabetical order, regardless of
39  # the order we use here)  # the order we use here)
40    
41  SET(BUILD_SHARED_LIBS "SHARED" CACHE STRING  SET(BUILD_SHARED_LIBS OFF CACHE BOOL
42      "What type of libraries to build. Set to SHARED or STATIC.")      "Build shared libraries instead of static ones.")
43    
44  OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON)  OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON)
45    
46  SET(PCRE_EBCDIC FALSE CACHE BOOL  SET(PCRE_EBCDIC OFF CACHE BOOL
47      "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)")
48    
49  SET(PCRE_LINK_SIZE "2" CACHE STRING  SET(PCRE_LINK_SIZE "2" CACHE STRING
# Line 58  SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LI Line 58  SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LI
58  SET(PCRE_NEWLINE "LF" CACHE STRING  SET(PCRE_NEWLINE "LF" CACHE STRING
59      "What to recognize as a newline (one of CR, LF, CRLF, ANY).")      "What to recognize as a newline (one of CR, LF, CRLF, ANY).")
60    
61  SET(PCRE_NO_RECURSE TRUE CACHE BOOL  SET(PCRE_NO_RECURSE OFF CACHE BOOL
62      "If ON, then don't use stack recursion when matching. See NO_RECURSE in config.h.in for details.")      "If ON, then don't use stack recursion when matching. See NO_RECURSE in config.h.in for details.")
63    
64  SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING  SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING
65      "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.")
66    
67  SET(PCRE_SUPPORT_UNICODE_PROPERTIES FALSE CACHE BOOL  SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL
68      "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)")
69    
70  SET(PCRE_SUPPORT_UTF8 FALSE CACHE BOOL  SET(PCRE_SUPPORT_UTF8 OFF CACHE BOOL
71      "Enable support for the Unicode UTF-8 encoding.")      "Enable support for the Unicode UTF-8 encoding.")
72    
73  # Prepare build configuration  # Prepare build configuration
# Line 94  IF(HAVE_UNSIGNED_LONG_LONG) Line 94  IF(HAVE_UNSIGNED_LONG_LONG)
94          SET(pcre_have_ulong_long 1)          SET(pcre_have_ulong_long 1)
95  ENDIF(HAVE_UNSIGNED_LONG_LONG)  ENDIF(HAVE_UNSIGNED_LONG_LONG)
96    
97    IF(NOT BUILD_SHARED_LIBS)
98            SET(PCRE_STATIC 1)
99    ENDIF(NOT BUILD_SHARED_LIBS)
100    
101  IF(PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)  IF(PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)
102          SET(SUPPORT_UTF8 1)          SET(SUPPORT_UTF8 1)
103  ENDIF(PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)  ENDIF(PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)
# Line 102  IF(PCRE_SUPPORT_UNICODE_PROPERTIES) Line 106  IF(PCRE_SUPPORT_UNICODE_PROPERTIES)
106          SET(SUPPORT_UCP 1)          SET(SUPPORT_UCP 1)
107  ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)  ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)
108    
109    SET(NEWLINE "")
110    
111  IF(PCRE_NEWLINE STREQUAL "LF")  IF(PCRE_NEWLINE STREQUAL "LF")
112    SET(NEWLINE "10")          SET(NEWLINE "10")
113  ELSE(PCRE_NEWLINE STREQUAL "LF")  ENDIF(PCRE_NEWLINE STREQUAL "LF")
114    IF(PCRE_NEWLINE STREQUAL "CR")  IF(PCRE_NEWLINE STREQUAL "CR")
115      SET(NEWLINE "13")          SET(NEWLINE "13")
116    ELSE(PCRE_NEWLINE STREQUAL "CR")  ENDIF(PCRE_NEWLINE STREQUAL "CR")
117      IF(PCRE_NEWLINE STREQUAL "CRLF")  IF(PCRE_NEWLINE STREQUAL "CRLF")
118        SET(NEWLINE "3338")          SET(NEWLINE "3338")
119      ELSE(PCRE_NEWLINE STREQUAL "CRLF")  ENDIF(PCRE_NEWLINE STREQUAL "CRLF")
120        IF(PCRE_NEWLINE STREQUAL "ANY")  IF(PCRE_NEWLINE STREQUAL "ANY")
121          SET(NEWLINE "-1")          SET(NEWLINE "-1")
122        ELSE(PCRE_NEWLINE STREQUAL "ANY")  ENDIF(PCRE_NEWLINE STREQUAL "ANY")
123    
124    IF(NEWLINE STREQUAL "")
125          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\".")
126        ENDIF(PCRE_NEWLINE STREQUAL "ANY")  ENDIF(NEWLINE STREQUAL "")
     ENDIF(PCRE_NEWLINE STREQUAL "CRLF")  
   ENDIF(PCRE_NEWLINE STREQUAL "CR")  
 ENDIF(PCRE_NEWLINE STREQUAL "LF")  
127    
128  IF(PCRE_EBCDIC)  IF(PCRE_EBCDIC)
129          SET(EBCDIC 1)          SET(EBCDIC 1)
# Line 213  SET(PCRECPP_SOURCES Line 218  SET(PCRECPP_SOURCES
218  ADD_DEFINITIONS(-DHAVE_CONFIG_H)  ADD_DEFINITIONS(-DHAVE_CONFIG_H)
219    
220  IF(WIN32)  IF(WIN32)
         # What about -DDLL_EXPORT?  
221          ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)          ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
222  ENDIF(WIN32)  ENDIF(WIN32)
223    
# Line 244  TARGET_LINK_LIBRARIES(pcretest pcreposix Line 248  TARGET_LINK_LIBRARIES(pcretest pcreposix
248  ADD_EXECUTABLE(pcregrep pcregrep.c)  ADD_EXECUTABLE(pcregrep pcregrep.c)
249  TARGET_LINK_LIBRARIES(pcregrep pcreposix)  TARGET_LINK_LIBRARIES(pcregrep pcreposix)
250    
251    IF(PCRE_BUILD_PCRECPP)
252            ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)
253            TARGET_LINK_LIBRARIES(pcrecpp_unittest pcrecpp)
254    
255            ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)
256            TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)
257    
258            ADD_EXECUTABLE(pcre_stringpiece_unittest pcre_stringpiece_unittest.cc)
259            TARGET_LINK_LIBRARIES(pcre_stringpiece_unittest pcrecpp)
260    ENDIF(PCRE_BUILD_PCRECPP)
261    
262  # Testing  # Testing
263    
264  ENABLE_TESTING()  ENABLE_TESTING()
265    
266    GET_TARGET_PROPERTY(PCREGREP_EXE pcregrep DEBUG_LOCATION)
267    GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION)
268    
269    # Write out a CTest configuration file that sets some needed environment
270    # variables for the test scripts.
271    #
272    FILE(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.ctest
273    "# This is a generated file.
274    SET(ENV{srcdir} ${CMAKE_SOURCE_DIR})
275    SET(ENV{pcregrep} ${PCREGREP_EXE})
276    SET(ENV{pcretest} ${PCRETEST_EXE})
277    ")
278    
279  IF(UNIX)  IF(UNIX)
280          ADD_TEST(test1 sh -c "srcdir=${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/RunTest")          ADD_TEST(pcre_test      ${CMAKE_SOURCE_DIR}/RunTest)
281          ADD_TEST(test2 sh -c "srcdir=${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/RunGrepTest")          ADD_TEST(pcre_grep_test ${CMAKE_SOURCE_DIR}/RunGrepTest)
 ELSE(UNIX)  
   IF(WIN32)  
         ADD_TEST(test1 ${CMAKE_SOURCE_DIR}/RunTest.bat ${CMAKE_SOURCE_DIR})  
   ENDIF(WIN32)  
282  ENDIF(UNIX)  ENDIF(UNIX)
283    IF(WIN32)
284            ADD_TEST(pcre_test cmd /C ${CMAKE_SOURCE_DIR}/RunTest.bat)
285    ENDIF(WIN32)
286    
287    GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE
288                        pcrecpp_unittest
289                        DEBUG_LOCATION)
290    
291    GET_TARGET_PROPERTY(PCRE_SCANNER_UNITTEST_EXE
292                        pcre_scanner_unittest
293                        DEBUG_LOCATION)
294    
295    GET_TARGET_PROPERTY(PCRE_STRINGPIECE_UNITTEST_EXE
296                        pcre_stringpiece_unittest
297                        DEBUG_LOCATION)
298    
299    ADD_TEST(pcrecpp_test          ${PCRECPP_UNITTEST_EXE})
300    ADD_TEST(pcre_scanner_test     ${PCRE_SCANNER_UNITTEST_EXE})
301    ADD_TEST(pcre_stringpiece_test ${PCRE_STRINGPIECE_UNITTEST_EXE})
302    
303  # Installation  # Installation
304    
# Line 273  FILE(GLOB man1 ${CMAKE_SOURCE_DIR}/doc/* Line 316  FILE(GLOB man1 ${CMAKE_SOURCE_DIR}/doc/*
316  FILE(GLOB man3 ${CMAKE_SOURCE_DIR}/doc/*.3)  FILE(GLOB man3 ${CMAKE_SOURCE_DIR}/doc/*.3)
317    
318  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCRECPP)
319          INSTALL(TARGETS pcrecpp DESTINATION lib)          INSTALL(TARGETS pcrecpp
320                    RUNTIME DESTINATION bin
321                    LIBRARY DESTINATION lib
322                    ARCHIVE DESTINATION lib)
323          INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include)          INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include)
324  ELSE(PCRE_BUILD_PCRECPP)  ELSE(PCRE_BUILD_PCRECPP)
325          # Remove pcrecpp.3          # Remove pcrecpp.3
# Line 288  ENDIF(PCRE_BUILD_PCRECPP) Line 334  ENDIF(PCRE_BUILD_PCRECPP)
334    
335  INSTALL(FILES ${man1} DESTINATION man/man1)  INSTALL(FILES ${man1} DESTINATION man/man1)
336  INSTALL(FILES ${man3} DESTINATION man/man3)  INSTALL(FILES ${man3} DESTINATION man/man3)
337  INSTALL(FILES ${html} DESTINATION doc/html)  INSTALL(FILES ${html} DESTINATION share/doc/pcre/html)
338    
339  # end CMakeLists.txt  # end CMakeLists.txt

Legend:
Removed from v.140  
changed lines
  Added in v.199

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12