Radek Krejci | 5457946 | 2019-04-30 12:47:06 +0200 | [diff] [blame] | 1 | # - 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. |
| 9 | FIND_PATH(PCRE2_INCLUDE_DIR pcre2.h) |
| 10 | |
| 11 | # Look for the library. |
| 12 | FIND_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. |
| 15 | INCLUDE(FindPackageHandleStandardArgs) |
| 16 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 DEFAULT_MSG PCRE2_LIBRARY PCRE2_INCLUDE_DIR) |
| 17 | |
| 18 | # Copy the results to the output variables. |
| 19 | IF(PCRE2_FOUND) |
| 20 | SET(PCRE2_LIBRARIES ${PCRE2_LIBRARY}) |
| 21 | SET(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR}) |
| 22 | ELSE(PCRE2_FOUND) |
| 23 | SET(PCRE_LIBRARIES) |
| 24 | SET(PCRE_INCLUDE_DIRS) |
| 25 | ENDIF(PCRE2_FOUND) |
| 26 | |
| 27 | MARK_AS_ADVANCED(PCRE2_INCLUDE_DIRS PCRE2_LIBRARIES) |