From 8f840ff1fe89e028f446a2760634f0277e63bea2 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 30 Jun 2023 01:19:45 +0200 Subject: [PATCH] place netsim in static library --- CMakeLists.txt | 3 ++- gui/CMakeLists.txt | 7 +++++++ {src => gui/src}/main.cpp | 0 netsim/CMakeLists.txt | 8 ++++++++ {include => netsim/include}/Device.hpp | 0 {include => netsim/include}/Netsim.hpp | 0 {include => netsim/include}/Network.hpp | 0 {src => netsim/src}/Device.cpp | 0 {src => netsim/src}/Network.cpp | 0 src/CMakeLists.txt | 9 --------- 10 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 gui/CMakeLists.txt rename {src => gui/src}/main.cpp (100%) create mode 100644 netsim/CMakeLists.txt rename {include => netsim/include}/Device.hpp (100%) rename {include => netsim/include}/Netsim.hpp (100%) rename {include => netsim/include}/Network.hpp (100%) rename {src => netsim/src}/Device.cpp (100%) rename {src => netsim/src}/Network.cpp (100%) delete mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bb4b4d..b13d482 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,4 +2,5 @@ cmake_minimum_required(VERSION 3.10) project(network_simulator) -add_subdirectory(src) \ No newline at end of file +add_subdirectory(netsim) +add_subdirectory(gui) \ No newline at end of file diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt new file mode 100644 index 0000000..ffb63c2 --- /dev/null +++ b/gui/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable(netsim + "src/main.cpp" +) + +target_link_libraries(netsim PRIVATE + libnetsim +) \ No newline at end of file diff --git a/src/main.cpp b/gui/src/main.cpp similarity index 100% rename from src/main.cpp rename to gui/src/main.cpp diff --git a/netsim/CMakeLists.txt b/netsim/CMakeLists.txt new file mode 100644 index 0000000..e5e650d --- /dev/null +++ b/netsim/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(libnetsim STATIC + "src/Device.cpp" + "src/Network.cpp" +) + +target_include_directories(libnetsim PUBLIC + include +) \ No newline at end of file diff --git a/include/Device.hpp b/netsim/include/Device.hpp similarity index 100% rename from include/Device.hpp rename to netsim/include/Device.hpp diff --git a/include/Netsim.hpp b/netsim/include/Netsim.hpp similarity index 100% rename from include/Netsim.hpp rename to netsim/include/Netsim.hpp diff --git a/include/Network.hpp b/netsim/include/Network.hpp similarity index 100% rename from include/Network.hpp rename to netsim/include/Network.hpp diff --git a/src/Device.cpp b/netsim/src/Device.cpp similarity index 100% rename from src/Device.cpp rename to netsim/src/Device.cpp diff --git a/src/Network.cpp b/netsim/src/Network.cpp similarity index 100% rename from src/Network.cpp rename to netsim/src/Network.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 50303b5..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_executable(netsim - "main.cpp" - "Device.cpp" - "Network.cpp" -) - -target_include_directories(netsim PRIVATE - ${CMAKE_SOURCE_DIR}/include -) \ No newline at end of file