blob: c971775495014a7c59b2e9fd2fb8b313502c0bf6 [file] [log] [blame]
Radek Krejci54579462019-04-30 12:47:06 +02001# - Find pcre
2# Find the native PCRE2 headers and libraries.
3#
4# PCRE2_INCLUDE_DIRS - where to find pcre.h, etc.
5# PCRE2_LIBRARIES - List of libraries when using pcre.
6# PCRE2_FOUND - True if pcre found.
7
8# Look for the header file.
9FIND_PATH(PCRE2_INCLUDE_DIR pcre2.h)
10
11# Look for the library.
12FIND_LIBRARY(PCRE2_LIBRARY NAMES libpcre2.a pcre2-8)
13
14# Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE.
15INCLUDE(FindPackageHandleStandardArgs)
16FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 DEFAULT_MSG PCRE2_LIBRARY PCRE2_INCLUDE_DIR)
17
18# Copy the results to the output variables.
19IF(PCRE2_FOUND)
20 SET(PCRE2_LIBRARIES ${PCRE2_LIBRARY})
21 SET(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR})
22ELSE(PCRE2_FOUND)
23 SET(PCRE_LIBRARIES)
24 SET(PCRE_INCLUDE_DIRS)
25ENDIF(PCRE2_FOUND)
26
27MARK_AS_ADVANCED(PCRE2_INCLUDE_DIRS PCRE2_LIBRARIES)