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

Contents of /code/trunk/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 351 - (hide annotations) (download)
Fri Jul 4 18:27:16 2008 UTC (5 years, 9 months ago) by ph10
File MIME type: text/plain
File size: 17755 byte(s)
Final tidies for new Unicode property code; upgrade to Unicode 5.1.0.

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12