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

Contents of /code/trunk/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 318 - (hide annotations) (download)
Mon Jan 28 15:27:17 2008 UTC (6 years, 6 months ago) by ph10
File MIME type: text/plain
File size: 17332 byte(s)
Further tidies from Sheri and Christian.

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12