diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-08-31 11:57:15 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-08-31 11:57:15 +0200 |
| commit | 2f1c3293d2c5776c4ecd9b2f1dce66492b15dbdd (patch) | |
| tree | 1c582e4c5715a93c493582b1e01e51bc960d56c0 | |
| parent | 1525c5defe3db08c765477003be73c68bb2c3cb7 (diff) | |
| download | cmix-2f1c3293d2c5776c4ecd9b2f1dce66492b15dbdd.tar.gz cmix-2f1c3293d2c5776c4ecd9b2f1dce66492b15dbdd.tar.bz2 cmix-2f1c3293d2c5776c4ecd9b2f1dce66492b15dbdd.zip | |
Split up the client and server parts in a separate network library
| -rw-r--r-- | CMakeLists.txt | 3 | ||||
| -rw-r--r-- | libcmix-network/CMakeLists.txt | 29 | ||||
| -rw-r--r-- | libcmix-network/acceptor.cpp (renamed from network-handler/acceptor.cpp) | 0 | ||||
| -rw-r--r-- | libcmix-network/acceptor.hpp (renamed from network-handler/acceptor.hpp) | 0 | ||||
| -rw-r--r-- | libcmix-network/client.cpp (renamed from network-handler/client.cpp) | 0 | ||||
| -rw-r--r-- | libcmix-network/client.hpp (renamed from network-handler/client.hpp) | 0 | ||||
| -rw-r--r-- | libcmix-network/nodeclient.cpp (renamed from network-handler/nodeclient.cpp) | 0 | ||||
| -rw-r--r-- | libcmix-network/nodeclient.hpp (renamed from network-handler/nodeclient.hpp) | 0 | ||||
| -rw-r--r-- | libcmix-network/server.cpp (renamed from network-handler/server.cpp) | 0 | ||||
| -rw-r--r-- | libcmix-network/server.hpp (renamed from network-handler/server.hpp) | 0 | ||||
| -rw-r--r-- | network-handler/CMakeLists.txt | 13 | ||||
| -rw-r--r-- | node/CMakeLists.txt | 18 | ||||
| -rw-r--r-- | node/main.cpp | 4 | ||||
| -rw-r--r-- | node/node.cpp (renamed from network-handler/node.cpp) | 0 | ||||
| -rw-r--r-- | node/node.hpp (renamed from network-handler/node.hpp) | 0 |
15 files changed, 55 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 97191ba..ea049cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,9 @@ endif(DOXYGEN_FOUND) add_subdirectory(libcmix-crypto) add_subdirectory(libcmix) +add_subdirectory(libcmix-network) + add_subdirectory(network-handler) +add_subdirectory(node) add_subdirectory(scratchpad) diff --git a/libcmix-network/CMakeLists.txt b/libcmix-network/CMakeLists.txt new file mode 100644 index 0000000..d819bec --- /dev/null +++ b/libcmix-network/CMakeLists.txt @@ -0,0 +1,29 @@ +find_package(Boost COMPONENTS system REQUIRED) + +add_library(cmix-network + acceptor.hpp acceptor.cpp + server.hpp server.cpp + client.hpp client.cpp + nodeclient.hpp nodeclient.cpp +) + +target_compile_options(cmix-network + PRIVATE "-std=c++11" +) + +target_include_directories(cmix-network + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_link_libraries(cmix-network + PRIVATE Boost::boost + PUBLIC Boost::system + PRIVATE cmix +) + +if(WIN32) + target_link_libraries(cmix-network + PUBLIC wsock32 + PUBLIC ws2_32 + ) +endif() diff --git a/network-handler/acceptor.cpp b/libcmix-network/acceptor.cpp index 34b5f0e..34b5f0e 100644 --- a/network-handler/acceptor.cpp +++ b/libcmix-network/acceptor.cpp diff --git a/network-handler/acceptor.hpp b/libcmix-network/acceptor.hpp index 7d8e0a2..7d8e0a2 100644 --- a/network-handler/acceptor.hpp +++ b/libcmix-network/acceptor.hpp diff --git a/network-handler/client.cpp b/libcmix-network/client.cpp index 3098185..3098185 100644 --- a/network-handler/client.cpp +++ b/libcmix-network/client.cpp diff --git a/network-handler/client.hpp b/libcmix-network/client.hpp index 2b6a6df..2b6a6df 100644 --- a/network-handler/client.hpp +++ b/libcmix-network/client.hpp diff --git a/network-handler/nodeclient.cpp b/libcmix-network/nodeclient.cpp index 9b026ba..9b026ba 100644 --- a/network-handler/nodeclient.cpp +++ b/libcmix-network/nodeclient.cpp diff --git a/network-handler/nodeclient.hpp b/libcmix-network/nodeclient.hpp index 9a3799a..9a3799a 100644 --- a/network-handler/nodeclient.hpp +++ b/libcmix-network/nodeclient.hpp diff --git a/network-handler/server.cpp b/libcmix-network/server.cpp index cb2bd34..cb2bd34 100644 --- a/network-handler/server.cpp +++ b/libcmix-network/server.cpp diff --git a/network-handler/server.hpp b/libcmix-network/server.hpp index 942cb14..942cb14 100644 --- a/network-handler/server.hpp +++ b/libcmix-network/server.hpp diff --git a/network-handler/CMakeLists.txt b/network-handler/CMakeLists.txt index b4aef97..072172e 100644 --- a/network-handler/CMakeLists.txt +++ b/network-handler/CMakeLists.txt @@ -3,13 +3,8 @@ find_package(Boost COMPONENTS system program_options REQUIRED) add_executable(network-handler main.cpp - acceptor.hpp acceptor.cpp - server.hpp server.cpp networkhandler.hpp networkhandler.cpp - node.hpp node.cpp - client.hpp client.cpp userclient.hpp userclient.cpp - nodeclient.hpp nodeclient.cpp nodemanager.hpp nodemanager.cpp ) @@ -22,11 +17,5 @@ target_link_libraries(network-handler PRIVATE Boost::program_options PRIVATE Boost::system PRIVATE cmix + PRIVATE cmix-network ) - -if(WIN32) - target_link_libraries(network-handler - PRIVATE wsock32 - PRIVATE ws2_32 - ) -endif() diff --git a/node/CMakeLists.txt b/node/CMakeLists.txt new file mode 100644 index 0000000..895cfb2 --- /dev/null +++ b/node/CMakeLists.txt @@ -0,0 +1,18 @@ +find_package(Boost COMPONENTS system program_options REQUIRED) + +add_executable(node + main.cpp + node.hpp node.cpp +) + +target_compile_options(node + PRIVATE "-std=c++11" +) + +target_link_libraries(node + PRIVATE Boost::boost + PRIVATE Boost::program_options + PRIVATE Boost::system + PRIVATE cmix + PRIVATE cmix-network +) diff --git a/node/main.cpp b/node/main.cpp new file mode 100644 index 0000000..970e150 --- /dev/null +++ b/node/main.cpp @@ -0,0 +1,4 @@ + +int main() { + +} diff --git a/network-handler/node.cpp b/node/node.cpp index 497a920..497a920 100644 --- a/network-handler/node.cpp +++ b/node/node.cpp diff --git a/network-handler/node.hpp b/node/node.hpp index 7d30188..7d30188 100644 --- a/network-handler/node.hpp +++ b/node/node.hpp |
