If you haven't cloned this repo with the --recurse-submodules flag, then get the vcpkg submodule:
git submodule update --init --recursive Build vcpkg:
source ./vcpkg/bootstrap-vcpkg.shThis must be done from the same directory as the vcpkg.json file:
./vcpkg/vcpkg installThis should create a vcpkg_installed directory.
The server and client targets are defined in the root ./CMakeLists.txt. This is our code.
cd cmake-build-debug
cmake ..
cmake --build . --target server
cmake --build . --target client./cmake-build-debug/server &
./cmake-build-debug/client <your_name_here>The result should look something like:
$ ./cmake-build-debug/server &
[server] listening on 0.0.0.0:50051
$ ./cmake-build-debug/client World
[client] connecting to server at localhost:50051
[client] sending HelloRequest with name: World
[server] received HelloRequest with name: World
[client] received: Hello World
You can kill the server by typing fg then Ctrl-C
Using an in-tree vcpkg is fool-proof, but isn't great for automated builds where the dependencies do not change often.