CMakeLists.txt 2.7 KB
Newer Older
W
wangguibao 已提交
1
include(proto/CMakeLists.txt)
W
wangguibao 已提交
2 3
include(common/CMakeLists.txt)
include(op/CMakeLists.txt)
W
wangguibao 已提交
4
include(mempool/CMakeLists.txt)
W
wangguibao 已提交
5
include(framework/CMakeLists.txt)
W
wangguibao 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19
include(plugin/CMakeLists.txt)
include(src/CMakeLists.txt)

add_executable(pdcodegen ${pdcodegen_srcs})
target_link_libraries(pdcodegen protobuf ${PROTOBUF_PROTOC_LIBRARY})
target_include_directories(pdcodegen PUBLIC
        ${CMAKE_CURRENT_LIST_DIR}/
        ${CMAKE_CURRENT_BINARY_DIR}/)

add_library(pdserving ${pdserving_srcs})
set_source_files_properties(
        ${pdserving_srcs}
        PROPERTIES
        COMPILE_FLAGS  "-Wno-strict-aliasing -Wno-unused-variable -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
W
wangguibao 已提交
20
add_dependencies(pdserving protobuf boost brpc leveldb pdcodegen configure)
W
wangguibao 已提交
21 22 23 24

target_include_directories(pdserving PUBLIC
        ${CMAKE_CURRENT_LIST_DIR}/
        ${CMAKE_CURRENT_BINARY_DIR}/
25 26
        ${CMAKE_CURRENT_BINARY_DIR}/../configure
        ${CMAKE_CURRENT_LIST_DIR}/../configure/include
W
wangguibao 已提交
27
        )
W
wangguibao 已提交
28
target_link_libraries(pdserving
W
wangguibao 已提交
29
        brpc protobuf boost leveldb configure -lpthread -lcrypto -lm -lrt -lssl -ldl -lz)
W
wangguibao 已提交
30

W
wangguibao 已提交
31 32 33 34 35
add_executable(pdserving_exe ${pdserving_srcs})
set_source_files_properties(
        ${pdserving_srcs}
        PROPERTIES
        COMPILE_FLAGS  "-Wno-strict-aliasing -Wno-unused-variable -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
W
wangguibao 已提交
36
add_dependencies(pdserving_exe
W
wangguibao 已提交
37
        protobuf boost brpc leveldb pdcodegen configure)
W
wangguibao 已提交
38 39 40 41

target_include_directories(pdserving_exe PUBLIC
        ${CMAKE_CURRENT_LIST_DIR}/
        ${CMAKE_CURRENT_BINARY_DIR}/
42 43
        ${CMAKE_CURRENT_BINARY_DIR}/../configure
        ${CMAKE_CURRENT_LIST_DIR}/../configure/include
W
wangguibao 已提交
44
        )
W
wangguibao 已提交
45
target_link_libraries(pdserving_exe brpc protobuf leveldb 
W
wangguibao 已提交
46
        configure -lpthread -lcrypto -lm -lrt -lssl
W
wangguibao 已提交
47
        -ldl -lz)
W
wangguibao 已提交
48 49

add_library(pdclient ${pdclient_srcs})
W
wangguibao 已提交
50
set_source_files_properties(
W
wangguibao 已提交
51
        ${pdclient_srcs}
W
wangguibao 已提交
52
        PROPERTIES
W
wangguibao 已提交
53
        COMPILE_FLAGS  "-Wno-strict-aliasing -Wno-unused-variable -Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
54
add_dependencies(pdclient protobuf boost brpc pdcodegen configure)
W
wangguibao 已提交
55 56

target_include_directories(pdclient PUBLIC
W
wangguibao 已提交
57 58
        ${CMAKE_CURRENT_LIST_DIR}/
        ${CMAKE_CURRENT_BINARY_DIR}/
59 60
        ${CMAKE_CURRENT_BINARY_DIR}/../configure
        ${CMAKE_CURRENT_LIST_DIR}/../configure/include
W
wangguibao 已提交
61
        )
W
serving  
wangguibao 已提交
62
target_link_libraries(pdclient protobuf boost brpc -lpthread -lcrypto -lm -lrt -lssl -ldl -lz)
W
wangguibao 已提交
63

64 65 66 67 68 69 70 71
# install
install(TARGETS pdclient pdserving pdcodegen
        RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/bin
        ARCHIVE DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/lib
        LIBRARY DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/so
        )