|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
set(grpc_build_dir "${LIB_BASE_DIR}/grpc-build") |
|
|
|
|
|
|
|
if(NOT EXISTS ${grpc_build_dir}/111) |
|
|
|
if(NOT EXISTS ${grpc_build_dir}) |
|
|
|
# install grpc |
|
|
|
execute_process(COMMAND mkdir -p ${grpc_build_dir}) |
|
|
|
message(STATUS "${BoldGreen}Install grpc third party library") |
|
|
@ -30,7 +30,10 @@ if(NOT EXISTS ${grpc_build_dir}/111) |
|
|
|
COMMAND cmake --install . |
|
|
|
WORKING_DIRECTORY ${grpc_build_dir}) |
|
|
|
execute_process(COMMAND cp -rf ${LIB_BASE_DIR}/grpc-src/third_party/abseil-cpp/absl ${grpc_build_dir}/include) |
|
|
|
execute_process(COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/patch/grpc/* ${grpc_build_dir}) |
|
|
|
execute_process( |
|
|
|
COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/patch/grpc ${LIB_BASE_DIR}/grpc-build |
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|
|
|
) |
|
|
|
message("${BoldGreen}GRPC Installed !${ColourReset}") |
|
|
|
endif() |
|
|
|
|
|
|
@ -39,9 +42,7 @@ set(gRPC_DIR ${grpc_build_dir}) |
|
|
|
find_package(Threads REQUIRED) |
|
|
|
find_package(protobuf REQUIRED) |
|
|
|
find_package(gRPC CONFIG REQUIRED) |
|
|
|
message(${BoldGreen} |
|
|
|
_IMPORT_PREFIX:${_IMPORT_PREFIX} \n |
|
|
|
gRPC_LIBRARIES:${gRPC_LIBRARIES}${ColourReset}) |
|
|
|
|
|
|
|
include_directories(${grpc_build_dir}/include) |
|
|
|
link_directories(${grpc_build_dir}/lib) |
|
|
|
# local proto file |
|
|
@ -53,5 +54,5 @@ message(${BoldGreen} |
|
|
|
proto_file: ${grpc_BINARY_DIR}/protoc \n |
|
|
|
grpc_cpp_plugin:${grpc_BINARY_DIR}/grpc_cpp_plugin${ColourReset}) |
|
|
|
|
|
|
|
list(APPEND third_party_libraries grpc++ grpc++_reflection protobuf) |
|
|
|
list(APPEND third_party_libraries gRPC::grpc++ gRPC::grpc++_reflection protobuf) |
|
|
|
|