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

Diff of /code/trunk/CMakeLists.txt

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

revision 404 by ph10, Fri Jul 4 18:27:16 2008 UTC revision 405 by ph10, Mon Mar 23 12:05:20 2009 UTC
# Line 15  Line 15 
15  #                PCRE_SUPPORT_LIBBZ2.  #                PCRE_SUPPORT_LIBBZ2.
16  # 2008-01-20 Brought up to date to include several new features by Christian  # 2008-01-20 Brought up to date to include several new features by Christian
17  #            Ehrlicher.  #            Ehrlicher.
18  # 2008-01-22 Sheri added options for backward compatibility of library names when  # 2008-01-22 Sheri added options for backward compatibility of library names
19  #            building with minGW:  #            when building with minGW:
20  #            if "ON", NON_STANDARD_LIB_PREFIX causes shared libraries to  #            if "ON", NON_STANDARD_LIB_PREFIX causes shared libraries to
21  #            be built without "lib" as prefix. (The libraries will be named pcre.dll,  #            be built without "lib" as prefix. (The libraries will be named
22  #            pcreposix.dll and pcrecpp.dll).  #            pcre.dll, pcreposix.dll and pcrecpp.dll).
23  #            if "ON", NON_STANDARD_LIB_SUFFIX causes shared libraries to  #            if "ON", NON_STANDARD_LIB_SUFFIX causes shared libraries to
24  #            be built with suffix of "-0.dll". (The libraries will be named  #            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  #            libpcre-0.dll, libpcreposix-0.dll and libpcrecpp-0.dll - same names
# Line 27  Line 27 
27  # 2008-01-23 PH removed the automatic build of pcredemo.  # 2008-01-23 PH removed the automatic build of pcredemo.
28  # 2008-04-22 PH modified READLINE support so it finds NCURSES when needed.  # 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)  # 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    
34  PROJECT(PCRE C CXX)  PROJECT(PCRE C CXX)
35    
36  CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6)  CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6)
37    
38  SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # for FindReadline.cmake  SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
39    
40  # external packages  # external packages
41  FIND_PACKAGE( BZip2 )  FIND_PACKAGE( BZip2 )
# Line 232  IF(PCRE_NO_RECURSE) Line 235  IF(PCRE_NO_RECURSE)
235  ENDIF(PCRE_NO_RECURSE)  ENDIF(PCRE_NO_RECURSE)
236    
237  # Output files  # Output files
   
