blob: a28ff11758861e6037c55c601f4edfdf960501d8 [file] [log] [blame]
Radek Krejci2c22f122018-09-05 15:08:03 +02001# 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.
18FIND_PATH(PCRE_INCLUDE_DIR NAMES pcre.h)
19
20# Look for the library.
21FIND_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.
24INCLUDE(FindPackageHandleStandardArgs)
25FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR)
26
27# Copy the results to the output variables.
28IF(PCRE_FOUND)
29 SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
30 SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
31ELSE(PCRE_FOUND)
32 SET(PCRE_LIBRARIES)
33 SET(PCRE_INCLUDE_DIRS)
34ENDIF(PCRE_FOUND)
35
36MARK_AS_ADVANCED(PCRE_INCLUDE_DIRS PCRE_LIBRARIES)