/[pcre]/code/trunk/CMakeLists.txt
ViewVC logotype

Contents of /code/trunk/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 650 - (show annotations)
Mon Aug 1 16:10:17 2011 UTC (8 years, 2 months ago) by ph10
File MIME type: text/plain
File size: 19916 byte(s)
Update CMake for new PCREGREP_BUFSIZE compile-time option.
1 # CMakeLists.txt
2 #
3 #
4 # This file allows building PCRE with the CMake configuration and build
5 # tool. Download CMake in source or binary form from http://www.cmake.org/
6 #
7 # Original listfile by Christian Ehrlicher <Ch.Ehrlicher@gmx.de>
8 # Refined and expanded by Daniel Richard G. <skunk@iSKUNK.ORG>
9 # 2007-09-14 mod by Sheri so 7.4 supported configuration options can be entered
10 # 2007-09-19 Adjusted by PH to retain previous default settings
11 # 2007-12-26 (a) On UNIX, use names libpcre instead of just pcre
12 # (b) Ensure pcretest and pcregrep link with the local library,
13 # not a previously-installed one.
14 # (c) Add PCRE_SUPPORT_LIBREADLINE, PCRE_SUPPORT_LIBZ, and
15 # PCRE_SUPPORT_LIBBZ2.
16 # 2008-01-20 Brought up to date to include several new features by Christian
17 # Ehrlicher.
18 # 2008-01-22 Sheri added options for backward compatibility of library names
19 # when building with minGW:
20 # if "ON", NON_STANDARD_LIB_PREFIX causes shared libraries to
21 # be built without "lib" as prefix. (The libraries will be named
22 # pcre.dll, pcreposix.dll and pcrecpp.dll).
23 # if "ON", NON_STANDARD_LIB_SUFFIX causes shared libraries to
24 # 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
26 # built by default with Configure and Make.
27 # 2008-01-23 PH removed the automatic build of pcredemo.
28 # 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)
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
42 PROJECT(PCRE C CXX)
43
44 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6)
45
46 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
47
48 # external packages
49 FIND_PACKAGE( BZip2 )
50 FIND_PACKAGE( ZLIB )
51 FIND_PACKAGE( Readline )
52
53 # Configuration checks
54
55 INCLUDE(CheckIncludeFile)
56 INCLUDE(CheckIncludeFileCXX)
57 INCLUDE(CheckFunctionExists)
58 INCLUDE(CheckTypeSize)
59
60 CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
61 CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
62 CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
63 CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
64 CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
65 CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
66 CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H)
67
68 CHECK_INCLUDE_FILE_CXX(type_traits.h HAVE_TYPE_TRAITS_H)
69 CHECK_INCLUDE_FILE_CXX(bits/type_traits.h HAVE_BITS_TYPE_TRAITS_H)
70
71 CHECK_FUNCTION_EXISTS(bcopy HAVE_BCOPY)
72 CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
73 CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
74 CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL)
75 CHECK_FUNCTION_EXISTS(strtoq HAVE_STRTOQ)
76 CHECK_FUNCTION_EXISTS(_strtoi64 HAVE__STRTOI64)
77
78 CHECK_TYPE_SIZE("long long" LONG_LONG)
79 CHECK_TYPE_SIZE("unsigned long long" UNSIGNED_LONG_LONG)
80
81 # User-configurable options
82 #
83 # (Note: CMakeSetup displays these in alphabetical order, regardless of
84 # the order we use here)
85
86 SET(BUILD_SHARED_LIBS OFF CACHE BOOL
87 "Build shared libraries instead of static ones.")
88
89 OPTION(PCRE_BUILD_PCRECPP "Build the PCRE C++ library (pcrecpp)." ON)
90
91 SET(PCRE_EBCDIC OFF CACHE BOOL
92 "Use EBCDIC coding instead of ASCII. (This is rarely used outside of mainframe systems)")
93
94 SET(PCRE_LINK_SIZE "2" CACHE STRING
95 "Internal link size (2, 3 or 4 allowed). See LINK_SIZE in config.h.in for details.")
96
97 SET(PCRE_MATCH_LIMIT "10000000" CACHE STRING
98 "Default limit on internal looping. See MATCH_LIMIT in config.h.in for details.")
99
100 SET(PCRE_MATCH_LIMIT_RECURSION "MATCH_LIMIT" CACHE STRING
101 "Default limit on internal recursion. See MATCH_LIMIT_RECURSION in config.h.in for details.")
102
103 SET(PCREGREP_BUFSIZE "20480" CACHE STRING
104 "Buffer size parameter for pcregrep. See PCREGREP_BUFSIZE in config.h.in for details.")
105
106 SET(PCRE_NEWLINE "LF" CACHE STRING
107 "What to recognize as a newline (one of CR, LF, CRLF, ANY, ANYCRLF).")
108
109 SET(PCRE_NO_RECURSE OFF CACHE BOOL
110 "If ON, then don't use stack recursion when matching. See NO_RECURSE in config.h.in for details.")
111
112 SET(PCRE_POSIX_MALLOC_THRESHOLD "10" CACHE STRING
113 "Threshold for malloc() usage. See POSIX_MALLOC_THRESHOLD in config.h.in for details.")
114
115 SET(PCRE_SUPPORT_UNICODE_PROPERTIES OFF CACHE BOOL
116 "Enable support for Unicode properties. (If set, UTF-8 support will be enabled as well)")
117
118 SET(PCRE_SUPPORT_UTF8 OFF CACHE BOOL
119 "Enable support for the Unicode UTF-8 encoding.")
120
121 SET(PCRE_SUPPORT_BSR_ANYCRLF OFF CACHE BOOL
122 "ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks")
123
124 OPTION(PCRE_SHOW_REPORT "Show the final configuration report" ON)
125 OPTION(PCRE_BUILD_PCREGREP "Build pcregrep" ON)
126 OPTION(PCRE_BUILD_TESTS "Build the tests" ON)
127
128 IF (PCRE_BUILD_TESTS)
129 IF (NOT PCRE_BUILD_PCREGREP)
130 MESSAGE(STATUS "** Building tests requires pcregrep: PCRE_BUILD_PCREGREP forced ON")
131 SET(PCRE_BUILD_PCREGREP ON)
132 ENDIF(NOT PCRE_BUILD_PCREGREP)
133 ENDIF(PCRE_BUILD_TESTS)
134
135 IF (MINGW)
136 OPTION(NON_STANDARD_LIB_PREFIX
137 "ON=Shared libraries built in mingw will be named pcre.dll, etc., instead of libpcre.dll, etc."
138 OFF)
139
140 OPTION(NON_STANDARD_LIB_SUFFIX
141 "ON=Shared libraries built in mingw will be named libpcre-0.dll, etc., instead of libpcre.dll, etc."
142 OFF)
143 ENDIF(MINGW)
144
145 # bzip2 lib
146 IF(BZIP2_FOUND)
147 OPTION (PCRE_SUPPORT_LIBBZ2 "Enable support for linking pcregrep with libbz2." ON)
148 ENDIF(BZIP2_FOUND)
149 IF(PCRE_SUPPORT_LIBBZ2)
150 INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR})
151 ENDIF(PCRE_SUPPORT_LIBBZ2)
152
153 # zlib
154 IF(ZLIB_FOUND)
155 OPTION (PCRE_SUPPORT_LIBZ "Enable support for linking pcregrep with libz." ON)
156 ENDIF(ZLIB_FOUND)
157 IF(PCRE_SUPPORT_LIBZ)
158 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
159 ENDIF(PCRE_SUPPORT_LIBZ)
160
161 # readline lib
162 IF(READLINE_FOUND)
163 OPTION (PCRE_SUPPORT_LIBREADLINE "Enable support for linking pcretest with libreadline." ON)
164 ENDIF(READLINE_FOUND)
165 IF(PCRE_SUPPORT_LIBREADLINE)
166 INCLUDE_DIRECTORIES(${READLINE_INCLUDE_DIR})
167 ENDIF(PCRE_SUPPORT_LIBREADLINE)
168
169 # Prepare build configuration
170
171 SET(pcre_have_type_traits 0)
172 SET(pcre_have_bits_type_traits 0)
173
174 IF(HAVE_TYPE_TRAITS_H)
175 SET(pcre_have_type_traits 1)
176 ENDIF(HAVE_TYPE_TRAITS_H)
177
178 IF(HAVE_BITS_TYPE_TRAITS_H)
179 SET(pcre_have_bits_type_traits 1)
180 ENDIF(HAVE_BITS_TYPE_TRAITS_H)
181
182 SET(pcre_have_long_long 0)
183 SET(pcre_have_ulong_long 0)
184
185 IF(HAVE_LONG_LONG)
186 SET(pcre_have_long_long 1)
187 ENDIF(HAVE_LONG_LONG)
188
189 IF(HAVE_UNSIGNED_LONG_LONG)
190 SET(pcre_have_ulong_long 1)
191 ENDIF(HAVE_UNSIGNED_LONG_LONG)
192
193 IF(NOT BUILD_SHARED_LIBS)
194 SET(PCRE_STATIC 1)
195 ENDIF(NOT BUILD_SHARED_LIBS)
196
197 IF(PCRE_SUPPORT_BSR_ANYCRLF)
198 SET(BSR_ANYCRLF 1)
199 ENDIF(PCRE_SUPPORT_BSR_ANYCRLF)
200
201 IF(PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)
202 SET(SUPPORT_UTF8 1)
203 ENDIF(PCRE_SUPPORT_UTF8 OR PCRE_SUPPORT_UNICODE_PROPERTIES)
204
205 IF(PCRE_SUPPORT_UNICODE_PROPERTIES)
206 SET(SUPPORT_UCP 1)
207 ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)
208
209 # This next one used to contain
210 # SET(PCRETEST_LIBS ${READLINE_LIBRARY})
211 # but I was advised to add the NCURSES test as well, along with
212 # some modifications to cmake/FindReadline.cmake which should
213 # make it possible to override the default if necessary. PH
214
215 IF(PCRE_SUPPORT_LIBREADLINE)
216 SET(SUPPORT_LIBREADLINE 1)
217 SET(PCRETEST_LIBS ${READLINE_LIBRARY} ${NCURSES_LIBRARY})
218 ENDIF(PCRE_SUPPORT_LIBREADLINE)
219
220 IF(PCRE_SUPPORT_LIBZ)
221 SET(SUPPORT_LIBZ 1)
222 SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${ZLIB_LIBRARIES})
223 ENDIF(PCRE_SUPPORT_LIBZ)
224
225 IF(PCRE_SUPPORT_LIBBZ2)
226 SET(SUPPORT_LIBBZ2 1)
227 SET(PCREGREP_LIBS ${PCREGREP_LIBS} ${BZIP2_LIBRARIES})
228 ENDIF(PCRE_SUPPORT_LIBBZ2)
229
230 SET(NEWLINE "")
231
232 IF(PCRE_NEWLINE STREQUAL "LF")
233 SET(NEWLINE "10")
234 ENDIF(PCRE_NEWLINE STREQUAL "LF")
235 IF(PCRE_NEWLINE STREQUAL "CR")
236 SET(NEWLINE "13")
237 ENDIF(PCRE_NEWLINE STREQUAL "CR")
238 IF(PCRE_NEWLINE STREQUAL "CRLF")
239 SET(NEWLINE "3338")
240 ENDIF(PCRE_NEWLINE STREQUAL "CRLF")
241 IF(PCRE_NEWLINE STREQUAL "ANY")
242 SET(NEWLINE "-1")
243 ENDIF(PCRE_NEWLINE STREQUAL "ANY")
244 IF(PCRE_NEWLINE STREQUAL "ANYCRLF")
245 SET(NEWLINE "-2")
246 ENDIF(PCRE_NEWLINE STREQUAL "ANYCRLF")
247
248 IF(NEWLINE STREQUAL "")
249 MESSAGE(FATAL_ERROR "The PCRE_NEWLINE variable must be set to one of the following values: \"LF\", \"CR\", \"CRLF\", \"ANY\", \"ANYCRLF\".")
250 ENDIF(NEWLINE STREQUAL "")
251
252 IF(PCRE_EBCDIC)
253 SET(EBCDIC 1)
254 ENDIF(PCRE_EBCDIC)
255
256 IF(PCRE_NO_RECURSE)
257 SET(NO_RECURSE 1)
258 ENDIF(PCRE_NO_RECURSE)
259
260 # Output files
261 CONFIGURE_FILE(config-cmake.h.in
262 ${PROJECT_BINARY_DIR}/config.h
263 @ONLY)
264
265 CONFIGURE_FILE(pcre.h.generic
266 ${PROJECT_BINARY_DIR}/pcre.h
267 COPYONLY)
268
269 # What about pcre-config and libpcre.pc?
270
271 IF(PCRE_BUILD_PCRECPP)
272 CONFIGURE_FILE(pcre_stringpiece.h.in
273 ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
274 @ONLY)
275
276 CONFIGURE_FILE(pcrecpparg.h.in
277 ${PROJECT_BINARY_DIR}/pcrecpparg.h
278 @ONLY)
279 ENDIF(PCRE_BUILD_PCRECPP)
280
281 # Character table generation
282
283 OPTION(PCRE_REBUILD_CHARTABLES "Rebuild char tables" OFF)
284 IF(PCRE_REBUILD_CHARTABLES)
285 ADD_EXECUTABLE(dftables dftables.c)
286
287 GET_TARGET_PROPERTY(DFTABLES_EXE dftables LOCATION)
288
289 ADD_CUSTOM_COMMAND(
290 COMMENT "Generating character tables (pcre_chartables.c) for current locale"
291 DEPENDS dftables
292 COMMAND ${DFTABLES_EXE}
293 ARGS ${PROJECT_BINARY_DIR}/pcre_chartables.c
294 OUTPUT ${PROJECT_BINARY_DIR}/pcre_chartables.c
295 )
296 ELSE(PCRE_REBUILD_CHARTABLES)
297 CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/pcre_chartables.c.dist
298 ${PROJECT_BINARY_DIR}/pcre_chartables.c
299 COPYONLY)
300 ENDIF(PCRE_REBUILD_CHARTABLES)
301
302 # Source code
303
304 SET(PCRE_HEADERS ${PROJECT_BINARY_DIR}/pcre.h)
305
306 SET(PCRE_SOURCES
307 ${PROJECT_BINARY_DIR}/pcre_chartables.c
308 pcre_compile.c
309 pcre_config.c
310 pcre_dfa_exec.c
311 pcre_exec.c
312 pcre_fullinfo.c
313 pcre_get.c
314 pcre_globals.c
315 pcre_info.c
316 pcre_newline.c
317 pcre_maketables.c
318 pcre_ord2utf8.c
319 pcre_refcount.c
320 pcre_study.c
321 pcre_tables.c
322 pcre_try_flipped.c
323 pcre_ucd.c
324 pcre_valid_utf8.c
325 pcre_version.c
326 pcre_xclass.c
327 )
328
329 SET(PCREPOSIX_HEADERS pcreposix.h)
330
331 SET(PCREPOSIX_SOURCES pcreposix.c)
332
333 SET(PCRECPP_HEADERS
334 pcrecpp.h
335 pcre_scanner.h
336 ${PROJECT_BINARY_DIR}/pcrecpparg.h
337 ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
338 )
339
340 SET(PCRECPP_SOURCES
341 pcrecpp.cc
342 pcre_scanner.cc
343 pcre_stringpiece.cc
344 )
345
346 # Build setup
347
348 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
349
350 IF(MSVC)
351 ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
352 ENDIF(MSVC)
353
354 SET(CMAKE_INCLUDE_CURRENT_DIR 1)
355 # needed to make sure to not link debug libs
356 # against release libs and vice versa
357 IF(WIN32)
358 SET(CMAKE_DEBUG_POSTFIX "d")
359 ENDIF(WIN32)
360
361 SET(targets)
362
363 # Libraries
364 # pcre
365 ADD_LIBRARY(pcre ${PCRE_HEADERS} ${PCRE_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
366 SET(targets ${targets} pcre)
367 ADD_LIBRARY(pcreposix ${PCREPOSIX_HEADERS} ${PCREPOSIX_SOURCES})
368 SET(targets ${targets} pcreposix)
369 TARGET_LINK_LIBRARIES(pcreposix pcre)
370 IF(MINGW AND NOT PCRE_STATIC)
371 IF(NON_STANDARD_LIB_PREFIX)
372 SET_TARGET_PROPERTIES(pcre pcreposix
373 PROPERTIES PREFIX ""
374 )
375 ENDIF(NON_STANDARD_LIB_PREFIX)
376
377 IF(NON_STANDARD_LIB_SUFFIX)
378 SET_TARGET_PROPERTIES(pcre pcreposix
379 PROPERTIES SUFFIX "-0.dll"
380 )
381 ENDIF(NON_STANDARD_LIB_SUFFIX)
382 ENDIF(MINGW AND NOT PCRE_STATIC)
383
384
385 # pcrecpp
386 IF(PCRE_BUILD_PCRECPP)
387 ADD_LIBRARY(pcrecpp ${PCRECPP_HEADERS} ${PCRECPP_SOURCES})
388 SET(targets ${targets} pcrecpp)
389 TARGET_LINK_LIBRARIES(pcrecpp pcre)
390
391 IF(MINGW AND NOT PCRE_STATIC)
392 IF(NON_STANDARD_LIB_PREFIX)
393 SET_TARGET_PROPERTIES(pcrecpp
394 PROPERTIES PREFIX ""
395 )
396 ENDIF(NON_STANDARD_LIB_PREFIX)
397
398 IF(NON_STANDARD_LIB_SUFFIX)
399 SET_TARGET_PROPERTIES(pcrecpp
400 PROPERTIES SUFFIX "-0.dll"
401 )
402 ENDIF(NON_STANDARD_LIB_SUFFIX)
403 ENDIF(MINGW AND NOT PCRE_STATIC)
404 ENDIF(PCRE_BUILD_PCRECPP)
405
406
407 # Executables
408
409 # Removed by PH (2008-01-23) because pcredemo shouldn't really be built
410 # automatically, and it gave trouble in some environments anyway.
411 # ADD_EXECUTABLE(pcredemo pcredemo.c)
412 # TARGET_LINK_LIBRARIES(pcredemo pcreposix)
413 # IF(NOT BUILD_SHARED_LIBS)
414 # # make sure to not use declspec(dllimport) in static mode on windows
415 # SET_TARGET_PROPERTIES(pcredemo PROPERTIES COMPILE_FLAGS "-DPCRE_STATIC")
416 # ENDIF(NOT BUILD_SHARED_LIBS)
417
418 IF(PCRE_BUILD_PCREGREP)
419 ADD_EXECUTABLE(pcregrep pcregrep.c)
420 SET(targets ${targets} pcregrep)
421 TARGET_LINK_LIBRARIES(pcregrep pcreposix ${PCREGREP_LIBS})
422 ENDIF(PCRE_BUILD_PCREGREP)
423
424
425 # Testing
426 IF(PCRE_BUILD_TESTS)
427 ENABLE_TESTING()
428
429 ADD_EXECUTABLE(pcretest pcretest.c)
430 SET(targets ${targets} pcretest)
431 TARGET_LINK_LIBRARIES(pcretest pcreposix ${PCRETEST_LIBS})
432
433 IF(PCRE_BUILD_PCRECPP)
434 ADD_EXECUTABLE(pcrecpp_unittest pcrecpp_unittest.cc)
435 SET(targets ${targets} pcrecpp_unittest)
436 TARGET_LINK_LIBRARIES(pcrecpp_unittest pcrecpp)
437 IF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)
438 SET_TARGET_PROPERTIES(pcrecpp
439 PROPERTIES PREFIX ""
440 )
441 ENDIF(MINGW AND NON_STANDARD_LIB_NAMES AND NOT PCRE_STATIC)
442
443
444 ADD_EXECUTABLE(pcre_scanner_unittest pcre_scanner_unittest.cc)
445 SET(targets ${targets} pcre_scanner_unittest)
446 TARGET_LINK_LIBRARIES(pcre_scanner_unittest pcrecpp)
447
448 ADD_EXECUTABLE(pcre_stringpiece_unittest pcre_stringpiece_unittest.cc)
449 SET(targets ${targets} pcre_stringpiece_unittest)
450 TARGET_LINK_LIBRARIES(pcre_stringpiece_unittest pcrecpp)
451 ENDIF(PCRE_BUILD_PCRECPP)
452
453 GET_TARGET_PROPERTY(PCREGREP_EXE pcregrep DEBUG_LOCATION)
454 GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION)
455
456 # Write out a CTest configuration file that sets some needed environment
457 # variables for the test scripts.
458 #
459 FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest
460 "# This is a generated file.
461 SET(ENV{srcdir} ${PROJECT_SOURCE_DIR})
462 SET(ENV{pcregrep} ${PCREGREP_EXE})
463 SET(ENV{pcretest} ${PCRETEST_EXE})
464 ")
465
466 IF(UNIX)
467 ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest)
468 ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest)
469 ENDIF(UNIX)
470 IF(WIN32)
471 ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat)
472 ENDIF(WIN32)
473
474 GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE
475 pcrecpp_unittest
476 DEBUG_LOCATION)
477
478 GET_TARGET_PROPERTY(PCRE_SCANNER_UNITTEST_EXE
479 pcre_scanner_unittest
480 DEBUG_LOCATION)
481
482 GET_TARGET_PROPERTY(PCRE_STRINGPIECE_UNITTEST_EXE
483 pcre_stringpiece_unittest
484 DEBUG_LOCATION)
485
486 ADD_TEST(pcrecpp_test ${PCRECPP_UNITTEST_EXE})
487 ADD_TEST(pcre_scanner_test ${PCRE_SCANNER_UNITTEST_EXE})
488 ADD_TEST(pcre_stringpiece_test ${PCRE_STRINGPIECE_UNITTEST_EXE})
489 ENDIF(PCRE_BUILD_TESTS)
490
491 # Installation
492 SET(CMAKE_INSTALL_ALWAYS 1)
493
494 INSTALL(TARGETS ${targets}
495 RUNTIME DESTINATION bin
496 LIBRARY DESTINATION lib
497 ARCHIVE DESTINATION lib)
498
499 INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)
500
501 FILE(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html)
502 FILE(GLOB man1 ${PROJECT_SOURCE_DIR}/doc/*.1)
503 FILE(GLOB man3 ${PROJECT_SOURCE_DIR}/doc/*.3)
504
505 IF(PCRE_BUILD_PCRECPP)
506 INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include)
507 ELSE(PCRE_BUILD_PCRECPP)
508 # Remove pcrecpp.3
509 FOREACH(man ${man3})
510 GET_FILENAME_COMPONENT(man_tmp ${man} NAME)
511 IF(NOT man_tmp STREQUAL "pcrecpp.3")
512 SET(man3_new ${man3} ${man})
513 ENDIF(NOT man_tmp STREQUAL "pcrecpp.3")
514 ENDFOREACH(man ${man3})
515 SET(man3 ${man3_new})
516 ENDIF(PCRE_BUILD_PCRECPP)
517
518
519 INSTALL(FILES ${man1} DESTINATION man/man1)
520 INSTALL(FILES ${man3} DESTINATION man/man3)
521 INSTALL(FILES ${html} DESTINATION share/doc/pcre/html)
522
523 # help, only for nice output
524 IF(BUILD_SHARED_LIBS)
525 SET(BUILD_STATIC_LIBS OFF)
526 ELSE(BUILD_SHARED_LIBS)
527 SET(BUILD_STATIC_LIBS ON)
528 ENDIF(BUILD_SHARED_LIBS)
529
530 IF(PCRE_SHOW_REPORT)
531 STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
532 IF (CMAKE_C_FLAGS)
533 SET(cfsp " ")
534 ENDIF(CMAKE_C_FLAGS)
535 IF (CMAKE_CXX_FLAGS)
536 SET(cxxfsp " ")
537 ENDIF(CMAKE_CXX_FLAGS)
538 MESSAGE(STATUS "")
539 MESSAGE(STATUS "")
540 MESSAGE(STATUS "PCRE configuration summary:")
541 MESSAGE(STATUS "")
542 MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
543 MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}")
544 MESSAGE(STATUS " C++ compiler .................... : ${CMAKE_CXX_COMPILER}")
545 MESSAGE(STATUS " C compiler flags ................ : ${CMAKE_C_FLAGS}${cfsp}${CMAKE_C_FLAGS_${buildtype}}")
546 MESSAGE(STATUS " C++ compiler flags .............. : ${CMAKE_CXX_FLAGS}${cxxfsp}${CMAKE_CXX_FLAGS_${buildtype}}")
547 MESSAGE(STATUS "")
548 MESSAGE(STATUS " Build C++ library ............... : ${PCRE_BUILD_PCRECPP}")
549 MESSAGE(STATUS " Enable UTF-8 support ............ : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
550 MESSAGE(STATUS " Unicode properties .............. : ${PCRE_SUPPORT_UNICODE_PROPERTIES}")
551 MESSAGE(STATUS " Newline char/sequence ........... : ${PCRE_NEWLINE}")
552 MESSAGE(STATUS " \\R matches only ANYCRLF ......... : ${PCRE_SUPPORT_BSR_ANYCRLF}")
553 MESSAGE(STATUS " EBCDIC coding ................... : ${PCRE_EBCDIC}")
554 MESSAGE(STATUS " Rebuild char tables ............. : ${PCRE_REBUILD_CHARTABLES}")
555 MESSAGE(STATUS " No stack recursion .............. : ${PCRE_NO_RECURSE}")
556 MESSAGE(STATUS " POSIX mem threshold ............. : ${PCRE_POSIX_MALLOC_THRESHOLD}")
557 MESSAGE(STATUS " Internal link size .............. : ${PCRE_LINK_SIZE}")
558 MESSAGE(STATUS " Match limit ..................... : ${PCRE_MATCH_LIMIT}")
559 MESSAGE(STATUS " Match limit recursion ........... : ${PCRE_MATCH_LIMIT_RECURSION}")
560 MESSAGE(STATUS " Build shared libs ............... : ${BUILD_SHARED_LIBS}")
561 MESSAGE(STATUS " Build static libs ............... : ${BUILD_STATIC_LIBS}")
562 MESSAGE(STATUS " Build pcregrep .................. : ${PCRE_BUILD_PCREGREP}")
563 MESSAGE(STATUS " Build tests (implies pcretest) .. : ${PCRE_BUILD_TESTS}")
564 IF(ZLIB_FOUND)
565 MESSAGE(STATUS " Link pcregrep with libz ......... : ${PCRE_SUPPORT_LIBZ}")
566 ELSE(ZLIB_FOUND)
567 MESSAGE(STATUS " Link pcregrep with libz ......... : None" )
568 ENDIF(ZLIB_FOUND)
569 IF(BZIP2_FOUND)
570 MESSAGE(STATUS " Link pcregrep with libbz2 ....... : ${PCRE_SUPPORT_LIBBZ2}")
571 ELSE(BZIP2_FOUND)
572 MESSAGE(STATUS " Link pcregrep with libbz2 ....... : None" )
573 ENDIF(BZIP2_FOUND)
574 IF(NOT PCRE_SUPPORT_LIBREADLINE)
575 MESSAGE(STATUS " Link pcretest with libreadline .. : None" )
576 ELSE(NOT PCRE_SUPPORT_LIBREADLINE)
577 MESSAGE(STATUS " Link pcretest with libreadline .. : ${PCRE_SUPPORT_LIBREADLINE}")
578 ENDIF(NOT PCRE_SUPPORT_LIBREADLINE)
579 IF(MINGW AND NOT PCRE_STATIC)
580 MESSAGE(STATUS " Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
581 MESSAGE(STATUS " Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}")
582 ENDIF(MINGW AND NOT PCRE_STATIC)
583 MESSAGE(STATUS "")
584 ENDIF(PCRE_SHOW_REPORT)
585
586 # end CMakeLists.txt

  ViewVC Help
Powered by ViewVC 1.1.5