Remove gRPC proto compiler invocation from CMakeLists.txt (#878)

master
Christoph Schütte 2018-02-02 21:04:34 +01:00 committed by Wally B. Feed
parent c212bbb698
commit df518b80c8
1 changed files with 4 additions and 10 deletions

View File

@ -22,8 +22,6 @@ set(CARTOGRAPHER_PATCH_VERSION 0)
set(CARTOGRAPHER_VERSION ${CARTOGRAPHER_MAJOR_VERSION}.${CARTOGRAPHER_MINOR_VERSION}.${CARTOGRAPHER_PATCH_VERSION}) set(CARTOGRAPHER_VERSION ${CARTOGRAPHER_MAJOR_VERSION}.${CARTOGRAPHER_MINOR_VERSION}.${CARTOGRAPHER_PATCH_VERSION})
set(CARTOGRAPHER_SOVERSION ${CARTOGRAPHER_MAJOR_VERSION}.${CARTOGRAPHER_MINOR_VERSION}) set(CARTOGRAPHER_SOVERSION ${CARTOGRAPHER_MAJOR_VERSION}.${CARTOGRAPHER_MINOR_VERSION})
option(BUILD_GRPC "build Cartographer gRPC support" false) option(BUILD_GRPC "build Cartographer gRPC support" false)
# TODO(gaschler): Make this an option.
set(GRPC_PLUGIN_PATH "/usr/local/bin/grpc_cpp_plugin")
include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake") include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake")
google_initialize_cartographer_project() google_initialize_cartographer_project()
@ -115,20 +113,16 @@ if(${BUILD_GRPC})
list(APPEND ALL_GRPC_SERVICE_SRCS "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.pb.cc") list(APPEND ALL_GRPC_SERVICE_SRCS "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.pb.cc")
list(APPEND ALL_GRPC_SERVICE_HDRS "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.pb.h") list(APPEND ALL_GRPC_SERVICE_HDRS "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.pb.h")
list(APPEND ALL_GRPC_SERVICE_SRCS "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.grpc.pb.cc")
list(APPEND ALL_GRPC_SERVICE_HDRS "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.grpc.pb.h")
add_custom_command( add_custom_command(
OUTPUT "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.grpc.pb.cc" OUTPUT "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.pb.cc"
"${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.grpc.pb.h" "${PROJECT_BINARY_DIR}/${DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --grpc_out ${PROJECT_BINARY_DIR} ARGS --cpp_out ${PROJECT_BINARY_DIR}
--cpp_out ${PROJECT_BINARY_DIR}
-I ${PROJECT_SOURCE_DIR} -I ${PROJECT_SOURCE_DIR}
--plugin=protoc-gen-grpc=${GRPC_PLUGIN_PATH}
${ABS_FIL} ${ABS_FIL}
DEPENDS ${ABS_FIL} DEPENDS ${ABS_FIL}
COMMENT "Running C++ protocol buffer compiler with gRPC support on ${ABS_FIL}" COMMENT "Running C++ protocol buffer compiler on ${ABS_FIL}"
VERBATIM VERBATIM
) )
endforeach() endforeach()