Commit 566c22e8 authored by Sergei Golubchik's avatar Sergei Golubchik Committed by Daniel Black

pcre.cmake: always check the library with check_library_exists()

even if pkg-config has it. otherwise build dependencies
aren't detected.
parent b2ebe1cb
...@@ -81,18 +81,15 @@ MACRO (CHECK_PCRE) ...@@ -81,18 +81,15 @@ MACRO (CHECK_PCRE)
FIND_PACKAGE(PkgConfig QUIET) FIND_PACKAGE(PkgConfig QUIET)
PKG_CHECK_MODULES(PCRE libpcre2-8) PKG_CHECK_MODULES(PCRE libpcre2-8)
# in case pkg-config or libpcre2-8.pc is not installed: # in case pkg-config or libpcre2-8.pc is not installed:
IF(NOT PCRE_FOUND) CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "${PCRE_LIBRARY_DIRS}" HAVE_PCRE2_MATCH_8)
UNSET(PCRE_FOUND CACHE)
CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "" PCRE_FOUND)
ENDIF()
ENDIF() 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") IF (WITH_PCRE STREQUAL "system")
MESSAGE(FATAL_ERROR "system pcre2-8 library is not found or unusable") MESSAGE(FATAL_ERROR "system pcre2-8 library is not found or unusable")
ENDIF() ENDIF()
BUNDLE_PCRE2() BUNDLE_PCRE2()
ELSE() 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) IF(NEEDS_PCRE2_DEBIAN_HACK)
SET(PCRE2_DEBIAN_HACK "-Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree") SET(PCRE2_DEBIAN_HACK "-Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree")
ENDIF() ENDIF()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment