-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (31 loc) · 1.08 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
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.7)
project(raft)
set(CMAKE_CXX_STANDARD 11)
find_package(Threads)
add_definitions(-D__KERNEL__=1)
add_definitions(-O2 --std=c++11 -Wall -Wextra -Wno-deprecated-declarations -DNDEBUG)
link_directories("/usr/local/lib")
INCLUDE_DIRECTORIES("/usr/local/include")
link_libraries(pthread)
link_libraries(grpc)
link_libraries(protobuf)
link_libraries(grpc++)
link_libraries(gflags)
link_libraries(gtest)
set(SOURCES
src/raft_node.cpp
src/node_client.cpp src/util/string_util.cpp
src/service_keeper.cpp src/raft_state_machine.cpp
src/raft_state_machine_candidate.cpp
src/raft_state_machine_leader.cpp
src/node_server_service_impl.cpp
proto/message.grpc.pb.cc proto/message.pb.cc src/raft_state_machine_tick.cpp)
add_library(raft STATIC ${SOURCES})
# add_library(raft SHARED ${SOURCES})
INCLUDE_DIRECTORIES(./src)
INCLUDE_DIRECTORIES(./proto)
link_libraries(raft)
# target_link_libraries(raft)
add_executable(raft_test src/raft_test.cpp)
add_executable(server src/server.cpp)
# add_executable(client src/client.cpp)