1if(NOT trout_GRPC_ROOT_DIR) 2 set(trout_GRPC_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/grpc) 3endif() 4 5if(EXISTS "${trout_GRPC_ROOT_DIR}/CMakeLists.txt") 6 if(TARGET ${_trout_GRPCXX_LIBRARY_NAME}) 7 set(trout_GRPCXX_LIBRARIES ${_trout_GRPCXX_LIBRARY_NAME}) 8 else() 9 set(trout_GRPCXX_LIBRARIES "grpc++") 10 endif() 11 if (NOT TARGET ${trout_GRPCXX_LIBRARIES}) 12 add_subdirectory(${trout_GRPC_ROOT_DIR} third_party/grpc) 13 endif() 14else() 15 message(FATAL_ERROR "${trout_GRPC_ROOT_DIR}/CMakeLists.txt not found") 16endif() 17