I'm trying to integrate gRPC in existing project. It already has directory containing all gRPC's dependencies installed (ssl, c-ares, protobuf and zlib). I want to use them while building gRPC, and install gRPC into the same directory. I downloaded gRPC archive (without cloning submodules located in grpc/third_party/), and tried to generate build system for building and installing gRPC into my destination folder (using cmake).
I used following command:
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DgRPC_ZLIB_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DgRPC_CARES_PROVIDER=package
and got an error:
CMake Error at cmake/cares.cmake:34 (find_package):
Could not find a package configuration file provided by "c-ares" with any
of the following names:
c-aresConfig.cmake
c-ares-config.cmake
Add the installation prefix of "c-ares" to CMAKE_PREFIX_PATH or set
"c-ares_DIR" to a directory containing one of the above files. If "c-ares"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:116 (include)
-- Configuring incomplete, errors occurred!
I have c-ares of version 1.14.0 (from https://c-ares.haxx.se/), it is built using
./configure --prefix=$PREFIX
make && make install
and it doesn't provide any of the above files (c-aresConfig.cmake, c-ares-config.cmake).
I tried to get c-ares from github and to build it using cmake, and have succeed: requested files appeared in installation directory, so gRPC build system was generated successfully.
My question is: can I build and install gRPC without updating c-ares to github-version?
If this can't be done easily, maybe it is possible to disable usage of c-ares in gRPC somehow (use native dns resolver instead)?