Mqfilter is built if possible

The mqfilter was not built by default even though it should have been. This has
been fixed but the filter is built only if librabbitmq is found. This was done
to avoid having the librabbitmq and its development headers as a hard
dependency.
This commit is contained in:
Markus Makela
2015-11-25 06:26:06 +02:00
parent 6ea209d13a
commit 443bbe73d2
5 changed files with 19 additions and 82 deletions

View File

@ -1,11 +1,12 @@
# This CMake file tries to find the the RabbitMQ library
# This CMake file tries to find the the RabbitMQ 0.5 library
# The following variables are set:
# RABBITMQ_FOUND - System has RabbitMQ client
# RABBITMQ_LIBRARIES - The RabbitMQ client library
# RABBITMQ_HEADERS - The RabbitMQ client headers
include(CheckCSourceCompiles)
find_library(RABBITMQ_LIBRARIES NAMES rabbitmq)
find_path(RABBITMQ_HEADERS amqp.h PATH_SUFFIXES mysql mariadb)
find_path(RABBITMQ_HEADERS amqp.h)
if(${RABBITMQ_LIBRARIES} MATCHES "NOTFOUND")
set(RABBITMQ_FOUND FALSE CACHE INTERNAL "")
@ -17,7 +18,9 @@ else()
endif()
set(CMAKE_REQUIRED_INCLUDES ${RABBITMQ_HEADERS})
check_c_source_compiles("#include <amqp.h>\n int main(){if(AMQP_DELIVERY_PERSISTENT){return 0;}return 1;}" HAVE_RABBITMQ50)
if(NOT HAVE_RABBITMQ50)
message(FATAL_ERROR "Old version of RabbitMQ-C library found. Version 0.5 or newer is required.")
endif()
if(RABBITMQ_FOUND AND NOT HAVE_RABBITMQ50)
message(WARNING "Old version of RabbitMQ-C library found. Version 0.5 or newer is required.")
endif()

View File

@ -57,7 +57,7 @@ macro(set_variables)
set(STATIC_EMBEDDED TRUE CACHE BOOL "Use static version of libmysqld")
# Build RabbitMQ components
set(BUILD_RABBITMQ FALSE CACHE BOOL "Build RabbitMQ components")
set(BUILD_RABBITMQ TRUE CACHE BOOL "Build RabbitMQ components")
# Build the binlog router
set(BUILD_BINLOG TRUE CACHE BOOL "Build binlog router")