aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/FindGRPC.cmake
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-06-28 14:03:52 -0700
committerGravatar GitHub <noreply@github.com>2018-06-28 14:03:52 -0700
commitb8eb4e04497a5d51343e94465fd01b39a520c29c (patch)
tree7dd8dbe40db86229523afdaa296b6c7673dbbeb1 /cmake/FindGRPC.cmake
parent74fa22f1de418d5389b5a68e379a689516c3980b (diff)
Add a CMake external build for c-ares (#1472)
* Add an external build for c-ares * Use installed c-ares package configuration * Adjust protobuf configuration to use the standard Protobuf_DIR variable. * Have grpc depend on c-ares * Drop UPDATE_COMMAND where it doesn't matter
Diffstat (limited to 'cmake/FindGRPC.cmake')
-rw-r--r--cmake/FindGRPC.cmake18
1 files changed, 4 insertions, 14 deletions
diff --git a/cmake/FindGRPC.cmake b/cmake/FindGRPC.cmake
index 22c9655..ba8f857 100644
--- a/cmake/FindGRPC.cmake
+++ b/cmake/FindGRPC.cmake
@@ -56,20 +56,10 @@ find_package(OpenSSL REQUIRED)
## C-Ares
-find_library(
- CARES_LIBRARY
- NAMES cares
- HINTS ${BINARY_DIR}/src/grpc-build/third_party/cares/cares/lib
-)
-if(NOT (CARES_LIBRARY STREQUAL "CARES_LIBRARY-NOTFOUND"))
- if (NOT TARGET c-ares::ares)
- add_library(c-ares::ares UNKNOWN IMPORTED)
- set_target_properties(
- c-ares::ares PROPERTIES
- IMPORTED_LOCATION ${CARES_LIBRARY}
- )
- endif()
+if(NOT c-ares_DIR)
+ set(c-ares_DIR ${FIREBASE_INSTALL_DIR}/lib/cmake/c-ares)
endif()
+find_package(c-ares CONFIG REQUIRED)
## GRPC
@@ -124,7 +114,7 @@ if(GRPC_FOUND)
if (NOT TARGET grpc::grpc)
set(
GRPC_LINK_LIBRARIES
- c-ares::ares
+ c-ares::cares
grpc::gpr
OpenSSL::SSL
OpenSSL::Crypto