Hey all,
I'm running Ubuntu 22.04.
One thing I'm doing differently is trying to use the system installation of libprobuf & protoc. I'm doing this because I already have a c++ application that uses protobuf & I would like grpc build to use that same installation (the grpc lib will also be used in this c++ application).
This is how I configure gRPC:
cmake -DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="/home/mandeep/work/grpc/cmake/install" \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
../..
But with this, I get the error that cmake cannot find the protobuf cmake files:
CMake Error at cmake/protobuf.cmake:58 (find_package):
Could not find a package configuration file provided by "Protobuf" with any
of the following names:
ProtobufConfig.cmake
protobuf-config.cmake
Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
"Protobuf_DIR" to a directory containing one of the above files. If
"Protobuf" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:377 (include)
I understand that the *.cmake files listed in the error message are not provided in any of the ubuntu-provided protobuf packages.
I did find "protobuf-config.cmake" under third_party/protobuf/cmake/protobuf, but setting that in the cmake configure step also gives an error, although this time its a different error:
-- Could NOT find utf8_range (missing: utf8_range_DIR)
CMake Error at third_party/protobuf/cmake/protobuf/protobuf-config.cmake:14 (include):
include could not find requested file:
/home/mandeep/work/grpc/third_party/protobuf/cmake/protobuf/protobuf-targets.cmake
Call Stack (most recent call first):
cmake/protobuf.cmake:58 (find_package)
CMakeLists.txt:377 (include)
Can anyone suggest whats the correct way to configure grpc build to use the system installed protobuf packages?
These are the packages install on my system:
$ dpkg -l | grep protobuf
ii libprotobuf-dev:amd64 3.12.4-1ubuntu7.22.04.1 amd64 protocol buffers C++ library (development files) and proto files
ii libprotobuf-lite23:amd64 3.12.4-1ubuntu7.22.04.1 amd64 protocol buffers C++ library (lite version)
ii libprotobuf23:amd64 3.12.4-1ubuntu7.22.04.1 amd64 protocol buffers C++ library
ii protobuf-compiler 3.12.4-1ubuntu7.22.04.1 amd64 compiler for protocol buffer definition files
ii python3-protobuf 3.12.4-1ubuntu7.22.04.1 amd64 Python 3 bindings for protocol buffers
Thanks for your time
-mandeep