提交 03a9b9b8 编写于 作者: Y yangrui07

fix cube-api dependency path

上级 f6a098c1
......@@ -105,12 +105,12 @@ if (NOT CLIENT_ONLY)
list(APPEND EXTERNAL_LIBS opencv)
endif()
add_subdirectory(cube)
add_subdirectory(configure)
add_subdirectory(pdcodegen)
add_subdirectory(sdk-cpp)
add_subdirectory(demo-client)
add_subdirectory(kvdb)
add_subdirectory(cube)
if (NOT CLIENT_ONLY)
add_subdirectory(predictor)
......
......@@ -25,9 +25,6 @@ execute_process(
set(CMAKE_PREFIX_PATH ${OUTPUT_PATH})
include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/include)
include_directories(SYSTEM ${CMAKE_CURRENT_BINARY_DIR}/../)
include(FindThreads)
include(FindProtobuf)
protobuf_generate_cpp(PROTO_SRC PROTO_HEADER idl/cube.proto idl/control.proto)
......@@ -91,12 +88,11 @@ if (NOT CRYPTO_LIB)
message(FATAL_ERROR "Fail to find crypto")
endif()
add_executable(cube_cli src/cube_cli.cpp src/cube_api.cpp src/meta.cpp
add_executable(cube-cli src/cube_cli.cpp src/cube_api.cpp src/meta.cpp
${PROTO_SRC} ${PROTO_HEADER})
add_library(cube_api STATIC src/cube_api.cpp src/meta.cpp
add_library(cube-api STATIC src/cube_api.cpp src/meta.cpp
${PROTO_SRC} ${PROTO_HEADER})
install(TARGETS cube_api ARCHIVE DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/lib/)
set(DYNAMIC_LIB
${CMAKE_THREAD_LIBS_INIT}
......@@ -122,10 +118,16 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-Wl,-U,_ProfilerStop")
endif()
target_link_libraries(cube_cli ${DYNAMIC_LIB} brpc -lpthread -ldl -lz)
target_link_libraries(cube_api ${DYNAMIC_LIB} brpc -lpthread -ldl -lz)
target_link_libraries(cube-cli ${DYNAMIC_LIB} brpc -lpthread -ldl -lz)
target_link_libraries(cube-api ${DYNAMIC_LIB} brpc -lpthread -ldl -lz)
# install
install(TARGETS cube-api
ARCHIVE DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/lib
)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include
DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/include/)
file(GLOB cube_api_headers "${CMAKE_CURRENT_LIST_DIR}/src/*.h")
install(FILES ${cube_api_headers} DESTINATION
${PADDLE_SERVING_INSTALL_DIR}/include/cube_api/)
message(STATUS "CUBE_API_INSTALL_DIR: ${PADDLE_SERVING_INSTALL_DIR}/include/cube_api/")
FILE(GLOB inc ${CMAKE_CURRENT_BINARY_DIR}/*.pb.h)
install(FILES ${inc}
DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/include/cube-api)
......@@ -19,8 +19,8 @@
#include <vector>
#include "brpc/server.h"
#include "cube-api/cube.pb.h"
#include "cube/meta.h"
#include "cube/cube-api/cube.pb.h"
#include "cube/cube-api/include/meta.h"
namespace rec {
namespace mcube {
......
......@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "cube/cube_api.h"
#include "cube/cube-api/include/cube_api.h"
#include <brpc/channel.h>
#include <brpc/parallel_channel.h>
#include <google/protobuf/descriptor.h>
#include "cube/cube_api_bvar.h"
#include "cube/cube-api/include/cube_api_bvar.h"
#include "cube/error.h"
#include "cube/meta.h"
#include "cube/cube-api/include/error.h"
#include "cube/cube-api/include/meta.h"
namespace {
static ::rec::mcube::CubeAPI* g_ins = NULL;
......
......@@ -15,7 +15,7 @@
#include <gflags/gflags.h>
#include <atomic>
#include "cube/cube_api.h"
#include "cube/cube-api/include/cube_api.h"
#define TIME_FLAG(flag) \
struct timeval flag; \
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "cube/meta.h"
#include "cube/cube-api/include/meta.h"
#include <google/protobuf/descriptor.h>
#include <string.h>
......@@ -20,7 +20,7 @@
#include <new>
#include <sstream>
#include "cube-api/cube.pb.h"
#include "cube/cube-api/cube.pb.h"
namespace {
static ::rec::mcube::Meta* g_ins = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册