Radek Krejci | 2c22f12 | 2018-09-05 15:08:03 +0200 | [diff] [blame] | 1 | # Copyright (C) 2007-2009 LuaDist. |
| 2 | # Created by Peter Kapec <kapecp@gmail.com> |
| 3 | # Redistribution and use of this file is allowed according to the terms of the MIT license. |
| 4 | # Note: |
| 5 | # Searching headers and libraries is very simple and is NOT as powerful as scripts |
| 6 | # distributed with CMake, because LuaDist defines directories to search for. |
| 7 | # Everyone is encouraged to contact the author with improvements. Maybe this file |
| 8 | # becomes part of CMake distribution sometimes. |
| 9 | |
| 10 | # - Find pcre |
| 11 | # Find the native PCRE headers and libraries. |
| 12 | # |
| 13 | # PCRE_INCLUDE_DIRS - where to find pcre.h, etc. |
| 14 | # PCRE_LIBRARIES - List of libraries when using pcre. |
| 15 | # PCRE_FOUND - True if pcre found. |
| 16 | |
| 17 | # Look for the header file. |
| 18 | FIND_PATH(PCRE_INCLUDE_DIR NAMES pcre.h) |
| 19 | |
| 20 | # Look for the library. |
| 21 | FIND_LIBRARY(PCRE_LIBRARY NAMES pcre) |
| 22 | |
| 23 | # Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE. |
| 24 | INCLUDE(FindPackageHandleStandardArgs) |
| 25 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR) |
| 26 | |
| 27 | # Copy the results to the output variables. |
| 28 | IF(PCRE_FOUND) |
| 29 | SET(PCRE_LIBRARIES ${PCRE_LIBRARY}) |
| 30 | SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) |
| 31 | ELSE(PCRE_FOUND) |
| 32 | SET(PCRE_LIBRARIES) |
| 33 | SET(PCRE_INCLUDE_DIRS) |
| 34 | ENDIF(PCRE_FOUND) |
| 35 | |
| 36 | MARK_AS_ADVANCED(PCRE_INCLUDE_DIRS PCRE_LIBRARIES) |