-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (23 loc) · 968 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
cmake_minimum_required(VERSION 3.20)
project(server_client)
find_package(Threads)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++17 -I /usr/local/include -L /usr/local/lib")
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS} /usr/include/)
add_library(${PROJECT_NAME}
src/tcp_client.cpp
src/tcp_server.cpp
src/client.cpp
src/utils.cpp
src/file_descriptor.cpp
protos/out/IMU_data.pb.cc
protos/out/img_data.pb.cc)
file(MAKE_DIRECTORY "./build/client_data")
file(MAKE_DIRECTORY "./build/server_data")
file(COPY test/dopamine.png
DESTINATION client_data)
add_executable(tcp_server test/server_test.cpp)
target_link_libraries (tcp_server ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} -pthread -lprotobuf)
add_executable(tcp_client test/client_test.cpp)
target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} -pthread -lprotobuf)