From 5f1bf903ed13695da0dd896d382f1b9e26590654 Mon Sep 17 00:00:00 2001 From: dmatetelki Date: Tue, 10 May 2016 16:16:52 +0200 Subject: [PATCH] fixing make files, removing mysql wrappers from active files --- CMakeLists.txt | 2 +- lib/cpp_utils/CMakeLists.txt | 4 +++- lib/cpp_utils/SocketServer.cpp | 2 +- other/CMakeLists.txt | 23 +++++++++++-------- {lib/cpp_utils => other}/MysqlClient.cpp | 0 {lib/cpp_utils => other}/MysqlClient.hpp | 0 .../MysqlConnectionPool.cpp | 0 .../MysqlConnectionPool.hpp | 0 8 files changed, 18 insertions(+), 13 deletions(-) rename {lib/cpp_utils => other}/MysqlClient.cpp (100%) rename {lib/cpp_utils => other}/MysqlClient.hpp (100%) rename {lib/cpp_utils => other}/MysqlConnectionPool.cpp (100%) rename {lib/cpp_utils => other}/MysqlConnectionPool.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fd5b0d..9156ddc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) project (CPP_UTILS_LIB) -set(CMAKE_CXX_COMPILER "/usr/bin/g++-4.7") +set(CMAKE_CXX_COMPILER "/usr/bin/g++-5.1.0") set (CXX_FLAGS "-Wall -Wextra -pedantic -Weffc++ -Wshadow " "-Wpointer-arith -Wcast-qual " diff --git a/lib/cpp_utils/CMakeLists.txt b/lib/cpp_utils/CMakeLists.txt index 099bab3..232aab8 100644 --- a/lib/cpp_utils/CMakeLists.txt +++ b/lib/cpp_utils/CMakeLists.txt @@ -2,4 +2,6 @@ include_directories (.) aux_source_directory(. CPPUTILS_SOURCES) add_library (CppUtils SHARED ${CPPUTILS_SOURCES}) -target_link_libraries(CppUtils pthread rt gcov ssl mysqlclient) \ No newline at end of file +target_link_libraries(CppUtils pthread rt gcov ssl +# mysqlclient +) \ No newline at end of file diff --git a/lib/cpp_utils/SocketServer.cpp b/lib/cpp_utils/SocketServer.cpp index f734e09..3e8694f 100644 --- a/lib/cpp_utils/SocketServer.cpp +++ b/lib/cpp_utils/SocketServer.cpp @@ -27,7 +27,7 @@ bool SocketServer::start() if ( !m_connection->bind() ) return false; - if ( m_connection->listen( m_maxPendingQueueLen ) == -1 ) { + if ( m_connection->listen( m_maxPendingQueueLen ) == false ) { return false; } diff --git a/other/CMakeLists.txt b/other/CMakeLists.txt index bf70152..81af533 100644 --- a/other/CMakeLists.txt +++ b/other/CMakeLists.txt @@ -5,24 +5,27 @@ set (CXX_FLAGS "-Wall -Wextra -pedantic -Weffc++ -Wshadow " add_definitions( ${CXX_FLAGS} ) include_directories (. ../lib) +link_directories (../lib/cpp_utils) add_executable ( tcpserver tcpserver_main.cpp ) -target_link_libraries ( tcpserver CppUtils ) +target_link_libraries ( tcpserver CppUtils gcov) add_executable ( tcpclient tcpclient_main.cpp ) -target_link_libraries ( tcpclient CppUtils ) +target_link_libraries ( tcpclient CppUtils gcov ) add_executable ( sslserver sslserver_main.cpp ) -target_link_libraries ( sslserver CppUtils ssl pthread rt ) +target_link_libraries ( sslserver CppUtils ssl pthread rt gcov ) add_executable ( sslclient sslclient_main.cpp ) -target_link_libraries ( sslclient CppUtils ssl pthread rt ) +target_link_libraries ( sslclient CppUtils ssl pthread rt gcov ) -add_executable ( mysqlclient mysqlclient_main.cpp ) -add_library ( lib_mysql_client SHARED IMPORTED ) -# TODO use find_library -set_target_properties ( lib_mysql_client PROPERTIES IMPORTED_LOCATION /usr/lib/x86_64-linux-gnu/libmysqlclient.so ) -target_link_libraries ( mysqlclient CppUtils lib_mysql_client ) +# add_executable ( mysqlclient mysqlclient_main.cpp ) +# add_library ( lib_mysql_client SHARED IMPORTED ) +# # TODO use find_library +# set_target_properties ( lib_mysql_client PROPERTIES IMPORTED_LOCATION /usr/lib/x86_64-linux-gnu/libmysqlclient.so ) +# target_link_libraries ( mysqlclient CppUtils lib_mysql_client ) -add_custom_target( other DEPENDS tcpserver tcpclient sslserver sslclient mysqlclient ) +add_custom_target( other DEPENDS tcpserver tcpclient sslserver sslclient +# mysqlclient +) diff --git a/lib/cpp_utils/MysqlClient.cpp b/other/MysqlClient.cpp similarity index 100% rename from lib/cpp_utils/MysqlClient.cpp rename to other/MysqlClient.cpp diff --git a/lib/cpp_utils/MysqlClient.hpp b/other/MysqlClient.hpp similarity index 100% rename from lib/cpp_utils/MysqlClient.hpp rename to other/MysqlClient.hpp diff --git a/lib/cpp_utils/MysqlConnectionPool.cpp b/other/MysqlConnectionPool.cpp similarity index 100% rename from lib/cpp_utils/MysqlConnectionPool.cpp rename to other/MysqlConnectionPool.cpp diff --git a/lib/cpp_utils/MysqlConnectionPool.hpp b/other/MysqlConnectionPool.hpp similarity index 100% rename from lib/cpp_utils/MysqlConnectionPool.hpp rename to other/MysqlConnectionPool.hpp