exmpl-cmake-grpc icon indicating copy to clipboard operation
exmpl-cmake-grpc copied to clipboard

Show how to use gRPC with FetchContent

Open melhindi opened this issue 3 years ago • 2 comments

I initially came across this repo since I was looking for a simple example for getting started with gRPC. While I like the project's structure, I find it much easier to automatically install the gRPC/protobuf dependencies, e.g. via FetchContent, instead of requiring a manual install. Hence, I updated the repo to also allow this approach. Hope people find this example helpful.

melhindi avatar Sep 07 '22 18:09 melhindi

Sorry for taking so long to do the review @melhindi. I didn't forget about it, but I have lots of other stuff to do at the moment 🙁 I actually also have to make up my mind as to what the intention of this repo should be. It started as an example for when I added gRPC support to the cmake files in protobuf and I wasn't really expecting any contributions...

Now I am wondering if your changes, while definitely useful, might distract from the original intention of showing how to use protobuf_generate and how to structure a project. The more complicated this example gets and the more use cases it covers, the more a novice might wonder "Do I need this line for FetchContent, or is this required for a basic grpc integration".

So, I haven't really made up my mind yet as I have lots of other stuff to focus on right now, but thought I'd let you know what the current status is, so you don't feel like I have forgotten about this PR 🙂

faaxm avatar Nov 04 '22 19:11 faaxm

Hi @faaxm, no worries and thanks for your feedback. I totally understand your concern. Maybe creating a dedicated Repo/project that shows different ways for integrating/installing GRPC in a CMake project is actually a better idea. However, I would suggest to mention in the Readme that people need to install GRPC, e.g, by following the instructions in https://grpc.io/docs/languages/cpp/quickstart/#install-grpc and that your project uses CMake find_package to find this installation.

melhindi avatar Nov 07 '22 06:11 melhindi