|
|
|
@ -17,15 +17,12 @@ if(gRPC_ABSL_PROVIDER STREQUAL "module") |
|
|
|
|
set(ABSL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp) |
|
|
|
|
endif() |
|
|
|
|
if(EXISTS "${ABSL_ROOT_DIR}/CMakeLists.txt") |
|
|
|
|
add_subdirectory(${ABSL_ROOT_DIR} third_party/abseil-cpp) |
|
|
|
|
if(TARGET absl_base) |
|
|
|
|
if(gRPC_INSTALL AND _gRPC_INSTALL_SUPPORTED_FROM_MODULE) |
|
|
|
|
install(TARGETS ${gRPC_ABSL_USED_TARGETS} EXPORT gRPCTargets |
|
|
|
|
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} |
|
|
|
|
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} |
|
|
|
|
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}) |
|
|
|
|
endif() |
|
|
|
|
if(gRPC_INSTALL) |
|
|
|
|
# When gRPC_INSTALL is enabled and Abseil will be built as a module, |
|
|
|
|
# Abseil will be installed along with gRPC for convenience. |
|
|
|
|
set(ABSL_ENABLE_INSTALL ON) |
|
|
|
|
endif() |
|
|
|
|
add_subdirectory(${ABSL_ROOT_DIR} third_party/abseil-cpp) |
|
|
|
|
else() |
|
|
|
|
message(WARNING "gRPC_ABSL_PROVIDER is \"module\" but ABSL_ROOT_DIR is wrong") |
|
|
|
|
endif() |
|
|
|
@ -36,5 +33,5 @@ if(gRPC_ABSL_PROVIDER STREQUAL "module") |
|
|
|
|
elseif(gRPC_ABSL_PROVIDER STREQUAL "package") |
|
|
|
|
# Use "CONFIG" as there is no built-in cmake module for absl. |
|
|
|
|
find_package(absl REQUIRED CONFIG) |
|
|
|
|
set(_gRPC_FIND_ABSL "if(NOT absl_FOUND)\n find_package(absl CONFIG)\nendif()") |
|
|
|
|
endif() |
|
|
|
|
set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()") |
|
|
|
|