Added FindPCRE.cmake which is used by the FindMySQL.cmake.

This commit is contained in:
Markus Makela
2015-04-16 18:11:29 +03:00
parent 39bbc93bbc
commit 254b1bf05d
3 changed files with 27 additions and 2 deletions

View File

@ -91,8 +91,13 @@ check_library_exists(${EMBEDDED_LIB} pcre_stack_guard ${EMBEDDED_LIB} HAVE_EMBED
if(HAVE_EMBEDDED_PCRE)
set(PCRE_LINK_FLAGS "" CACHE INTERNAL "pcre linker flags")
else()
message(STATUS "Embedded mysqld does not have pcre_stack_guard, linking with system pcre.")
set(PCRE_LINK_FLAGS "pcre" CACHE INTERNAL "pcre linker flags")
find_package(PCRE)
if(PCRE_FOUND)
set(PCRE_LINK_FLAGS "pcre" CACHE INTERNAL "pcre linker flags")
message(STATUS "Embedded mysqld does not have pcre_stack_guard, linking with system pcre.")
else()
message(FATAL_ERROR "Could not find PCRE libraries.")
endif()
endif()
if( (${EMBEDDED_LIB} MATCHES "NOTFOUND") OR (${EMBEDDED_LIB} MATCHES "NOTFOUND"))
message(FATAL_ERROR "Library not found: libmysqld. If your install of MySQL is in a non-default location, please provide the location with -DEMBEDDED_LIB=<path to library>")

15
cmake/FindPCRE.cmake Normal file
View File

@ -0,0 +1,15 @@
# This CMake file tries to find the Perl regular expression libraries
# The following variables are set:
# PCRE_FOUND - System has the PCRE library
# PCRE_LIBRARIES - The PCRE library file
# PCRE_INCLUDE_DIRS - The folder with the PCRE headers
find_library(PCRE_LIBRARIES NAMES pcre)
find_path(PCRE_INCLUDE_DIRS pcre.h)
if(PCRE_LIBRARIES AND PCRE_INCLUDE_DIRS)
message(STATUS "PCRE libs: ${PCRE_LIBRARIES}")
message(STATUS "PCRE include directory: ${PCRE_INCLUDE_DIRS}")
set(PCRE_FOUND TRUE CACHE INTERNAL "Found PCRE libraries")
else()
message(STATUS "PCRE not found")
endif()