Added optional RabbitMQ component configuration
Changed all the configuration variables to cached Fixed some errors in tests
This commit is contained in:
@ -5,7 +5,7 @@ enable_testing()
|
||||
project(MaxScale)
|
||||
|
||||
set_maxscale_version()
|
||||
set_testing_variables()
|
||||
set_variables()
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/server/include/version.h.in ${CMAKE_SOURCE_DIR}/server/include/version.h)
|
||||
|
||||
|
43
macros.cmake
43
macros.cmake
@ -8,41 +8,38 @@ macro(set_maxscale_version)
|
||||
|
||||
endmacro()
|
||||
|
||||
macro(set_testing_variables)
|
||||
macro(set_variables)
|
||||
|
||||
# hostname or IP address of MaxScale's host
|
||||
if(NOT TEST_HOST)
|
||||
set(TEST_HOST "127.0.0.1")
|
||||
endif()
|
||||
set(TEST_HOST "127.0.0.1" CACHE STRING "hostname or IP address of MaxScale's host")
|
||||
|
||||
# port of read connection router module
|
||||
if(NOT TEST_PORT_RW)
|
||||
set(TEST_PORT_RW "4008")
|
||||
endif()
|
||||
set(TEST_PORT_RW "4008" CACHE STRING "port of read connection router module")
|
||||
|
||||
# port of read/write split router module
|
||||
if(NOT TEST_PORT_RW)
|
||||
set(TEST_PORT_RW "4006")
|
||||
endif()
|
||||
set(TEST_PORT_RW "4006" CACHE STRING "port of read/write split router module")
|
||||
|
||||
# port of read/write split router module with hints
|
||||
if(NOT TEST_PORT_RW_HINT)
|
||||
set(TEST_PORT_RW_HINT "4006")
|
||||
endif()
|
||||
set(TEST_PORT_RW_HINT "4006" CACHE STRING "port of read/write split router module with hints")
|
||||
|
||||
# master's server_id
|
||||
if(NOT TEST_MASTER_ID)
|
||||
set(TEST_MASTER_ID "3000")
|
||||
endif()
|
||||
# master test server server_id
|
||||
set(TEST_MASTER_ID "3000" CACHE STRING "master test server server_id")
|
||||
|
||||
# username of MaxScale user
|
||||
if(NOT TEST_USER)
|
||||
set(TEST_USER "maxuser")
|
||||
endif()
|
||||
set(TEST_USER "maxuser" CACHE STRING "username of MaxScale user")
|
||||
|
||||
# password of MaxScale user
|
||||
if(NOT TEST_PASSWORD)
|
||||
set(TEST_PASSWORD "maxpwd")
|
||||
endif()
|
||||
set(TEST_PASSWORD "maxpwd" CACHE STRING "password of MaxScale user")
|
||||
|
||||
# Use static version of libmysqld
|
||||
set(STATIC_EMBEDDED FALSE CACHE BOOL "Use static version of libmysqld")
|
||||
|
||||
# Build RabbitMQ components
|
||||
set(BUILD_RABBITMQ FALSE CACHE BOOL "Build RabbitMQ components")
|
||||
|
||||
# Use gcov build flags
|
||||
set(GCOV FALSE CACHE BOOL "Use gcov build flags")
|
||||
|
||||
# Install init.d scripts and ldconf configuration files
|
||||
set(INSTALL_SYSTEM_FILES TRUE CACHE BOOL "Install init.d scripts and ldconf configuration files")
|
||||
endmacro()
|
@ -1,44 +1,35 @@
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
|
||||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 /usr/lib/mariadb /usr/lib64/mariadb)
|
||||
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} /usr/include /usr/local/include /usr/include/mysql /usr/local/include/mysql /usr/include/mariadb /usr/local/include/mariadb)
|
||||
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
project (consumer)
|
||||
|
||||
find_path(MYSQL_INCLUDE_DIRS mysql.h)
|
||||
find_library(MYSQL_LIBRARIES NAMES mysqlclient)
|
||||
find_library(RABBITMQ_C_LIBRARIES NAMES rabbitmq)
|
||||
find_path(RABBITMQ_C_DIRS amqp.h)
|
||||
find_library(RABBITMQ_C_LIB NAMES rabbitmq)
|
||||
find_library(MYSQL_CLIENT_LIB NAMES mysqlclient PATHS /usr/lib /usr/lib64 PATH_SUFFIXES mysql mariadb)
|
||||
|
||||
include_directories(${MYSQL_INCLUDE_DIRS})
|
||||
include_directories(${RABBITMQ_C_INCLUDE_DIRS})
|
||||
include_directories(${CMAKE_SOURCE_DIR}/inih)
|
||||
include_directories(${RABBITMQ_C_DIRS})
|
||||
|
||||
add_subdirectory (inih)
|
||||
link_directories(${CMAKE_SOURCE_DIR}/inih)
|
||||
if( ( RABBITMQ_C_LIB AND RABBITMQ_C_DIRS ) AND MYSQL_CLIENT_LIB )
|
||||
|
||||
if(RABBITMQ_C_LIBRARIES AND MYSQL_LIBRARIES AND MYSQL_INCLUDE_DIRS)
|
||||
|
||||
add_executable (consumer consumer.c ${MYSQL_LIBRARIES} ${RABBITMQ_C_LIBRARIES})
|
||||
target_link_libraries(consumer mysqlclient)
|
||||
target_link_libraries(consumer rabbitmq)
|
||||
target_link_libraries(consumer inih)
|
||||
install(TARGETS consumer DESTINATION bin)
|
||||
install(FILES consumer.cnf DESTINATION share/consumer)
|
||||
add_executable (consumer consumer.c ${MYSQL_CLIENT_LIB} ${RABBITMQ_C_LIBRARIES})
|
||||
target_link_libraries(consumer mysqlclient)
|
||||
target_link_libraries(consumer rabbitmq)
|
||||
target_link_libraries(consumer inih)
|
||||
install(TARGETS consumer DESTINATION bin)
|
||||
install(FILES consumer.cnf DESTINATION etc)
|
||||
|
||||
|
||||
else(RABBITMQ_C_LIBRARIES AND MYSQL_LIBRARIES AND MYSQL_INCLUDE_DIRS)
|
||||
message(FATAL_ERROR "Error: Can not find requred libraries: libmysqld, librabbitmq.")
|
||||
else()
|
||||
message(FATAL_ERROR "Error: Can not find requred libraries.")
|
||||
endif()
|
||||
|
||||
endif(RABBITMQ_C_LIBRARIES AND MYSQL_LIBRARIES AND MYSQL_INCLUDE_DIRS)
|
||||
# Packaging of RabbitMQ disabled for now
|
||||
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "RabbitMQ Consumer Client")
|
||||
set(CPACK_PACKAGE_NAME "RabbitMQ Consumer")
|
||||
set(CPACK_GENERATOR "RPM")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "1")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "0")
|
||||
set(CPACK_RPM_PACKAGE_NAME "rabbitmq-consumer")
|
||||
set(CPACK_RPM_PACKAGE_VENDOR "SkySQL Ab")
|
||||
set(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
|
||||
include(CPack)
|
||||
#set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "RabbitMQ Consumer Client")
|
||||
#set(CPACK_PACKAGE_NAME "RabbitMQ Consumer")
|
||||
#set(CPACK_GENERATOR "RPM")
|
||||
#set(CPACK_PACKAGE_VERSION_MAJOR "1")
|
||||
#set(CPACK_PACKAGE_VERSION_MINOR "0")
|
||||
#set(CPACK_RPM_PACKAGE_NAME "rabbitmq-consumer")
|
||||
#set(CPACK_RPM_PACKAGE_VENDOR "SkySQL Ab")
|
||||
#set(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
|
||||
#include(CPack)
|
@ -2,7 +2,7 @@ if(BUILD_RABBITMQ)
|
||||
add_library(mqfilter SHARED mqfilter.c)
|
||||
set_target_properties(mqfilter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib)
|
||||
target_link_libraries(mqfilter utils query_classifier log_manager rabbitmq)
|
||||
install(TARGETS DESTINATION modules)
|
||||
install(TARGETS mqfilter DESTINATION modules)
|
||||
endif(BUILD_RABBITMQ)
|
||||
|
||||
add_library(regexfilter SHARED regexfilter.c)
|
||||
|
2
server/test/startmaxscale.sh
Normal file
2
server/test/startmaxscale.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
$1 $2 &
|
Reference in New Issue
Block a user