faaxm/exmpl-cmake-grpc

Fetch gRPC and build as dependency

shareefj opened this issue · 1 comments

Hi there,

I'm new to CMake and was wondering if it's possible to build gRPC as a dependency rather than having to have it pre-installed? The gRPC instructions at https://github.com/grpc/grpc/blob/master/src/cpp/README.md#cmake show an example of using FetchContent_MakeAvailable(gRPC) but I'm unsure of how to get that to auto-build inside your CMake example.

Is this possible or do you always have to have gRPC pre-installed? I'm trying to reduce the steps required to produce the protoc ouptuts.

Edit: The issue I'm seeing is that get_target_property(grpc_cpp_plugin_location gRPC::grpc_cpp_plugin LOCATION) fails. I assume because gRPC hasn't been built yet.