Added variables for RabbitMQ headers and libraries, added more error checks.

modified:   CMakeLists.txt
	modified:   README
	modified:   macros.cmake
	modified:   query_classifier/test/canonical_tests/CMakeLists.txt
	modified:   rabbitmq_consumer/CMakeLists.txt
	modified:   server/modules/filter/CMakeLists.txt
This commit is contained in:
Markus Makela
2014-09-22 13:14:53 +03:00
parent bf0d41674d
commit fc848665e5
6 changed files with 72 additions and 23 deletions

View File

@ -70,6 +70,7 @@ macro(check_deps)
if(DEPS_ERROR)
message(FATAL_ERROR "Cannot find dependencies: ${FAILED_DEPS}")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
endif()
endmacro()
@ -86,19 +87,23 @@ macro(check_dirs)
set(MYSQL_DIR ${MYSQL_DIR_LOC} CACHE PATH "Path to MySQL headers" FORCE)
if(${MYSQL_DIR} STREQUAL "MYSQL_DIR-NOTFOUND")
message(FATAL_ERROR "Fatal Error: MySQL headers were not found.")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
else()
message(STATUS "Using MySQL headers found at: ${MYSQL_DIR}")
endif()
# Find the errmsg.sys file if it was not defied
if( NOT ( DEFINED ERRMSG ) )
find_file(ERRMSG errmsg.sys PATHS /usr/share/mysql /usr/local/share/mysql ${CUSTOM_ERRMSG} PATH_SUFFIXES english)
if(${ERRMSG} STREQUAL "ERRMSG-NOTFOUND")
message(FATAL_ERROR "Fatal Error: The errmsg.sys file was not found.")
elseif(DEBUG_OUTPUT)
message(STATUS "Using errmsg.sys found at: ${ERRMSG}")
endif()
if( DEFINED ERRMSG )
find_file(ERRMSG_FILE errmsg.sys PATHS ${ERRMSG} NO_DEFAULT_PATH)
endif()
find_file(ERRMSG_FILE errmsg.sys PATHS /usr/share/mysql /usr/local/share/mysql PATH_SUFFIXES english)
if(${ERRMSG_FILE} MATCHES "ERRMSG_FILE-NOTFOUND")
message(FATAL_ERROR "Fatal Error: The errmsg.sys file was not found, please define the path to it by using -DERRMSG=<path>")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
else()
message(STATUS "Using errmsg.sys found at: ${ERRMSG_FILE}")
endif()
set(ERRMSG ${ERRMSG_FILE} CACHE FILEPATH "Path to the errmsg.sys file." FORCE)
# Find the embedded mysql library
if(STATIC_EMBEDDED)
@ -132,6 +137,7 @@ macro(check_dirs)
# Inform the user about the embedded library
if( (${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB_STATIC-NOTFOUND") OR (${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB_DYNAMIC-NOTFOUND"))
message(FATAL_ERROR "Library not found: libmysqld. If your install of MySQL is in a non-default location, please provide the location with -DEMBEDDED_LIB=<path to library>")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
else()
get_filename_component(EMBEDDED_LIB ${EMBEDDED_LIB} REALPATH)
message(STATUS "Using embedded library: ${EMBEDDED_LIB}")
@ -144,13 +150,42 @@ macro(check_dirs)
find_file(DEB_FNC init-functions PATHS /lib/lsb)
if(${DEB_FNC} MATCHES "DEB_FNC-NOTFOUND")
message(FATAL_ERROR "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, please confirm that your system files are OK.")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
else()
set(DEB_BASED TRUE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.")
endif()
else()
set(DEB_BASED FALSE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.")
endif()
#Check RabbitMQ headers and libraries
if(BUILD_RABBITMQ)
if(DEFINED RABBITMQ_LIB)
find_library(RMQ_LIB rabbitmq PATHS ${RABBITMQ_LIB} NO_DEFAULT_PATH)
endif()
find_library(RMQ_LIB rabbitmq)
if(RMQ_LIB STREQUAL "RMQ_LIB-NOTFOUND")
message(FATAL_ERROR "Cannot find RabbitMQ libraries, please define the path to the libraries with -DRABBITMQ_LIB=<path>")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
else()
set(RABBITMQ_LIB ${RMQ_LIB} CACHE PATH "Path to RabbitMQ libraries" FORCE)
message(STATUS "Using RabbitMQ libraries found at: ${RABBITMQ_LIB}")
endif()
if(DEFINED RABBITMQ_HEADERS)
find_file(RMQ_HEADERS amqp.h PATHS ${RABBITMQ_HEADERS} NO_DEFAULT_PATH)
endif()
find_file(RMQ_HEADERS amqp.h)
if(RMQ_HEADERS STREQUAL "RMQ_HEADERS-NOTFOUND")
message(FATAL_ERROR "Cannot find RabbitMQ headers, please define the path to the headers with -DRABBITMQ_HEADERS=<path>")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
else()
set(RABBITMQ_HEADERS ${RMQ_HEADERS} CACHE PATH "Path to RabbitMQ headers" FORCE)
message(STATUS "Using RabbitMQ headers found at: ${RABBITMQ_HEADERS}")
endif()
endif()
set(DEPS_OK TRUE CACHE BOOL "If all the dependencies were found.")