-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
30 lines (21 loc) · 1.03 KB
/
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
cmake_minimum_required(VERSION 3.10)
project(FAST-RPC LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
find_package(Boost REQUIRED)
find_package(Protobuf REQUIRED)
message(STATUS "Boost ${Boost_VERSION}, Protobuf ${Protobuf_VERSION}")
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${Protobuf_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR})
protobuf_generate_cpp(IMPL_PROTO_SRCS IMPL_PROTO_HDRS proto/fast_impl.proto)
file(GLOB FAST_SRC "src-common/*.cc" "src-resource/*.cc" "src-endpoint/*.cc")
add_library(fastrpc STATIC ${FAST_SRC} ${IMPL_PROTO_SRCS})
target_link_libraries(fastrpc "-libverbs -lrdmacm -lpthread" ${Boost_LIBRARIES} ${Protobuf_LIBRARIES})
protobuf_generate_cpp(TEST_PROTO_SRCS TEST_PROTO_HDRS test/test.proto)
add_executable(client test/client.cc ${TEST_PROTO_SRCS})
add_executable(server test/server.cc ${TEST_PROTO_SRCS})
target_link_libraries(client fastrpc)
target_link_libraries(server fastrpc)