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

@ -259,3 +259,8 @@ When you run the `make testall` target after configuring the build with CMake a
After testing has finished you can find a full testlog generated by CTest in `Testing/Temporary/` directory and MaxScale's log files in the `log/` directory of the build root.
## Building the MaxScale package
First make sure you have the required libraries for your platform, including either rpmbuild for RHEL variants or dpkg-dev for Debian variants.
If you wish to generate your own MaxScale package, you can do so by first configuring CMake with -DPACKAGE=Y. This will enable the package building target, `package` for the Makefile build system. After configuring, it should be as simple as running the `make package` command in the build directory. This will result in two packages, a tar.gz package and either a .rpm package or a .deb package depending on your system.

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()