CMakeLists.txt 2.2 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8
include(proto/CMakeLists.txt)

file(GLOB sdk_cpp_srcs ${CMAKE_SOURCE_DIR}/sdk-cpp/src/*.cpp)
list(APPEND elasticctr_srcs ${elastic_ctr_cpp_srcs})
list(APPEND elasticctr_srcs ${sdk_cpp_srcs})
list(APPEND elasticctr_srcs
        ${CMAKE_CURRENT_LIST_DIR}/api/elastic_ctr_api.cpp)

W
wangguibao 已提交
9
add_library(elasticctr SHARED ${elasticctr_srcs})
W
wangguibao 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22
target_link_libraries(elasticctr brpc configure protobuf leveldb)

add_executable(elastic_ctr_demo ${CMAKE_CURRENT_LIST_DIR}/demo/demo.cpp)
target_link_libraries(elastic_ctr_demo elasticctr -lpthread -lcrypto -lm -lrt -lssl -ldl -lz)

# install
install(TARGETS elastic_ctr_demo
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/elastic_ctr/client/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/demo/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/elastic_ctr/client/)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/demo/data/ctr_prediction DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/elastic_ctr/client/data)
W
wangguibao 已提交
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

install(TARGETS elasticctr
        LIBRARY DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/elastic_ctr/api/lib)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/api/elastic_ctr_api.h
        DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/elastic_ctr/api/include/elastic-ctr/client/api/)
install(FILES
        ${CMAKE_BINARY_DIR}/elastic-ctr/client/elastic_ctr_prediction.pb.h
        ${CMAKE_BINARY_DIR}/elastic-ctr/client/pds_option.pb.h
        ${CMAKE_BINARY_DIR}/elastic-ctr/client/builtin_format.pb.h
        DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/elastic_ctr/api/include/elastic-ctr/client/)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/sdk-cpp/include
        DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/elastic_ctr/api/include/sdk-cpp/)
install(DIRECTORY
        ${CMAKE_BINARY_DIR}/third_party/install/protobuf/include/google
        ${CMAKE_BINARY_DIR}/third_party/install/brpc/include/brpc
        ${CMAKE_BINARY_DIR}/third_party/install/brpc/include/butil
        ${CMAKE_BINARY_DIR}/third_party/install/brpc/include/bthread
        ${CMAKE_BINARY_DIR}/third_party/install/gflags/include/gflags
        ${CMAKE_BINARY_DIR}/third_party/install/glog/include/glog
        DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/elastic_ctr/api/include)