-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from doleron/building_both_server_and_client
Building client and server executables together
- Loading branch information
Showing
3 changed files
with
104 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68c52d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake_minimum_required(VERSION 3.13)
project(tcp_client_server)
find_package (Threads)
set(CMAKE_CXX_STANDARD 11)
add_library(mylib STATIC
src/tcp_client.cpp
src/tcp_server.cpp
src/client.cpp)
target_link_directories(mylib PUBLIC include)
add_executable(tcp_client client_example.cpp)
add_executable(tcp_server server_example.cpp)
target_link_libraries (tcp_client mylib ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (tcp_server mylib ${CMAKE_THREAD_LIBS_INIT})
Try this ....