Blame CMakeModules/FindPCRE.cmake
|
Packit |
8fb591 |
# Copyright (C) 2007-2009 LuaDist.
|
|
Packit |
8fb591 |
# Created by Peter Kapec <kapecp@gmail.com>
|
|
Packit |
8fb591 |
# Redistribution and use of this file is allowed according to the terms of the MIT license.
|
|
Packit |
8fb591 |
# Note:
|
|
Packit |
8fb591 |
# Searching headers and libraries is very simple and is NOT as powerful as scripts
|
|
Packit |
8fb591 |
# distributed with CMake, because LuaDist defines directories to search for.
|
|
Packit |
8fb591 |
# Everyone is encouraged to contact the author with improvements. Maybe this file
|
|
Packit |
8fb591 |
# becomes part of CMake distribution sometimes.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
# - Find pcre
|
|
Packit |
8fb591 |
# Find the native PCRE headers and libraries.
|
|
Packit |
8fb591 |
#
|
|
Packit |
8fb591 |
# PCRE_INCLUDE_DIRS - where to find pcre.h, etc.
|
|
Packit |
8fb591 |
# PCRE_LIBRARIES - List of libraries when using pcre.
|
|
Packit |
8fb591 |
# PCRE_FOUND - True if pcre found.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
# Look for the header file.
|
|
Packit |
8fb591 |
FIND_PATH(PCRE_INCLUDE_DIR NAMES pcre.h)
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
# Look for the library.
|
|
Packit |
8fb591 |
FIND_LIBRARY(PCRE_LIBRARY NAMES pcre)
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
# Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE.
|
|
Packit |
8fb591 |
INCLUDE(FindPackageHandleStandardArgs)
|
|
Packit |
8fb591 |
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR)
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
# Copy the results to the output variables.
|
|
Packit |
8fb591 |
IF(PCRE_FOUND)
|
|
Packit |
8fb591 |
SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
|
|
Packit |
8fb591 |
SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
|
|
Packit |
8fb591 |
ELSE(PCRE_FOUND)
|
|
Packit |
8fb591 |
SET(PCRE_LIBRARIES)
|
|
Packit |
8fb591 |
SET(PCRE_INCLUDE_DIRS)
|
|
Packit |
8fb591 |
ENDIF(PCRE_FOUND)
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
MARK_AS_ADVANCED(PCRE_INCLUDE_DIRS PCRE_LIBRARIES)
|