fixed some variables being compared to the wrong string

This commit is contained in:
Markus Makela
2014-09-22 15:26:24 +03:00
parent fc848665e5
commit d548d74bee
2 changed files with 24 additions and 13 deletions

View File

@ -69,28 +69,30 @@ macro(check_deps)
endforeach()
if(DEPS_ERROR)
message(FATAL_ERROR "Cannot find dependencies: ${FAILED_DEPS}")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
message(FATAL_ERROR "Cannot find dependencies: ${FAILED_DEPS}")
endif()
endmacro()
macro(check_dirs)
# Find the MySQL headers if they were not defined
if(DEFINED MYSQL_DIR)
message(STATUS "Searching for MySQL headers at: ${MYSQL_DIR}")
find_path(MYSQL_DIR_LOC mysql.h PATHS ${MYSQL_DIR} PATH_SUFFIXES mysql mariadb NO_DEFAULT_PATH)
else()
find_path(MYSQL_DIR_LOC mysql.h PATH_SUFFIXES mysql mariadb)
endif()
find_path(MYSQL_DIR_LOC mysql.h PATH_SUFFIXES mysql mariadb)
message(STATUS "Search returned: ${MYSQL_DIR_LOC}")
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.")
if(${MYSQL_DIR_LOC} STREQUAL "MYSQL_DIR_LOC-NOTFOUND")
set(DEPS_OK FALSE CACHE BOOL "If all the dependencies were found.")
message(FATAL_ERROR "Fatal Error: MySQL headers were not found.")
else()
message(STATUS "Using MySQL headers found at: ${MYSQL_DIR}")
set(MYSQL_DIR ${MYSQL_DIR_LOC} CACHE PATH "Path to MySQL headers" FORCE)
endif()
set(MYSQL_DIR_LOC "" INTERNAL)
# Find the errmsg.sys file if it was not defied
if( DEFINED ERRMSG )
@ -98,12 +100,13 @@ macro(check_dirs)
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.")
message(FATAL_ERROR "Fatal Error: The errmsg.sys file was not found, please define the path to it by using -DERRMSG=<path>")
else()
message(STATUS "Using errmsg.sys found at: ${ERRMSG_FILE}")
endif()
set(ERRMSG ${ERRMSG_FILE} CACHE FILEPATH "Path to the errmsg.sys file." FORCE)
set(ERRMSG_FILE "" INTERNAL)
# Find the embedded mysql library
if(STATIC_EMBEDDED)
@ -119,12 +122,12 @@ macro(check_dirs)
message(STATUS "Search returned: ${EMBEDDED_LIB_STATIC}")
set(EMBEDDED_LIB ${EMBEDDED_LIB_STATIC} CACHE FILEPATH "Path to libmysqld" FORCE)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
set(OLD_SUFFIXES "" INTERNAL)
else()
if (DEFINED EMBEDDED_LIB)
message(STATUS "Searching for libmysqld.so at: ${EMBEDDED_LIB}")
find_library(EMBEDDED_LIB_DYNAMIC mysqld PATHS ${EMBEDDED_LIB} PATH_SUFFIXES mysql mariadb NO_DEFAULT_PATH)
else()
find_library(EMBEDDED_LIB_DYNAMIC mysqld PATH_SUFFIXES mysql mariadb)
endif()
@ -132,12 +135,13 @@ macro(check_dirs)
set(EMBEDDED_LIB ${EMBEDDED_LIB_DYNAMIC} CACHE FILEPATH "Path to libmysqld" FORCE)
endif()
set(EMBEDDED_LIB_DYNAMIC "" INTERNAL)
set(EMBEDDED_LIB_STATIC "" INTERNAL)
# 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.")
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>")
else()
get_filename_component(EMBEDDED_LIB ${EMBEDDED_LIB} REALPATH)
message(STATUS "Using embedded library: ${EMBEDDED_LIB}")
@ -149,14 +153,16 @@ macro(check_dirs)
if(${RPM_FNC} MATCHES "RPM_FNC-NOTFOUND")
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.")
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.")
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()
set(DEB_FNC "" INTERNAL)
set(RPM_FNC "" INTERNAL)
#Check RabbitMQ headers and libraries
if(BUILD_RABBITMQ)
@ -166,8 +172,8 @@ macro(check_dirs)
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.")
message(FATAL_ERROR "Cannot find RabbitMQ libraries, please define the path to the libraries with -DRABBITMQ_LIB=<path>")
else()
set(RABBITMQ_LIB ${RMQ_LIB} CACHE PATH "Path to RabbitMQ libraries" FORCE)
message(STATUS "Using RabbitMQ libraries found at: ${RABBITMQ_LIB}")
@ -178,8 +184,8 @@ macro(check_dirs)
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.")
message(FATAL_ERROR "Cannot find RabbitMQ headers, please define the path to the headers with -DRABBITMQ_HEADERS=<path>")
else()
set(RABBITMQ_HEADERS ${RMQ_HEADERS} CACHE PATH "Path to RabbitMQ headers" FORCE)
message(STATUS "Using RabbitMQ headers found at: ${RABBITMQ_HEADERS}")