summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-03-04 01:22:53 +0100
committerSergei Golubchik <sergii@pisem.net>2014-03-04 01:22:53 +0100
commit016bd4fc5fff311dc4091b3b7329cd980dbaa14b (patch)
tree4d208f3494087c6bc289a911336580e3d6d91e34 /cmake
parent8705d00ab62b4d3f749b4b8cba07718e8fd54bcb (diff)
downloadmariadb-git-016bd4fc5fff311dc4091b3b7329cd980dbaa14b.tar.gz
MDEV-5620 CMake option to compile against an external PCRE library
Diffstat (limited to 'cmake')
-rw-r--r--cmake/jemalloc.cmake2
-rw-r--r--cmake/pcre.cmake16
-rw-r--r--cmake/plugin.cmake3
3 files changed, 18 insertions, 3 deletions
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index 3df17f362bc..b677f226266 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -46,7 +46,7 @@ ELSE()
ENDIF()
SET(WITH_JEMALLOC ${WITH_JEMALLOC_DEFAULT} CACHE STRING
- "Which jemalloc to use (possible values are 'no', 'bundled', 'system', 'yes' (system if possible, otherwise bundled)")
+ "Which jemalloc to use. Possible values are 'no', 'bundled', 'system', 'yes' (system if possible, otherwise bundled)")
MACRO (CHECK_JEMALLOC)
IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes")
diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake
new file mode 100644
index 00000000000..45d9bc01ddb
--- /dev/null
+++ b/cmake/pcre.cmake
@@ -0,0 +1,16 @@
+SET(WITH_PCRE "auto" CACHE STRING
+ "Which pcre to use (possible values are 'bundled', 'system', or 'auto')")
+
+MACRO (CHECK_PCRE)
+ IF(WITH_PCRE STREQUAL "system" OR WITH_PCRE STREQUAL "auto")
+ CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE)
+ ENDIF()
+ IF(NOT HAVE_PCRE)
+ IF (WITH_PCRE STREQUAL "system")
+ MESSAGE(FATAL_ERROR "system pcre is not found or unusable")
+ ENDIF()
+ SET(PCRE_INCLUDES ${CMAKE_BINARY_DIR}/pcre ${CMAKE_SOURCE_DIR}/pcre)
+ ADD_SUBDIRECTORY(pcre)
+ ENDIF()
+ENDMACRO()
+
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index d0847f1f84e..07372849a10 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -37,8 +37,7 @@ MACRO(MYSQL_ADD_PLUGIN)
# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
- ${CMAKE_BINARY_DIR}/pcre
- ${CMAKE_SOURCE_DIR}/pcre
+ ${PCRE_INCLUDES}
${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR})