From 15c75ad083a55e198ae78324f22970694b72f22b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 1 Feb 2024 11:26:36 +0100 Subject: [PATCH] pcre.cmake: always check the library with check_library_exists() even if pkg-config has it. otherwise build dependencies aren't detected. --- cmake/pcre.cmake | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake index c2eb26074acb2..3c427b881fc97 100644 --- a/cmake/pcre.cmake +++ b/cmake/pcre.cmake @@ -81,18 +81,15 @@ MACRO (CHECK_PCRE) FIND_PACKAGE(PkgConfig QUIET) PKG_CHECK_MODULES(PCRE libpcre2-8) # in case pkg-config or libpcre2-8.pc is not installed: - IF(NOT PCRE_FOUND) - UNSET(PCRE_FOUND CACHE) - CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "" PCRE_FOUND) - ENDIF() + CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "${PCRE_LIBRARY_DIRS}" HAVE_PCRE2_MATCH_8) ENDIF() - IF(NOT PCRE_FOUND OR WITH_PCRE STREQUAL "bundled") + IF(NOT HAVE_PCRE2_MATCH_8 OR WITH_PCRE STREQUAL "bundled") IF (WITH_PCRE STREQUAL "system") MESSAGE(FATAL_ERROR "system pcre2-8 library is not found or unusable") ENDIF() BUNDLE_PCRE2() ELSE() - CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "" NEEDS_PCRE2_DEBIAN_HACK) + CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "${PCRE_LIBRARY_DIRS}" NEEDS_PCRE2_DEBIAN_HACK) IF(NEEDS_PCRE2_DEBIAN_HACK) SET(PCRE2_DEBIAN_HACK "-Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree") ENDIF()