2017-04-19 00:25:57 +00:00
|
|
|
option (ENABLE_MYSQL "Enable MySQL" ON)
|
2017-04-14 19:38:56 +00:00
|
|
|
|
|
|
|
if (ENABLE_MYSQL)
|
|
|
|
set (MYSQL_LIB_PATHS
|
|
|
|
"/usr/local/opt/mysql/lib"
|
|
|
|
"/usr/local/lib/mysql/"
|
|
|
|
"/usr/local/lib/mysql"
|
|
|
|
"/usr/local/lib64/mysql"
|
|
|
|
"/usr/mysql/lib/mysql"
|
|
|
|
"/usr/mysql/lib64/mysql"
|
|
|
|
"/usr/lib/mysql"
|
|
|
|
"/usr/lib64/mysql"
|
|
|
|
"/lib/mysql"
|
2017-04-19 01:06:29 +00:00
|
|
|
"/lib64/mysql")
|
2017-04-14 19:38:56 +00:00
|
|
|
|
|
|
|
set (MYSQL_INCLUDE_PATHS
|
|
|
|
"/usr/local/opt/mysql/include"
|
|
|
|
"/usr/mysql/include/mysql"
|
|
|
|
"/usr/local/include/mysql"
|
2017-04-19 01:06:29 +00:00
|
|
|
"/usr/include/mysql")
|
2017-01-12 12:17:54 +00:00
|
|
|
|
2017-04-14 19:38:56 +00:00
|
|
|
find_path (MYSQL_INCLUDE_DIR NAMES mysql/mysql.h PATHS ${MYSQL_INCLUDE_PATHS})
|
|
|
|
|
|
|
|
if (USE_STATIC_LIBRARIES)
|
|
|
|
find_library (STATIC_MYSQLCLIENT_LIB libmysqlclient.a PATHS ${MYSQL_LIB_PATHS})
|
|
|
|
else ()
|
|
|
|
find_library (MYSQLCLIENT_LIB mysqlclient PATHS ${MYSQL_LIB_PATHS})
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (MYSQL_INCLUDE_DIR AND (STATIC_MYSQLCLIENT_LIB OR MYSQLCLIENT_LIB))
|
|
|
|
set (MYSQL_FOUND 1)
|
|
|
|
include_directories (${MYSQL_INCLUDE_DIR})
|
|
|
|
endif ()
|
|
|
|
|
2017-04-19 00:25:57 +00:00
|
|
|
if (MYSQL_FOUND)
|
|
|
|
set(USE_MYSQL 1)
|
|
|
|
set(MYSQLXX_LIBRARY mysqlxx)
|
2017-04-19 01:06:29 +00:00
|
|
|
else ()
|
|
|
|
|
2017-04-19 00:25:57 +00:00
|
|
|
endif ()
|
2017-04-14 19:38:56 +00:00
|
|
|
endif ()
|
2017-01-12 12:17:54 +00:00
|
|
|
|
2017-04-19 01:06:29 +00:00
|
|
|
if (USE_MYSQL)
|
|
|
|
message (STATUS "Using mysqlclient=${MYSQL_FOUND}: ${MYSQL_INCLUDE_DIR} : ${MYSQLCLIENT_LIB}; static=${STATIC_MYSQLCLIENT_LIB}")
|
|
|
|
else ()
|
|
|
|
message (STATUS "Build without mysqlclient (support for MYSQL dictionary source will be disabled)")
|
|
|
|
endif ()
|