This patch fixes two issues with the targets exported by the
grpc cmake build:
- Install directories are now given relative instead of absolute.
Previously the exported targets would contain absolute paths to
their created targets when they should be relative. The actual
installation location stays the same as cmake automatically
interprets the paths relative to CMAKE_INSTALL_PREFIX
- ZLIB and OpenSSL are now linked using targets instead of the
legacy library variables if possible. Using the legacy paths
produces absolute paths to those dependencies in the export.
With this change cmake inserts the target names instead.
With these changes no more absolute paths are inserted into the
export allowing the install location to be used as an artifact
that can be moved or transfered to another machine and used there.
Now that gRPC_INSTALL is forced off if using bundled third-party
libraries, it no longer makes sense to set it OFF by default for MSVC.
However, we do want to set it OFF by default if gRPC is being built as a
subproject of another project.
- Update CMakeLists.txt (original template and generated code)
to prevent forcefully linking `dl` on all UNIX platforms,
and rely on `${CMAKE_DL_LIBS}` portable variable instead.
- Do not try linking against `librt` on macOS.
- Add a `config_freebsd` directory containing the header file
generated by the `configure` script for the `ares` library.