1 include_directories(${CMAKE_CURRENT_BINARY_DIR})
3 add_library(protobufrpc protobufrpc.cc socket_pool.cc workqueue.cc)
4 add_library(kvservice kvservice.cc backend.cc
5 ${CMAKE_CURRENT_BINARY_DIR}/kvstore.pb.cc)
7 add_executable(kvstore kvstore.cc)
9 add_library(kvclient SHARED
10 kvclient.cc kvservice.cc backend.cc kvstore.pb.cc
11 protobufrpc.cc socket_pool.cc workqueue.cc)
12 target_link_libraries(kvclient
13 boost_thread-mt boost_regex-mt boost_system-mt
14 boost_program_options-mt db protobuf pthread)
16 target_link_libraries(kvstore
18 boost_thread-mt boost_regex-mt boost_system-mt
19 boost_program_options-mt db protobuf protobufrpc pthread)
21 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kvstore.pb.cc
22 ${CMAKE_CURRENT_BINARY_DIR}/kvstore.pb.h
23 COMMAND protoc --cpp_out=${CMAKE_CURRENT_BINARY_DIR}
24 --proto_path=${CMAKE_CURRENT_SOURCE_DIR}
25 ${CMAKE_CURRENT_SOURCE_DIR}/kvstore.proto
26 DEPENDS kvstore.proto)