From c5863e87599b20322743b881112daa8348e199b3 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sun, 4 Aug 2024 11:03:16 +0000 Subject: [PATCH] Merge r1919395 from trunk: *) CMake: By default use PCRE2 CMake package if supported. Use non-Unix build exception to backport with CTR. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1919664 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fc767f3335..9b38f699dbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ FIND_PACKAGE(Lua51) FIND_PACKAGE(OpenSSL) FIND_PACKAGE(ZLIB) FIND_PACKAGE(CURL) +FIND_PACKAGE(PCRE2 COMPONENTS 8BIT) # Options for support libraries not supported by cmake-bundled FindFOO @@ -47,7 +48,10 @@ ENDIF() # PCRE names its libraries differently for debug vs. release builds. # We can't query our own CMAKE_BUILD_TYPE at configure time. # If the debug version exists in PREFIX/lib, default to that one. -IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcre2-8d.lib") +IF(PCRE2_FOUND) + SET(default_pcre_libraries "PCRE2::8BIT") + SET(default_pcre_cflags "-DHAVE_PCRE2") +ELSEIF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcre2-8d.lib") SET(default_pcre_libraries ${CMAKE_INSTALL_PREFIX}/lib/pcre2-8d.lib) SET(default_pcre_cflags "-DHAVE_PCRE2") ELSEIF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcre2-8.lib")