aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2017-08-24 17:51:47 +0200
committerGravatar Jan Tattermusch <jtattermusch@google.com>2017-09-10 14:01:22 +0200
commit210f2a51e5995796227ec55ff5eb4bfde62240a8 (patch)
treea9282dfd0c23700c6273bc525e1b7f09d44a3bf1 /templates
parentc7520d0d8f1c3833f9a1c04c953e272a120f31c4 (diff)
use the right protoc executable regardless of protobuf provider
Diffstat (limited to 'templates')
-rw-r--r--templates/CMakeLists.txt.template5
1 files changed, 4 insertions, 1 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index 966a73c28e..bbe7d7783c 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -224,6 +224,7 @@
endif()
if(TARGET protoc)
set(_gRPC_PROTOBUF_PROTOC protoc)
+ set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE $<TARGET_FILE:protoc>)
endif()
else()
message(WARNING "gRPC_PROTOBUF_PROVIDER is \"module\" but PROTOBUF_ROOT_DIR is wrong")
@@ -247,8 +248,10 @@
endif()
if(TARGET protobuf::protoc)
set(_gRPC_PROTOBUF_PROTOC protobuf::protoc)
+ set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE $<TARGET_FILE:protobuf::protoc>)
else()
set(_gRPC_PROTOBUF_PROTOC <%text>${PROTOBUF_PROTOC_EXECUTABLE}</%text>)
+ set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE <%text>${PROTOBUF_PROTOC_EXECUTABLE}</%text>)
endif()
set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND)\n find_package(Protobuf <%text>${gRPC_PROTOBUF_PACKAGE_TYPE}</%text>)\nendif()")
endif()
@@ -373,7 +376,7 @@
<%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}_mock.grpc.pb.h"</%text>
<%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc"</%text>
<%text>"${_gRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h"</%text>
- COMMAND <%text>$<TARGET_FILE:${_gRPC_PROTOBUF_PROTOC}></%text>
+ COMMAND <%text>${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}</%text>
ARGS --grpc_out=<%text>generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}</%text>
--cpp_out=<%text>${_gRPC_PROTO_GENS_DIR}</%text>
--plugin=protoc-gen-grpc=$<TARGET_FILE:grpc_cpp_plugin>