提交 63b86837 编写于 作者: Y yangrui07

fix cube-api dependency path

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