]>
Commit | Line | Data |
---|---|---|
22a2d3d5 UG |
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 | # For details see the COPYRIGHT file distributed with LuaDist. | |
5 | # Note: | |
6 | # Searching headers and libraries is very simple and is NOT as powerful as scripts | |
7 | # distributed with CMake, because LuaDist defines directories to search for. | |
8 | # Everyone is encouraged to contact the author with improvements. Maybe this file | |
9 | # becomes part of CMake distribution sometimes. | |
10 | ||
11 | # - Find pcre | |
12 | # Find the native PCRE headers and libraries. | |
13 | # | |
14 | # PCRE_INCLUDE_DIRS - where to find pcre.h, etc. | |
15 | # PCRE_LIBRARIES - List of libraries when using pcre. | |
16 | # PCRE_FOUND - True if pcre found. | |
17 | ||
18 | # Look for the header file. | |
ad5611d8 | 19 | find_path(PCRE_INCLUDE_DIR NAMES pcre.h) |
22a2d3d5 UG |
20 | |
21 | # Look for the library. | |
e579e0f7 | 22 | find_library(PCRE_LIBRARY NAMES pcre) |
22a2d3d5 UG |
23 | |
24 | # Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE. | |
e579e0f7 | 25 | include(FindPackageHandleStandardArgs) |
ad5611d8 | 26 | find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR) |
22a2d3d5 UG |
27 | |
28 | # Copy the results to the output variables. | |
e579e0f7 | 29 | if(PCRE_FOUND) |
ad5611d8 | 30 | set(PCRE_LIBRARIES ${PCRE_LIBRARY}) |
e579e0f7 MB |
31 | set(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) |
32 | else(PCRE_FOUND) | |
33 | set(PCRE_LIBRARIES) | |
34 | set(PCRE_INCLUDE_DIRS) | |
35 | endif() | |
22a2d3d5 | 36 | |
e579e0f7 | 37 | mark_as_advanced(PCRE_INCLUDE_DIRS PCRE_LIBRARIES) |