|
|
|
@ -48,11 +48,12 @@ project(${PACKAGE_NAME} C CXX) |
|
|
|
|
# Options |
|
|
|
|
option(gRPC_BUILD_TESTS "Build tests" OFF) |
|
|
|
|
|
|
|
|
|
if (NOT MSVC) |
|
|
|
|
set(gRPC_INSTALL ON CACHE BOOL "Generate installation target") |
|
|
|
|
else() |
|
|
|
|
set(gRPC_INSTALL OFF CACHE BOOL "Generate installation target") |
|
|
|
|
set(gRPC_INSTALL_default ON) |
|
|
|
|
if (MSVC) |
|
|
|
|
set(gRPC_INSTALL_default OFF) |
|
|
|
|
endif() |
|
|
|
|
set(gRPC_INSTALL ${gRPC_INSTALL_default} CACHE BOOL |
|
|
|
|
"Generate installation target: gRPC_ZLIB_PROVIDER, gRPC_CARES_PROVIDER, gRPC_SSL_PROVIDER and gRPC_PROTOBUF_PROVIDER must all be \"package\"") |
|
|
|
|
|
|
|
|
|
set(gRPC_ZLIB_PROVIDER "module" CACHE STRING "Provider of zlib library") |
|
|
|
|
set_property(CACHE gRPC_ZLIB_PROVIDER PROPERTY STRINGS "module" "package") |
|
|
|
@ -118,6 +119,10 @@ if("${gRPC_ZLIB_PROVIDER}" STREQUAL "module") |
|
|
|
|
else() |
|
|
|
|
message(WARNING "gRPC_ZLIB_PROVIDER is \"module\" but ZLIB_ROOT_DIR is wrong") |
|
|
|
|
endif() |
|
|
|
|
if(gRPC_INSTALL) |
|
|
|
|
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_ZLIB_PROVIDER is \"module\"") |
|
|
|
|
set(gRPC_INSTALL FALSE) |
|
|
|
|
endif() |
|
|
|
|
elseif("${gRPC_ZLIB_PROVIDER}" STREQUAL "package") |
|
|
|
|
find_package(ZLIB) |
|
|
|
|
if(TARGET ZLIB::ZLIB) |
|
|
|
@ -149,6 +154,10 @@ if("${gRPC_CARES_PROVIDER}" STREQUAL "module") |
|
|
|
|
else() |
|
|
|
|
message(WARNING "gRPC_CARES_PROVIDER is \"module\" but CARES_ROOT_DIR is wrong") |
|
|
|
|
endif() |
|
|
|
|
if(gRPC_INSTALL) |
|
|
|
|
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_CARES_PROVIDER is \"module\"") |
|
|
|
|
set(gRPC_INSTALL FALSE) |
|
|
|
|
endif() |
|
|
|
|
elseif("${gRPC_CARES_PROVIDER}" STREQUAL "package") |
|
|
|
|
find_package(c-ares CONFIG) |
|
|
|
|
if(TARGET c-ares::cares) |
|
|
|
@ -183,6 +192,10 @@ if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module") |
|
|
|
|
else() |
|
|
|
|
message(WARNING "gRPC_PROTOBUF_PROVIDER is \"module\" but PROTOBUF_ROOT_DIR is wrong") |
|
|
|
|
endif() |
|
|
|
|
if(gRPC_INSTALL) |
|
|
|
|
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_PROTOBUF_PROVIDER is \"module\"") |
|
|
|
|
set(gRPC_INSTALL FALSE) |
|
|
|
|
endif() |
|
|
|
|
elseif("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package") |
|
|
|
|
find_package(protobuf CONFIG) |
|
|
|
|
if(protobuf_FOUND) |
|
|
|
@ -216,6 +229,10 @@ if("${gRPC_SSL_PROVIDER}" STREQUAL "module") |
|
|
|
|
else() |
|
|
|
|
message(WARNING "gRPC_SSL_PROVIDER is \"module\" but BORINGSSL_ROOT_DIR is wrong") |
|
|
|
|
endif() |
|
|
|
|
if(gRPC_INSTALL) |
|
|
|
|
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_SSL_PROVIDER is \"module\"") |
|
|
|
|
set(gRPC_INSTALL FALSE) |
|
|
|
|
endif() |
|
|
|
|
elseif("${gRPC_SSL_PROVIDER}" STREQUAL "package") |
|
|
|
|
find_package(OpenSSL) |
|
|
|
|
if(TARGET OpenSSL::SSL) |
|
|
|
|