Warning, /frameworks/kjs/cmake/FindPCRE.cmake is written in an unsupported language. File is not indexed.
0001 # - Try to find the PCRE regular expression library
0002 # Once done this will define
0003 #
0004 # PCRE_FOUND - system has the PCRE library
0005 # PCRE_INCLUDE_DIR - the PCRE include directory
0006 # PCRE_LIBRARIES - The libraries needed to use PCRE
0007
0008 # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
0009 #
0010 # Redistribution and use is allowed according to the terms of the BSD license.
0011 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0012
0013
0014 if (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
0015 # Already in cache, be silent
0016 set(PCRE_FIND_QUIETLY TRUE)
0017 endif (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
0018
0019
0020 if (NOT WIN32)
0021 # use pkg-config to get the directories and then use these values
0022 # in the FIND_PATH() and FIND_LIBRARY() calls
0023 find_package(PkgConfig)
0024
0025 pkg_check_modules(PC_PCRE QUIET libpcre)
0026
0027 set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER})
0028
0029 endif (NOT WIN32)
0030
0031 find_path(PCRE_INCLUDE_DIR pcre.h
0032 HINTS ${PC_PCRE_INCLUDEDIR} ${PC_PCRE_INCLUDE_DIRS}
0033 PATH_SUFFIXES pcre)
0034
0035 find_library(PCRE_PCRE_LIBRARY NAMES pcre pcred HINTS ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS})
0036
0037 find_library(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix pcreposixd HINTS ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS})
0038
0039 include(FindPackageHandleStandardArgs)
0040 find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY PCRE_PCREPOSIX_LIBRARY )
0041
0042 set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY})
0043
0044 mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY PCRE_PCRE_LIBRARY)