From 5bf3bfde33ce1ec3173ca3c26e322d0687068601 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Tue, 3 Nov 2020 11:12:57 +0100 Subject: [PATCH] Look for protoc and grpc_cpp_plugin in two places. --- ApplicationCode/GrpcInterface/CMakeLists.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/GrpcInterface/CMakeLists.txt b/ApplicationCode/GrpcInterface/CMakeLists.txt index e1b5551a17..76da15a76d 100644 --- a/ApplicationCode/GrpcInterface/CMakeLists.txt +++ b/ApplicationCode/GrpcInterface/CMakeLists.txt @@ -91,9 +91,22 @@ else() find_package(PkgConfig REQUIRED) pkg_check_modules(GRPC REQUIRED grpc++_unsecure>=1.20 grpc_unsecure gpr protobuf) - set(_PROTOBUF_PROTOC "${RESINSIGHT_GRPC_INSTALL_PREFIX}/bin/protoc") - set(_GRPC_CPP_PLUGIN_EXECUTABLE - "${RESINSIGHT_GRPC_INSTALL_PREFIX}/bin/grpc_cpp_plugin") + if(EXISTS "${RESINSIGHT_GRPC_INSTALL_PREFIX}/bin/protoc") + set(_PROTOBUF_PROTOC "${RESINSIGHT_GRPC_INSTALL_PREFIX}/bin/protoc") + elseif(EXISTS "${RESINSIGHT_GRPC_INSTALL_PREFIX}/tools/protobuf/protoc") + set(_PROTOBUF_PROTOC + "${RESINSIGHT_GRPC_INSTALL_PREFIX}/tools/protobuf/protoc") + else() + message(FATAL_ERROR "Could not find the protobuf compiler (protoc)") + endif() + + if(EXISTS "${RESINSIGHT_GRPC_INSTALL_PREFIX}/bin/grpc_cpp_plugin") + set(_GRPC_CPP_PLUGIN_EXECUTABLE + "${RESINSIGHT_GRPC_INSTALL_PREFIX}/bin/grpc_cpp_plugin") + elseif(EXISTS "${RESINSIGHT_GRPC_INSTALL_PREFIX}/tools/grpc/grpc_cpp_plugin") + set(_GRPC_CPP_PLUGIN_EXECUTABLE + "${RESINSIGHT_GRPC_INSTALL_PREFIX}/tools/grpc/grpc_cpp_plugin") + endif() include_directories(AFTER ${GRPC_INCLUDE_DIRS}) endif()