Lines Matching +full:test +full:- +full:cmake +full:- +full:minimum
3 # This file enables PCRE2 to be built with the CMake configuration and build
4 # tool. Download CMake in source or binary form from http://www.cmake.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
13 # not a previously-installed one.
16 # 2008-01-20 Brought up to date to include several new features by Christian
18 # 2008-01-22 Sheri added options for backward compatibility of library names
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
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
33 # 2009-03-23 PH applied a modified version of Steven Van Ingelgem's patches to
36 # 2009-04-11 PH applied Christian Ehrlicher's patch to show compiler flags that
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 # 2011-08-22 PH added PCRE_SUPPORT_JIT
42 # 2011-09-06 PH modified WIN32 ADD_TEST line as suggested by Sergey Cherepanov
43 # 2011-09-06 PH added PCRE_SUPPORT_PCREGREP_JIT
44 # 2011-10-04 Sheri added support for including coff data in windows shared libraries
47 # 2011-10-04 Sheri changed various add_test's to use exes' location built instead
49 # 2011-10-04 Sheri added scripts to provide needed variables to RunTest and
51 # 2011-10-04 Sheri added scripts to provide needed variables and to execute
52 # RunTest.bat in Win32 (for effortless testing with "make test")
53 # 2011-10-04 Sheri Increased minimum required cmake version
54 # 2012-01-06 PH removed pcre_info.c and added pcre_string_utils.c
55 # 2012-01-10 Zoltan Herczeg added libpcre16 support
56 # 2012-01-13 Stephen Kelly added out of source build support
57 # 2012-01-17 PH applied Stephen Kelly's patch to parse the version data out
59 # 2012-02-26 PH added support for libedit
60 # 2012-09-06 PH added support for PCRE_EBCDIC_NL25
61 # 2012-09-08 ChPe added PCRE32 support
62 # 2012-10-23 PH added support for VALGRIND and GCOV
63 # 2012-12-08 PH added patch from Daniel Richard G to quash some MSVC warnings
64 # 2013-07-01 PH realized that the "support" for GCOV was a total nonsense and
66 # 2013-10-08 PH got rid of the "source" command, which is a bash-ism (use ".")
67 # 2013-11-05 PH added support for PARENS_NEST_LIMIT
68 # 2014-08-29 PH converted the file for PCRE2 (which has no C++).
69 # 2015-04-24 PH added support for PCRE2_DEBUG
70 # 2015-07-16 PH updated for new pcre2_find_bracket source module
71 # 2015-08-24 PH correct C_FLAGS setting (patch from Roy Ivy III)
72 # 2015-10=16 PH added support for never-backslash-C
73 # 2016-03-01 PH applied Chris Wilson's patch for MSVC static
74 # 2016-06-24 PH applied Chris Wilson's second patch, putting the first under
76 # 2016-10-05 PH fixed a typo (PCRE should be PCRE2) in above patch
78 # 2016-10-07 PH added PCREGREP_MAX_BUFSIZE
79 # 2017-03-11 PH turned HEAP_MATCH_RECURSE into a NO-OP for 10.30
80 # 2017-04-08 PH added HEAP_LIMIT
81 # 2017-06-15 ZH added SUPPORT_JIT_SEALLOC support
82 # 2018-06-19 PH added checks for stdint.h and inttypes.h (later removed)
83 # 2018-06-27 PH added Daniel's patch to increase the stack for MSVC
84 # 2018-11-14 PH removed unnecessary checks for stdint.h and inttypes.h
85 # 2018-11-16 PH added PCRE2GREP_SUPPORT_CALLOUT_FORK support and tidied
86 # 2019-02-16 PH hacked to avoid CMP0026 policy issue (see comments below)
87 # 2020-03-16 PH renamed dftables as pcre2_dftables (as elsewhere)
88 # 2020-03-24 PH changed CMAKE_MODULE_PATH definition to add, not replace
89 # 2020-04-08 Carlo added function check for secure_getenv, fixed strerror
90 # 2020-04-16 enh added check for __attribute__((uninitialized))
91 # 2020-04-25 PH applied patches from Uwe Korn to support pkg-config and
93 # 2020-04-25 Carlo added function check for mkostemp used in ProtExecAllocator
94 # 2020-04-28 PH added function check for memfd_create based on Carlo's patch
95 # 2020-05-25 PH added a check for Intel CET
96 # 2020-12-03 PH altered the definition of pcre2test as suggested by Daniel
97 # 2021-06-29 JWSB added the option to build static library with PIC.
98 # 2021-07-05 JWSB modified such both the static and shared library can be
100 # 2021-08-28 PH increased minimum version
101 # 2021-08-28 PH added test for realpath()
102 # 2022-12-10 PH added support for pcre2posix_test
104 # Increased minimum to 2.8.5 to support GNUInstallDirs.
105 # Increased minimum to 3.1 to support imported targets.
113 # With a recent cmake, you can provide a rootdir to look for non
118 # For FindReadline.cmake. This was changed to allow setting CMAKE_MODULE_PATH
120 # SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
122 LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
161 set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
181 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mshstk")
186 # User-configurable options
241 "Enable support for Just-in-time compiling.")
251 "Enable use of Just-in-time compiling in pcre2grep.")
260 "Enable support for Unicode and UTF-8/UTF-16/UTF-32 encoding.")
263 "ON=Backslash-R matches only LF CR and CRLF, OFF=Backslash-R matches all Unicode Linebreaks")
266 "If ON, backslash-C (upper case C) is locked out.")
281 …"ON=Shared libraries built in mingw will be named libpcre2-0.dll, etc., instead of libpcre2.dll, e…
367 " Disable libreadline with -DPCRE2_SUPPORT_LIBREADLINE=OFF"
395 SET(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
400 ADD_DEFINITIONS(-D_GNU_SOURCE)
430 # but I was advised to add the NCURSES test as well, along with
431 # some modifications to cmake/FindReadline.cmake which should
439 # libedit is a plug-compatible alternative to libreadline
492 CONFIGURE_FILE(config-cmake.h.in
523 …math(EXPR ${VARIABLE_PREFIX}_SOVERSION "${${VARIABLE_PREFIX}_VERSION_CURRENT} - ${${VARIABLE_PREFI…
545 # Generate pkg-config files
556 CONFIGURE_FILE(libpcre2-posix.pc.in libpcre2-posix.pc @ONLY)
557 SET(pkg_config_files ${pkg_config_files} "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-posix.pc")
560 CONFIGURE_FILE(libpcre2-8.pc.in libpcre2-8.pc @ONLY)
561 SET(pkg_config_files ${pkg_config_files} "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-8.pc")
568 CONFIGURE_FILE(libpcre2-16.pc.in libpcre2-16.pc @ONLY)
569 SET(pkg_config_files ${pkg_config_files} "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-16.pc")
576 CONFIGURE_FILE(libpcre2-32.pc.in libpcre2-32.pc @ONLY)
577 SET(pkg_config_files ${pkg_config_files} "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-32.pc")
583 CONFIGURE_FILE(pcre2-config.in pcre2-config @ONLY)
643 PRE-LINK
652 PRE-LINK
661 SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-posix.pdb ${dll_pdb_files})
662 SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-posixd.pdb ${dll_pdb_debug_files})
673 # This code was taken from the CMake wiki, not from WebM.
686 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
689 ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
696 # 8-bit library
700 …ADD_LIBRARY(pcre2-8-static STATIC ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
701 SET_TARGET_PROPERTIES(pcre2-8-static PROPERTIES
707 TARGET_COMPILE_DEFINITIONS(pcre2-8-static PUBLIC PCRE2_STATIC)
708 TARGET_INCLUDE_DIRECTORIES(pcre2-8-static PUBLIC ${PROJECT_BINARY_DIR})
710 TARGET_LINK_LIBRARIES(pcre2-8-static Threads::Threads)
712 SET(targets ${targets} pcre2-8-static)
713 ADD_LIBRARY(pcre2-posix-static STATIC ${PCRE2POSIX_HEADERS} ${PCRE2POSIX_SOURCES})
714 SET_TARGET_PROPERTIES(pcre2-posix-static PROPERTIES
720 TARGET_LINK_LIBRARIES(pcre2-posix-static pcre2-8-static)
721 TARGET_COMPILE_DEFINITIONS(pcre2-posix-static PUBLIC PCRE2_STATIC)
722 TARGET_INCLUDE_DIRECTORIES(pcre2-posix-static PUBLIC ${PROJECT_BINARY_DIR})
723 SET(targets ${targets} pcre2-posix-static)
726 SET_TARGET_PROPERTIES(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8-static)
727 SET_TARGET_PROPERTIES(pcre2-posix-static PROPERTIES OUTPUT_NAME pcre2-posix-static)
729 SET_TARGET_PROPERTIES(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8)
730 SET_TARGET_PROPERTIES(pcre2-posix-static PROPERTIES OUTPUT_NAME pcre2-posix)
733 … SET_TARGET_PROPERTIES(pcre2-8-static pcre2-posix-static PROPERTIES POSITION_INDEPENDENT_CODE 1)
738 …ADD_LIBRARY(pcre2-8-shared SHARED ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
739 TARGET_INCLUDE_DIRECTORIES(pcre2-8-shared PUBLIC ${PROJECT_BINARY_DIR})
740 SET_TARGET_PROPERTIES(pcre2-8-shared PROPERTIES
746 OUTPUT_NAME pcre2-8)
748 TARGET_LINK_LIBRARIES(pcre2-8-shared Threads::Threads)
750 SET(targets ${targets} pcre2-8-shared)
751 ADD_LIBRARY(pcre2-posix-shared SHARED ${PCRE2POSIX_HEADERS} ${PCRE2POSIX_SOURCES})
752 TARGET_INCLUDE_DIRECTORIES(pcre2-posix-shared PUBLIC ${PROJECT_BINARY_DIR})
753 SET_TARGET_PROPERTIES(pcre2-posix-shared PROPERTIES
759 OUTPUT_NAME pcre2-posix)
760 TARGET_LINK_LIBRARIES(pcre2-posix-shared pcre2-8-shared)
761 SET(targets ${targets} pcre2-posix-shared)
762 SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-8.pdb ${dll_pdb_files})
763 SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-8d.pdb ${dll_pdb_debug_files})
767 SET_TARGET_PROPERTIES(pcre2-8-shared pcre2-posix-shared PROPERTIES PREFIX "")
770 SET_TARGET_PROPERTIES(pcre2-8-shared pcre2-posix-shared PROPERTIES SUFFIX "-0.dll")
776 ADD_LIBRARY(pcre2-8 ALIAS pcre2-8-static)
777 ADD_LIBRARY(pcre2-posix ALIAS pcre2-posix-static)
779 ADD_LIBRARY(pcre2-8 ALIAS pcre2-8-shared)
780 ADD_LIBRARY(pcre2-posix ALIAS pcre2-posix-shared)
784 # 16-bit library
788 …ADD_LIBRARY(pcre2-16-static STATIC ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.…
789 TARGET_INCLUDE_DIRECTORIES(pcre2-16-static PUBLIC ${PROJECT_BINARY_DIR})
790 SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES
796 TARGET_COMPILE_DEFINITIONS(pcre2-16-static PUBLIC PCRE2_STATIC)
798 TARGET_LINK_LIBRARIES(pcre2-16-static Threads::Threads)
800 SET(targets ${targets} pcre2-16-static)
803 SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16-static)
805 SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16)
808 SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES POSITION_INDEPENDENT_CODE 1)
813 …ADD_LIBRARY(pcre2-16-shared SHARED ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.…
814 TARGET_INCLUDE_DIRECTORIES(pcre2-16-shared PUBLIC ${PROJECT_BINARY_DIR})
815 SET_TARGET_PROPERTIES(pcre2-16-shared PROPERTIES
821 OUTPUT_NAME pcre2-16)
823 TARGET_LINK_LIBRARIES(pcre2-16-shared Threads::Threads)
825 SET(targets ${targets} pcre2-16-shared)
826 SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-16.pdb ${dll_pdb_files})
827 SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-16d.pdb ${dll_pdb_debug_files})
831 SET_TARGET_PROPERTIES(pcre2-16-shared PROPERTIES PREFIX "")
834 SET_TARGET_PROPERTIES(pcre2-16-shared PROPERTIES SUFFIX "-0.dll")
840 ADD_LIBRARY(pcre2-16 ALIAS pcre2-16-static)
842 ADD_LIBRARY(pcre2-16 ALIAS pcre2-16-shared)
846 # 32-bit library
850 …ADD_LIBRARY(pcre2-32-static STATIC ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.…
851 TARGET_INCLUDE_DIRECTORIES(pcre2-32-static PUBLIC ${PROJECT_BINARY_DIR})
852 SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES
858 TARGET_COMPILE_DEFINITIONS(pcre2-32-static PUBLIC PCRE2_STATIC)
860 TARGET_LINK_LIBRARIES(pcre2-32-static Threads::Threads)
862 SET(targets ${targets} pcre2-32-static)
865 SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32-static)
867 SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32)
870 SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES POSITION_INDEPENDENT_CODE 1)
875 …ADD_LIBRARY(pcre2-32-shared SHARED ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.…
876 TARGET_INCLUDE_DIRECTORIES(pcre2-32-shared PUBLIC ${PROJECT_BINARY_DIR})
877 SET_TARGET_PROPERTIES(pcre2-32-shared PROPERTIES
883 OUTPUT_NAME pcre2-32)
885 TARGET_LINK_LIBRARIES(pcre2-32-shared Threads::Threads)
887 SET(targets ${targets} pcre2-32-shared)
888 SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-32.pdb ${dll_pdb_files})
889 SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-32d.pdb ${dll_pdb_debug_files})
893 SET_TARGET_PROPERTIES(pcre2-32-shared PROPERTIES PREFIX "")
896 SET_TARGET_PROPERTIES(pcre2-32-shared PROPERTIES SUFFIX "-0.dll")
902 ADD_LIBRARY(pcre2-32 ALIAS pcre2-32-static)
904 ADD_LIBRARY(pcre2-32 ALIAS pcre2-32-shared)
915 TARGET_LINK_LIBRARIES(pcre2grep pcre2-posix ${PCRE2GREP_LIBS})
927 # flag should be indicated with a forward-slash instead of a hyphen, but
928 # then CMake treats it as a file path.
929 SET(PCRE2TEST_LINKER_FLAGS -STACK:2500000)
935 LIST(APPEND PCRE2TEST_LIBS pcre2-posix pcre2-8)
938 LIST(APPEND PCRE2TEST_LIBS pcre2-16)
941 LIST(APPEND PCRE2TEST_LIBS pcre2-32)
948 TARGET_LINK_LIBRARIES(pcre2posix_test pcre2-posix pcre2-8)
956 LIST(APPEND PCRE2_JIT_TEST_LIBS pcre2-8)
959 LIST(APPEND PCRE2_JIT_TEST_LIBS pcre2-16)
962 LIST(APPEND PCRE2_JIT_TEST_LIBS pcre2-32)
968 # via "make test"
972 # got fed-up with the warnings, but my plea for help on the mailing list
994 MESSAGE(\"When testing is complete, review test output in the
1003 if test \"$?\" != \"0\"; then exit 1; fi
1016 if test \"$?\" != \"0\"; then exit 1; fi
1051 # Both the sh and bat file versions of RunTest are run if make test is used
1082 INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/pcre2-config"
1089 # CMake config files.
1090 set(PCRE2_CONFIG_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/pcre2-config.cmake.in)
1091 set(PCRE2_CONFIG_OUT ${CMAKE_CURRENT_BINARY_DIR}/cmake/pcre2-config.cmake)
1093 set(PCRE2_CONFIG_VERSION_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/pcre2-config-version.cmake.in)
1094 set(PCRE2_CONFIG_VERSION_OUT ${CMAKE_CURRENT_BINARY_DIR}/cmake/pcre2-config-version.cmake)
1096 install(FILES ${PCRE2_CONFIG_OUT} ${PCRE2_CONFIG_VERSION_OUT} DESTINATION cmake)
1129 MESSAGE(STATUS "PCRE2-${PCRE2_MAJOR}.${PCRE2_MINOR} configuration summary:")
1190 MESSAGE(STATUS " Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
1191 MESSAGE(STATUS " Non-standard dll names (suffix) . : ${NON_STANDARD_LIB_SUFFIX}")