2 # Find the native PCRE includes and library
4 # PCRE_INCLUDE_DIRS, where to find pcre.h, Set when
5 # PCRE_INCLUDE_DIR is found.
6 # PCRE_LIBRARIES, libraries to link against to use PCRE.
7 # PCRE_ROOT_DIR, The base directory to search for PCRE.
8 # This can also be an environment variable.
9 # PCRE_FOUND, If false, do not try to use PCRE.
11 # also defined, but not for general use are
12 # PCRE_LIBRARY, where to find the PCRE library.
14 #=============================================================================
15 # Copyright 2011 Blender Foundation.
17 # Distributed under the OSI-approved BSD License (the "License");
18 # see accompanying file Copyright.txt for details.
20 # This software is distributed WITHOUT ANY WARRANTY; without even the
21 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 # See the License for more information.
23 #=============================================================================
25 # If PCRE_ROOT_DIR was defined in the environment, use it.
26 IF(NOT PCRE_ROOT_DIR AND NOT $ENV{PCRE_ROOT_DIR} STREQUAL "")
27 SET(PCRE_ROOT_DIR $ENV{PCRE_ROOT_DIR})
34 /opt/local # DarwinPorts
38 FIND_PATH(PCRE_INCLUDE_DIR pcre.h
46 FIND_LIBRARY(PCRE_LIBRARY
55 # handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if
56 # all listed variables are TRUE
57 INCLUDE(FindPackageHandleStandardArgs)
58 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG
59 PCRE_LIBRARY PCRE_INCLUDE_DIR)
62 SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
63 SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})