From 3f0de666acbda4a6d964606263653e802236f9dc Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sat, 20 Sep 2014 19:44:30 +0300 Subject: [PATCH] Changed the order of linking to resolve some debug build bugs and added the missing parent directory of the MYSQL_DIR into the included directories. --- CMakeLists.txt | 1 + log_manager/CMakeLists.txt | 2 +- log_manager/test/CMakeLists.txt | 4 ++-- server/core/CMakeLists.txt | 8 ++++---- server/modules/filter/CMakeLists.txt | 12 ++++++------ server/modules/filter/hint/CMakeLists.txt | 2 +- server/modules/monitor/CMakeLists.txt | 6 +++--- server/modules/protocol/CMakeLists.txt | 10 +++++----- server/modules/routing/CMakeLists.txt | 8 ++++---- server/modules/routing/readwritesplit/CMakeLists.txt | 2 +- utils/CMakeLists.txt | 3 +-- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa961fcb2..c99491617 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,7 @@ endif() include_directories(${MYSQL_DIR}) include_directories(${MYSQL_DIR}/private) include_directories(${MYSQL_DIR}/extra) +include_directories(${MYSQL_DIR}/..) include_directories(utils) include_directories(log_manager) include_directories(query_classifier) diff --git a/log_manager/CMakeLists.txt b/log_manager/CMakeLists.txt index 9351434ff..1cbe6cd87 100644 --- a/log_manager/CMakeLists.txt +++ b/log_manager/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(log_manager SHARED log_manager.cc ${CMAKE_SOURCE_DIR}/utils/skygw_utils.cc) +add_library(log_manager SHARED log_manager.cc) target_link_libraries(log_manager pthread aio stdc++) install(TARGETS log_manager DESTINATION lib) if(BUILD_TESTS) diff --git a/log_manager/test/CMakeLists.txt b/log_manager/test/CMakeLists.txt index 1763e5933..d3a22939e 100644 --- a/log_manager/test/CMakeLists.txt +++ b/log_manager/test/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(testlog testlog.c) add_executable(testorder testorder.c) -target_link_libraries(testlog utils pthread log_manager) -target_link_libraries(testorder utils pthread log_manager) +target_link_libraries(testlog pthread log_manager utils) +target_link_libraries(testorder pthread log_manager utils) add_test(NAME TestLogOrder COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/logorder.sh ${CMAKE_CURRENT_BINARY_DIR}/test.log 500 0 500 ${CMAKE_CURRENT_BINARY_DIR}) \ No newline at end of file diff --git a/server/core/CMakeLists.txt b/server/core/CMakeLists.txt index 45bf6f658..1ec49955c 100644 --- a/server/core/CMakeLists.txt +++ b/server/core/CMakeLists.txt @@ -1,20 +1,20 @@ file(GLOB FULLCORE_SRC *.c) add_library(fullcore STATIC ${FULLCORE_SRC}) -target_link_libraries(fullcore utils log_manager aio pthread crypt dl ${EMBEDDED_LIB} crypto inih z) +target_link_libraries(fullcore log_manager utils aio pthread crypt dl ${EMBEDDED_LIB} crypto inih z) add_executable(maxscale atomic.c buffer.c spinlock.c gateway.c gw_utils.c utils.c dcb.c load_utils.c session.c service.c server.c poll.c config.c users.c hashtable.c dbusers.c thread.c gwbitmask.c monitor.c adminusers.c secrets.c filter.c modutil.c hint.c housekeeper.c) -target_link_libraries(maxscale ${EMBEDDED_LIB} utils log_manager ssl aio pthread crypt dl crypto inih z rt m stdc++) +target_link_libraries(maxscale ${EMBEDDED_LIB} log_manager utils ssl aio pthread crypt dl crypto inih z rt m stdc++) install(TARGETS maxscale DESTINATION bin) add_executable(maxkeys maxkeys.c secrets.c utils.c) -target_link_libraries(maxkeys utils log_manager pthread crypt crypto) +target_link_libraries(maxkeys log_manager utils pthread crypt crypto) install(TARGETS maxkeys DESTINATION bin) add_executable(maxpasswd maxpasswd.c secrets.c utils.c) -target_link_libraries(maxpasswd utils log_manager pthread crypt crypto) +target_link_libraries(maxpasswd log_manager utils pthread crypt crypto) install(TARGETS maxpasswd DESTINATION bin) if(BUILD_TESTS) diff --git a/server/modules/filter/CMakeLists.txt b/server/modules/filter/CMakeLists.txt index 895b9eb20..61c658ace 100644 --- a/server/modules/filter/CMakeLists.txt +++ b/server/modules/filter/CMakeLists.txt @@ -1,7 +1,7 @@ if(BUILD_RABBITMQ) if(RABBITMQ_LIB AND RABBITMQ_HEADERS) add_library(mqfilter SHARED mqfilter.c) - target_link_libraries(mqfilter utils query_classifier log_manager rabbitmq) + target_link_libraries(mqfilter query_classifier log_manager utils rabbitmq) install(TARGETS mqfilter DESTINATION modules) else() message(ERROR "Error: Cannot find the required librabbitmq-c locations, please check that you have them configured correctly.") @@ -9,23 +9,23 @@ if(BUILD_RABBITMQ) endif() add_library(regexfilter SHARED regexfilter.c) -target_link_libraries(regexfilter utils log_manager) +target_link_libraries(regexfilter log_manager utils) install(TARGETS regexfilter DESTINATION modules) add_library(testfilter SHARED testfilter.c) -target_link_libraries(testfilter utils log_manager) +target_link_libraries(testfilter log_manager utils) install(TARGETS testfilter DESTINATION modules) add_library(qlafilter SHARED qlafilter.c) -target_link_libraries(qlafilter utils log_manager) +target_link_libraries(qlafilter log_manager utils) install(TARGETS qlafilter DESTINATION modules) add_library(tee SHARED tee.c) -target_link_libraries(tee utils log_manager) +target_link_libraries(tee log_manager utils) install(TARGETS tee DESTINATION modules) add_library(topfilter SHARED topfilter.c) -target_link_libraries(topfilter utils log_manager) +target_link_libraries(topfilter log_manager utils) install(TARGETS topfilter DESTINATION modules) add_subdirectory(hint) \ No newline at end of file diff --git a/server/modules/filter/hint/CMakeLists.txt b/server/modules/filter/hint/CMakeLists.txt index 62d2e9ee2..f47cb637e 100644 --- a/server/modules/filter/hint/CMakeLists.txt +++ b/server/modules/filter/hint/CMakeLists.txt @@ -1,4 +1,4 @@ add_library(hintfilter SHARED hintfilter.c hintparser.c) set_target_properties(hintfilter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib) -target_link_libraries(hintfilter utils ssl log_manager) +target_link_libraries(hintfilter ssl log_manager utils) install(TARGETS hintfilter DESTINATION modules) \ No newline at end of file diff --git a/server/modules/monitor/CMakeLists.txt b/server/modules/monitor/CMakeLists.txt index 918ca0c85..d94312682 100644 --- a/server/modules/monitor/CMakeLists.txt +++ b/server/modules/monitor/CMakeLists.txt @@ -1,11 +1,11 @@ add_library(mysqlmon SHARED mysql_mon.c) -target_link_libraries(mysqlmon utils log_manager ${EMBEDDED_LIB}) +target_link_libraries(mysqlmon log_manager utils ${EMBEDDED_LIB}) install(TARGETS mysqlmon DESTINATION modules) add_library(galeramon SHARED galera_mon.c) -target_link_libraries(galeramon utils log_manager ${EMBEDDED_LIB}) +target_link_libraries(galeramon log_manager utils ${EMBEDDED_LIB}) install(TARGETS galeramon DESTINATION modules) add_library(ndbclustermon SHARED ndbcluster_mon.c) -target_link_libraries(ndbclustermon utils log_manager ${EMBEDDED_LIB}) +target_link_libraries(ndbclustermon log_manager utils ${EMBEDDED_LIB}) install(TARGETS ndbclustermon DESTINATION modules) \ No newline at end of file diff --git a/server/modules/protocol/CMakeLists.txt b/server/modules/protocol/CMakeLists.txt index 0481a8907..e51ff1495 100644 --- a/server/modules/protocol/CMakeLists.txt +++ b/server/modules/protocol/CMakeLists.txt @@ -1,21 +1,21 @@ add_library(MySQLClient SHARED mysql_client.c mysql_common.c) -target_link_libraries(MySQLClient utils log_manager) +target_link_libraries(MySQLClient log_manager utils) install(TARGETS MySQLClient DESTINATION modules) add_library(MySQLBackend SHARED mysql_backend.c mysql_common.c) -target_link_libraries(MySQLBackend utils log_manager) +target_link_libraries(MySQLBackend log_manager utils) install(TARGETS MySQLBackend DESTINATION modules) add_library(telnetd SHARED telnetd.c) -target_link_libraries(telnetd utils log_manager) +target_link_libraries(telnetd log_manager utils) install(TARGETS telnetd DESTINATION modules) add_library(HTTPD SHARED httpd.c) -target_link_libraries(HTTPD utils log_manager) +target_link_libraries(HTTPD log_manager utils) install(TARGETS HTTPD DESTINATION modules) add_library(maxscaled SHARED maxscaled.c) -target_link_libraries(maxscaled utils log_manager) +target_link_libraries(maxscaled log_manager utils) install(TARGETS maxscaled DESTINATION modules) diff --git a/server/modules/routing/CMakeLists.txt b/server/modules/routing/CMakeLists.txt index d9cd5a6cc..595a216c8 100644 --- a/server/modules/routing/CMakeLists.txt +++ b/server/modules/routing/CMakeLists.txt @@ -1,17 +1,17 @@ add_library(testroute SHARED testroute.c) -target_link_libraries(testroute utils log_manager) +target_link_libraries(testroute log_manager utils) install(TARGETS testroute DESTINATION modules) add_library(readconnroute SHARED readconnroute.c) -target_link_libraries(readconnroute utils log_manager) +target_link_libraries(readconnroute log_manager utils) install(TARGETS readconnroute DESTINATION modules) add_library(debugcli SHARED debugcli.c debugcmd.c) -target_link_libraries(debugcli utils log_manager) +target_link_libraries(debugcli log_manager utils) install(TARGETS debugcli DESTINATION modules) add_library(cli SHARED cli.c debugcmd.c) -target_link_libraries(cli utils log_manager) +target_link_libraries(cli log_manager utils) install(TARGETS cli DESTINATION modules) add_subdirectory(readwritesplit) diff --git a/server/modules/routing/readwritesplit/CMakeLists.txt b/server/modules/routing/readwritesplit/CMakeLists.txt index 42ea0d7fa..2821ca3ed 100644 --- a/server/modules/routing/readwritesplit/CMakeLists.txt +++ b/server/modules/routing/readwritesplit/CMakeLists.txt @@ -1,5 +1,5 @@ add_library(readwritesplit SHARED readwritesplit.c) -target_link_libraries(readwritesplit utils ssl pthread log_manager query_classifier ${EMBEDDED_LIB}) +target_link_libraries(readwritesplit ssl pthread log_manager utils query_classifier ${EMBEDDED_LIB}) install(TARGETS readwritesplit DESTINATION modules) if(BUILD_TESTS) add_subdirectory(test) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 29527928e..8a2cfddb6 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -1,3 +1,2 @@ -set(UTILS_HEADERS skygw_debug.h skygw_types.h skygw_utils.h) -add_library(utils skygw_utils.cc ${UTILS_HEADERS}) +add_library(utils skygw_utils.cc) target_link_libraries(utils stdc++) \ No newline at end of file