238  CONFIGURE_FILE(config-cmake.h.in  CONFIGURE_FILE(config-cmake.h.in
239                 ${CMAKE_BINARY_DIR}/config.h                 ${PROJECT_BINARY_DIR}/config.h
240                 @ONLY)                 @ONLY)
241    
242  CONFIGURE_FILE(pcre.h.generic  CONFIGURE_FILE(pcre.h.generic
243                 ${CMAKE_BINARY_DIR}/pcre.h                 ${PROJECT_BINARY_DIR}/pcre.h
244                 COPYONLY)                 COPYONLY)
245    
246  # What about pcre-config and libpcre.pc?  # What about pcre-config and libpcre.pc?
247    
248  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCRECPP)
249          CONFIGURE_FILE(pcre_stringpiece.h.in          CONFIGURE_FILE(pcre_stringpiece.h.in
250                         ${CMAKE_BINARY_DIR}/pcre_stringpiece.h                         ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
251                         @ONLY)                         @ONLY)
252    
253          CONFIGURE_FILE(pcrecpparg.h.in          CONFIGURE_FILE(pcrecpparg.h.in
254                         ${CMAKE_BINARY_DIR}/pcrecpparg.h                         ${PROJECT_BINARY_DIR}/pcrecpparg.h
255                         @ONLY)                         @ONLY)
256  ENDIF(PCRE_BUILD_PCRECPP)  ENDIF(PCRE_BUILD_PCRECPP)
257    
# Line 265  IF(PCRE_REBUILD_CHARTABLES) Line 267  IF(PCRE_REBUILD_CHARTABLES)
267      COMMENT "Generating character tables (pcre_chartables.c) for current locale"      COMMENT "Generating character tables (pcre_chartables.c) for current locale"
268      DEPENDS dftables      DEPENDS dftables
269      COMMAND ${DFTABLES_EXE}      COMMAND ${DFTABLES_EXE}
270      ARGS        ${CMAKE_BINARY_DIR}/pcre_chartables.c      ARGS        ${PROJECT_BINARY_DIR}/pcre_chartables.c
271      OUTPUT      ${CMAKE_BINARY_DIR}/pcre_chartables.c      OUTPUT      ${PROJECT_BINARY_DIR}/pcre_chartables.c
272    )    )
273  ELSE(PCRE_REBUILD_CHARTABLES)  ELSE(PCRE_REBUILD_CHARTABLES)
274    CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/pcre_chartables.c.dist    CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/pcre_chartables.c.dist
275                      ${CMAKE_BINARY_DIR}/pcre_chartables.c                      ${PROJECT_BINARY_DIR}/pcre_chartables.c
276                      COPYONLY)                      COPYONLY)
277  ENDIF(PCRE_REBUILD_CHARTABLES)  ENDIF(PCRE_REBUILD_CHARTABLES)
278    
279  # Source code  # Source code
280    
281  SET(PCRE_HEADERS ${CMAKE_BINARY_DIR}/pcre.h)  SET(PCRE_HEADERS ${PROJECT_BINARY_DIR}/pcre.h)
282    
283  SET(PCRE_SOURCES  SET(PCRE_SOURCES
284    ${CMAKE_BINARY_DIR}/pcre_chartables.c    ${PROJECT_BINARY_DIR}/pcre_chartables.c
285    pcre_compile.c    pcre_compile.c
286    pcre_config.c    pcre_config.c
287    pcre_dfa_exec.c    pcre_dfa_exec.c
# Line 308  SET(PCREPOSIX_SOURCES pcreposix.c) Line 310  SET(PCREPOSIX_SOURCES pcreposix.c)
310  SET(PCRECPP_HEADERS  SET(PCRECPP_HEADERS
311    pcrecpp.h    pcrecpp.h
312    pcre_scanner.h    pcre_scanner.h
313    ${CMAKE_BINARY_DIR}/pcrecpparg.h    ${PROJECT_BINARY_DIR}/pcrecpparg.h
314    ${CMAKE_BINARY_DIR}/pcre_stringpiece.h    ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
315  )  )
316    
317  SET(PCRECPP_SOURCES  SET(PCRECPP_SOURCES
# Line 335  ENDIF(WIN32) Line 337  ENDIF(WIN32)
337    
338  # Libraries  # Libraries
339  # pcre  # pcre
340  ADD_LIBRARY(pcre ${PCRE_HEADERS} ${PCRE_SOURCES} ${CMAKE_BINARY_DIR}/config.h)  ADD_LIBRARY(pcre ${PCRE_HEADERS} ${PCRE_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
341  ADD_LIBRARY(pcreposix ${PCREPOSIX_HEADERS} ${PCREPOSIX_SOURCES})  ADD_LIBRARY(pcreposix ${PCREPOSIX_HEADERS} ${PCREPOSIX_SOURCES})
342  TARGET_LINK_LIBRARIES(pcreposix pcre)  TARGET_LINK_LIBRARIES(pcreposix pcre)
343  IF(MINGW AND NOT PCRE_STATIC)  IF(MINGW AND NOT PCRE_STATIC)
# Line 418  GET_TARGET_PROPERTY(PCRETEST_EXE pcretes Line 420  GET_TARGET_PROPERTY(PCRETEST_EXE pcretes
420  # Write out a CTest configuration file that sets some needed environment  # Write out a CTest configuration file that sets some needed environment
421  # variables for the test scripts.  # variables for the test scripts.
422  #  #
423  FILE(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.ctest  FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest
424  "# This is a generated file.  "# This is a generated file.
425  SET(ENV{srcdir} ${CMAKE_SOURCE_DIR})  SET(ENV{srcdir} ${PROJECT_SOURCE_DIR})
426  SET(ENV{pcregrep} ${PCREGREP_EXE})  SET(ENV{pcregrep} ${PCREGREP_EXE})
427  SET(ENV{pcretest} ${PCRETEST_EXE})  SET(ENV{pcretest} ${PCRETEST_EXE})
428  ")  ")
429    
430  IF(UNIX)  IF(UNIX)
431          ADD_TEST(pcre_test      ${CMAKE_SOURCE_DIR}/RunTest)          ADD_TEST(pcre_test      ${PROJECT_SOURCE_DIR}/RunTest)
432          ADD_TEST(pcre_grep_test ${CMAKE_SOURCE_DIR}/RunGrepTest)          ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest)
433  ENDIF(UNIX)  ENDIF(UNIX)
434  IF(WIN32)  IF(WIN32)
435          ADD_TEST(pcre_test cmd /C ${CMAKE_SOURCE_DIR}/RunTest.bat)          ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat)
436  ENDIF(WIN32)  ENDIF(WIN32)
437    
438  GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE  GET_TARGET_PROPERTY(PCRECPP_UNITTEST_EXE
# Line 460  INSTALL(TARGETS pcre pcreposix pcregrep Line 462  INSTALL(TARGETS pcre pcreposix pcregrep
462    
463  INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)  INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)
464    
465  FILE(GLOB html ${CMAKE_SOURCE_DIR}/doc/html/*.html)  FILE(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html)
466  FILE(GLOB man1 ${CMAKE_SOURCE_DIR}/doc/*.1)  FILE(GLOB man1 ${PROJECT_SOURCE_DIR}/doc/*.1)
467  FILE(GLOB man3 ${CMAKE_SOURCE_DIR}/doc/*.3)  FILE(GLOB man3 ${PROJECT_SOURCE_DIR}/doc/*.3)
468    
469  IF(PCRE_BUILD_PCRECPP)  IF(PCRE_BUILD_PCRECPP)
470          INSTALL(TARGETS pcrecpp          INSTALL(TARGETS pcrecpp

Legend:
Removed from v.404  
changed lines
  Added in v.405

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12