Commit 016bd4fc authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5620 CMake option to compile against an external PCRE library

parent 8705d00a
...@@ -153,6 +153,7 @@ INCLUDE(readline) ...@@ -153,6 +153,7 @@ INCLUDE(readline)
INCLUDE(libutils) INCLUDE(libutils)
INCLUDE(dtrace) INCLUDE(dtrace)
INCLUDE(jemalloc) INCLUDE(jemalloc)
INCLUDE(pcre)
INCLUDE(ctest) INCLUDE(ctest)
INCLUDE(plugin) INCLUDE(plugin)
INCLUDE(install_macros) INCLUDE(install_macros)
...@@ -362,6 +363,8 @@ MYSQL_CHECK_READLINE() ...@@ -362,6 +363,8 @@ MYSQL_CHECK_READLINE()
SET(MALLOC_LIBRARY "system") SET(MALLOC_LIBRARY "system")
CHECK_JEMALLOC() CHECK_JEMALLOC()
CHECK_PCRE()
# #
# Setup maintainer mode options. Platform checks are # Setup maintainer mode options. Platform checks are
# not run with the warning options as to not perturb fragile checks # not run with the warning options as to not perturb fragile checks
...@@ -397,7 +400,6 @@ ADD_SUBDIRECTORY(include) ...@@ -397,7 +400,6 @@ ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(dbug) ADD_SUBDIRECTORY(dbug)
ADD_SUBDIRECTORY(strings) ADD_SUBDIRECTORY(strings)
ADD_SUBDIRECTORY(vio) ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(pcre)
ADD_SUBDIRECTORY(mysys) ADD_SUBDIRECTORY(mysys)
ADD_SUBDIRECTORY(mysys_ssl) ADD_SUBDIRECTORY(mysys_ssl)
ADD_SUBDIRECTORY(libmysql) ADD_SUBDIRECTORY(libmysql)
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/mysys_ssl ${CMAKE_SOURCE_DIR}/mysys_ssl
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS} ${SSL_INCLUDE_DIRS}
......
...@@ -46,7 +46,7 @@ ELSE() ...@@ -46,7 +46,7 @@ ELSE()
ENDIF() ENDIF()
SET(WITH_JEMALLOC ${WITH_JEMALLOC_DEFAULT} CACHE STRING 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) MACRO (CHECK_JEMALLOC)
IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes") IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes")
......
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()
...@@ -37,8 +37,7 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -37,8 +37,7 @@ MACRO(MYSQL_ADD_PLUGIN)
# Add common include directories # Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${SSL_INCLUDE_DIRS} ${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR}) ${ZLIB_INCLUDE_DIR})
......
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysql ${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/strings ${CMAKE_SOURCE_DIR}/strings
${SSL_INCLUDE_DIRS} ${SSL_INCLUDE_DIRS}
${SSL_INTERNAL_INCLUDE_DIRS} ${SSL_INTERNAL_INCLUDE_DIRS}
......
...@@ -22,8 +22,7 @@ ${CMAKE_SOURCE_DIR}/libmysql ...@@ -22,8 +22,7 @@ ${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_SOURCE_DIR}/libmysqld ${CMAKE_SOURCE_DIR}/libmysqld
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/sql ${CMAKE_BINARY_DIR}/sql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS} ${SSL_INCLUDE_DIRS}
${SSL_INTERNAL_INCLUDE_DIRS} ${SSL_INTERNAL_INCLUDE_DIRS}
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include ${CMAKE_SOURCE_DIR}/libmysqld/include
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${MY_READLINE_INCLUDE_DIR} ${MY_READLINE_INCLUDE_DIR}
) )
......
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${SSL_INCLUDE_DIRS}) ${SSL_INCLUDE_DIRS})
SET(FEEDBACK_SOURCES feedback.cc sender_thread.cc SET(FEEDBACK_SOURCES feedback.cc sender_thread.cc
......
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
MYSQL_ADD_PLUGIN(QUERY_CACHE_INFO qc_info.cc) MYSQL_ADD_PLUGIN(QUERY_CACHE_INFO qc_info.cc)
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS} ${SSL_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}/sql ${CMAKE_BINARY_DIR}/sql
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_DEFINITIONS(-DMYSQL_SERVER) ADD_DEFINITIONS(-DMYSQL_SERVER)
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/include/mysql ${CMAKE_SOURCE_DIR}/include/mysql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${SSL_INCLUDE_DIRS} ${SSL_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/unittest/mytap ${CMAKE_SOURCE_DIR}/unittest/mytap
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/pcre ${PCRE_INCLUDES}
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
MY_ADD_TESTS(bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc MY_ADD_TESTS(bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment