Repository: conan-io/conan-center-index

Issue:
[proposal] reorganize grpc, grpc-proto, googleapis and google-cloud-cpp
### What is your question?

## Objective 

Create recipes for `google-cloud-cpp`, `grpc`, and `Protobuf` that work correctly and can be upgraded with minimal effort.


## Background

[googleapis/googleapis] contains just service definitions as proto files, and Bazel rules to generate the gRPC and Protobuf code from these proto files. It is not considered a "package" by the teams that maintain it at google, just a location where other projects can find the proto files *and* they can use to generate the packages for each language.

[google-cloud-cpp](https://github.com/googleapis/google-cloud-cpp) vendors-in the protos from [googleapis/googleapis]. It contains code designed to work with specific versions of googleapis/googleapis.  It almost never works with older versions. It may work with newer versions, but there are no guarantees.  `google-cloud-cpp` depends on `grpc`.

[gRPC](https://github.com/grpc/grpc) *appears* to (but in fact does not) vendor some protos from [googleapis/googleapis]. It also appears to vendor some protos from [grpc-proto](https://github.com/grpc/grpc-proto).

* Most of the proto files that are copied into gRPC are used only for tests.
* A few proto files are used via [upb](https://github.com/protocolbuffers/upb). upb is intended for "direct consumption", meaning it is intended to be vendored in.  The team does not plan to release packages.
* The CMake commands to [download googleapis](https://github.com/grpc/grpc/blob/acbac3deee35708b2da1722948bce42caac7ac33/CMakeLists.txt#L354-L362) never execute in Conan builds, as the directory guarding their download always exists.

Note that there is no conflict between the `googleapis` files used by `google-cloud-cpp` and the files used in the `grpc`. Either the files are used in tests, or they are compiled with different "protobuf" libraries, designed to produce different symbols.

Meanwhile, it is impossible to make `grpc` or `grpc-proto` use a range of `googleapis` versions. Ranges for the googleapis versioning scheme (`cci.${date}`) do no work on CCI with Conan v1 (see #17598).

## Problem

Un-vendoring `googleapis` and `grpc-proto` from the `grpc` and `google-cloud-cpp` recipes has made these recipes hard to maintain, and practically impossible to upgrade.

## Proposal

Vendor-in `googleapis` into `google-cloud-cpp` and break the dependency between `grpc` and `grpc-proto`. This would appear to "vendor-in" some protos into `grpc`, but for the reasons mentioned above, this is not the case. The protos are unused in the recipe, or compiled with `upb`.

## See Also

* https://github.com/conan-io/conan-center-index/pull/17598#issuecomment-1568463325
* https://github.com/conan-io/conan-center-index/pull/16438#issuecomment-1520207786

[googleapis/googleapis]: https://github.com/googleapis/googleapis



Discussion:
@jcar87 how would you like me to handle the current version of the recipes.  I can see two ways forward:

- Change the recipes to stop using `googleapis` with their current versions.  That seems cleaner, but will make it impossible for people to reproduced their older builds.
- Change the recipes to stop using `googleapis` in newer versions.  I am not sure the extra complexity is worth it, but I not as familiar with the needs of the Conan community as you are.


Resolving patch:
diff --git a/recipes/google-cloud-cpp/2.x/components_2_5_0.py b/recipes/google-cloud-cpp/2.x/components_2_5_0.py
new file mode 100644
--- /dev/null
+++ b/recipes/google-cloud-cpp/2.x/components_2_5_0.py
@@ -0,0 +1,364 @@
+# Automatically generated by /usr/local/google/home/coryan/cci-develop/recipes/google-cloud-cpp/2.x/extract_dependencies.py DO NOT EDIT
+DEPENDENCIES = {
+    "accessapproval_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "accesscontextmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "apigateway_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "apigeeconnect_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "appengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "artifactregistry_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "asset_protos": ['accesscontextmanager_protos', 'api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'osconfig_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_expr_protos', 'type_timeofday_protos'],
+    "assuredworkloads_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "automl_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "baremetalsolution_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "batch_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "beyondcorp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "cloud_bigquery_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos', 'type_expr_protos'],
+    "bigtable_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "billing_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos', 'type_money_protos'],
+    "binaryauthorization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "certificatemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "channel_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_decimal_protos', 'type_money_protos', 'type_postal_address_protos'],
+    "cloudbuild_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "cloud_common_common_protos": ['api_field_behavior_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "composer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'],
+    "connectors_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "contactcenterinsights_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "container_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'],
+    "containeranalysis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grafeas_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "datacatalog_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'],
+    "datamigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "dataplex_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "dataproc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "datastream_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "debugger_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'devtools_source_v1_source_context_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "deploy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'],
+    "cloud_dialogflow_v2_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'],
+    "dialogflow_cx_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'],
+    "dlp_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_dayofweek_protos', 'type_timeofday_protos'],
+    "documentai_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_date_protos', 'type_datetime_protos', 'type_money_protos', 'type_postal_address_protos'],
+    "edgecontainer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "eventarc_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos'],
+    "filestore_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'cloud_common_common_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "functions_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "gameservices_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "gkehub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "grafeas_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "iam_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'],
+    "iap_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'],
+    "ids_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "iot_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "kms_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "language_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "logging_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "logging_type_type_protos": ['api_annotations_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "managedidentities_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "memcache_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "monitoring_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_calendar_period_protos'],
+    "networkconnectivity_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "networkmanagement_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "notebooks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "optimization_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos'],
+    "orgpolicy_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_expr_protos'],
+    "osconfig_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos', 'type_datetime_protos', 'type_dayofweek_protos', 'type_timeofday_protos'],
+    "oslogin_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "policytroubleshooter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'],
+    "privateca_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "profiler_protos": ['api_annotations_protos', 'api_client_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "pubsub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "recommender_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'type_money_protos'],
+    "redis_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_dayofweek_protos', 'type_timeofday_protos'],
+    "resourcemanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "resourcesettings_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "retail_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_httpbody_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_date_protos'],
+    "run_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "scheduler_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "secretmanager_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'],
+    "securitycenter_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "servicecontrol_protos": ['api_annotations_protos', 'api_client_protos', 'api_distribution_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'logging_type_type_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "servicedirectory_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_expr_protos'],
+    "servicemanagement_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_config_change_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_service_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "serviceusage_protos": ['api_annotations_protos', 'api_auth_protos', 'api_client_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_launch_stage_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_usage_protos', 'api_visibility_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "shell_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "spanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "cloud_speech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "storage_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'type_date_protos', 'type_expr_protos'],
+    "storagetransfer_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_code_protos', 'rpc_status_protos', 'type_date_protos', 'type_timeofday_protos'],
+    "talent_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_latlng_protos', 'type_money_protos', 'type_postal_address_protos', 'type_timeofday_protos'],
+    "tasks_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'iam_v1_iam_policy_protos', 'iam_v1_options_protos', 'iam_v1_policy_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'],
+    "cloud_texttospeech_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "tpu_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "devtools_cloudtrace_v2_trace_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "translate_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "video_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "videointelligence_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "vision_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_color_protos', 'type_latlng_protos'],
+    "vmmigration_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_error_details_protos', 'rpc_status_protos'],
+    "vmwareengine_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "vpcaccess_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "webrisk_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "websecurityscanner_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf'],
+    "workflows_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_http_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'],
+    "api_annotations_protos": ['api_http_protos'],
+    "api_auth_protos": ['api_annotations_protos'],
+    "api_billing_protos": ['api_annotations_protos', 'api_metric_protos'],
+    "api_client_protos": ['api_launch_stage_protos'],
+    "api_distribution_protos": ['api_annotations_protos'],
+    "api_endpoint_protos": ['api_annotations_protos'],
+    "api_log_protos": ['api_label_protos'],
+    "api_logging_protos": ['api_annotations_protos', 'api_label_protos'],
+    "api_metric_protos": ['api_label_protos', 'api_launch_stage_protos'],
+    "api_monitored_resource_protos": ['api_label_protos', 'api_launch_stage_protos'],
+    "api_monitoring_protos": ['api_annotations_protos'],
+    "api_quota_protos": ['api_annotations_protos'],
+    "api_service_protos": ['api_annotations_protos', 'api_auth_protos', 'api_backend_protos', 'api_billing_protos', 'api_client_protos', 'api_context_protos', 'api_control_protos', 'api_documentation_protos', 'api_endpoint_protos', 'api_http_protos', 'api_label_protos', 'api_log_protos', 'api_logging_protos', 'api_metric_protos', 'api_monitored_resource_protos', 'api_monitoring_protos', 'api_quota_protos', 'api_resource_protos', 'api_source_info_protos', 'api_system_parameter_protos', 'api_usage_protos'],
+    "api_usage_protos": ['api_annotations_protos', 'api_visibility_protos'],
+    "devtools_cloudtrace_v2_tracing_protos": ['api_client_protos', 'api_field_behavior_protos', 'devtools_cloudtrace_v2_trace_protos', 'devtools_cloudtrace_v2_trace_protos', 'rpc_status_protos'],
+}
+
+PROTO_COMPONENTS = {
+    "accessapproval_protos",
+    "accesscontextmanager_protos",
+    "api_annotations_protos",
+    "api_auth_protos",
+    "api_backend_protos",
+    "api_billing_protos",
+    "api_client_protos",
+    "api_config_change_protos",
+    "api_context_protos",
+    "api_control_protos",
+    "api_distribution_protos",
+    "api_documentation_protos",
+    "api_endpoint_protos",
+    "api_field_behavior_protos",
+    "api_http_protos",
+    "api_httpbody_protos",
+    "api_label_protos",
+    "api_launch_stage_protos",
+    "api_log_protos",
+    "api_logging_protos",
+    "api_metric_protos",
+    "api_monitored_resource_protos",
+    "api_monitoring_protos",
+    "api_quota_protos",
+    "api_resource_protos",
+    "api_routing_protos",
+    "api_service_protos",
+    "api_source_info_protos",
+    "api_system_parameter_protos",
+    "api_usage_protos",
+    "api_visibility_protos",
+    "apigateway_protos",
+    "apigeeconnect_protos",
+    "appengine_protos",
+    "artifactregistry_protos",
+    "asset_protos",
+    "assuredworkloads_protos",
+    "automl_protos",
+    "baremetalsolution_protos",
+    "batch_protos",
+    "beyondcorp_protos",
+    "bigtable_protos",
+    "billing_protos",
+    "binaryauthorization_protos",
+    "certificatemanager_protos",
+    "channel_protos",
+    "cloud_bigquery_protos",
+    "cloud_common_common_protos",
+    "cloud_dialogflow_v2_protos",
+    "cloud_speech_protos",
+    "cloud_texttospeech_protos",
+    "cloudbuild_protos",
+    "composer_protos",
+    "connectors_protos",
+    "contactcenterinsights_protos",
+    "container_protos",
+    "containeranalysis_protos",
+    "datacatalog_protos",
+    "datamigration_protos",
+    "dataplex_protos",
+    "dataproc_protos",
+    "datastream_protos",
+    "debugger_protos",
+    "deploy_protos",
+    "devtools_cloudtrace_v2_trace_protos",
+    "devtools_cloudtrace_v2_tracing_protos",
+    "devtools_source_v1_source_context_protos",
+    "dialogflow_cx_protos",
+    "dlp_protos",
+    "documentai_protos",
+    "edgecontainer_protos",
+    "eventarc_protos",
+    "filestore_protos",
+    "functions_protos",
+    "gameservices_protos",
+    "gkehub_protos",
+    "grafeas_protos",
+    "iam_protos",
+    "iam_v1_iam_policy_protos",
+    "iam_v1_options_protos",
+    "iam_v1_policy_protos",
+    "iap_protos",
+    "ids_protos",
+    "iot_protos",
+    "kms_protos",
+    "language_protos",
+    "logging_protos",
+    "logging_type_type_protos",
+    "longrunning_operations_protos",
+    "managedidentities_protos",
+    "memcache_protos",
+    "monitoring_protos",
+    "networkconnectivity_protos",
+    "networkmanagement_protos",
+    "notebooks_protos",
+    "optimization_protos",
+    "orgpolicy_protos",
+    "osconfig_protos",
+    "oslogin_protos",
+    "policytroubleshooter_protos",
+    "privateca_protos",
+    "profiler_protos",
+    "pubsub_protos",
+    "recommender_protos",
+    "redis_protos",
+    "resourcemanager_protos",
+    "resourcesettings_protos",
+    "retail_protos",
+    "rpc_code_protos",
+    "rpc_error_details_protos",
+    "rpc_status_protos",
+    "run_protos",
+    "scheduler_protos",
+    "secretmanager_protos",
+    "securitycenter_protos",
+    "servicecontrol_protos",
+    "servicedirectory_protos",
+    "servicemanagement_protos",
+    "serviceusage_protos",
+    "shell_protos",
+    "spanner_protos",
+    "storage_protos",
+    "storagetransfer_protos",
+    "talent_protos",
+    "tasks_protos",
+    "tpu_protos",
+    "translate_protos",
+    "type_calendar_period_protos",
+    "type_color_protos",
+    "type_date_protos",
+    "type_datetime_protos",
+    "type_dayofweek_protos",
+    "type_decimal_protos",
+    "type_expr_protos",
+    "type_latlng_protos",
+    "type_money_protos",
+    "type_postal_address_protos",
+    "type_timeofday_protos",
+    "video_protos",
+    "videointelligence_protos",
+    "vision_protos",
+    "vmmigration_protos",
+    "vmwareengine_protos",
+    "vpcaccess_protos",
+    "webrisk_protos",
+    "websecurityscanner_protos",
+    "workflows_protos"
+}
+
+COMPONENTS = {
+    "accessapproval",
+    "accesscontextmanager",
+    "apigateway",
+    "apigeeconnect",
+    "appengine",
+    "artifactregistry",
+    "asset",
+    "assuredworkloads",
+    "automl",
+    "baremetalsolution",
+    "batch",
+    "beyondcorp",
+    "bigquery",
+    "bigtable",
+    "billing",
+    "binaryauthorization",
+    "certificatemanager",
+    "channel",
+    "cloudbuild",
+    "composer",
+    "connectors",
+    "contactcenterinsights",
+    "container",
+    "containeranalysis",
+    "datacatalog",
+    "datamigration",
+    "dataplex",
+    "dataproc",
+    "datastream",
+    "debugger",
+    "deploy",
+    "dialogflow_cx",
+    "dialogflow_es",
+    "dlp",
+    "documentai",
+    "edgecontainer",
+    "eventarc",
+    "filestore",
+    "functions",
+    "gameservices",
+    "gkehub",
+    "iam",
+    "iap",
+    "ids",
+    "iot",
+    "kms",
+    "language",
+    "logging",
+    "managedidentities",
+    "memcache",
+    "monitoring",
+    "networkconnectivity",
+    "networkmanagement",
+    "notebooks",
+    "optimization",
+    "orgpolicy",
+    "osconfig",
+    "oslogin",
+    "policytroubleshooter",
+    "privateca",
+    "profiler",
+    "pubsub",
+    "recommender",
+    "redis",
+    "resourcemanager",
+    "resourcesettings",
+    "retail",
+    "run",
+    "scheduler",
+    "secretmanager",
+    "securitycenter",
+    "servicecontrol",
+    "servicedirectory",
+    "servicemanagement",
+    "serviceusage",
+    "shell",
+    "spanner",
+    "speech",
+    "storage",
+    "storagetransfer",
+    "talent",
+    "tasks",
+    "texttospeech",
+    "tpu",
+    "trace",
+    "translate",
+    "video",
+    "videointelligence",
+    "vision",
+    "vmmigration",
+    "vmwareengine",
+    "vpcaccess",
+    "webrisk",
+    "websecurityscanner",
+    "workflows"
+}
diff --git a/recipes/google-cloud-cpp/2.x/conanfile.py b/recipes/google-cloud-cpp/2.x/conanfile.py
--- a/recipes/google-cloud-cpp/2.x/conanfile.py
+++ b/recipes/google-cloud-cpp/2.x/conanfile.py
@@ -9,6 +9,18 @@
 from conan.tools.scm import Version
 from conan.errors import ConanInvalidConfiguration
 
+# Load the generated component dependency information.
+#
+# `google-cloud-cpp` has well over 200 components. Conan cannot use the CMake
+# files generated by `google-cloud-cpp`. Manually maintaining this dependency
+# information is error prone and fairly tedious. A helper script in this
+# directory reproduces the algorithms used by `google-cloud-cpp` to generate its
+# dependency information. With each new revision of `google-cloud-cpp` the
+# script will be used to generate a new file with the component dependency
+# information. The expectation is that maintaining this script will be easier
+# than writing long lists of dependencies by hand.
+import components_2_5_0
+
 required_conan_version = ">=1.56.0"
 
 
@@ -31,11 +43,25 @@ class GoogleCloudCppConan(ConanFile):
     settings = "os", "arch", "compiler", "build_type"
     options = {"shared": [True, False], "fPIC": [True, False]}
     default_options = {"shared": False, "fPIC": True}
+    exports = ["components_2_5_0.py"]
 
     short_paths = True
 
+    _GA_COMPONENTS = {
+        '2.5.0': components_2_5_0.COMPONENTS,
+    }
+    _PROTO_COMPONENTS = {
+        '2.5.0': components_2_5_0.PROTO_COMPONENTS,
+    }
+    _PROTO_COMPONENT_DEPENDENCIES = {
+        "2.5.0": components_2_5_0.DEPENDENCIES
+    }
+    # Some components require custom dependency definitions.
+    _REQUIRES_CUSTOM_DEPENDENCIES = {
+        "bigquery", "bigtable", "iam", "pubsub", "spanner", "storage",
+    }
+
     def export_sources(self):
-        copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))
         export_conandata_patches(self)
 
     def config_options(self):
@@ -46,8 +72,6 @@ def configure(self):
         if self.options.shared:
             self.options.rm_safe("fPIC")
             self.options["protobuf"].shared = True
-            self.options["googleapis"].shared = True
-            self.options["grpc-proto"].shared = True
             self.options["grpc"].shared = True
 
     def validate(self):
@@ -64,6 +88,21 @@ def validate(self):
                 "Recipe not prepared for cross-building (yet)"
             )
 
+        if self.version not in self._GA_COMPONENTS:
+            raise ConanInvalidConfiguration(
+                "The components are unknown for version %s" % self.version
+            )
+
+        if self.version not in self._PROTO_COMPONENTS:
+            raise ConanInvalidConfiguration(
+                "The proto components are unknown for version %s" % self.version
+            )
+
+        if self.version not in self._PROTO_COMPONENT_DEPENDENCIES:
+            raise ConanInvalidConfiguration(
+                "The inter-component dependencies are unknown for version %s" % self.version
+            )
+
         if (
             self.settings.compiler == "clang"
             and Version(self.settings.compiler.version) < "6.0"
@@ -81,14 +120,10 @@ def validate(self):
 
         if self.info.options.shared and \
            (not self.dependencies["protobuf"].options.shared or \
-            not self.dependencies["googleapis"].options.shared or \
-            not self.dependencies["grpc-proto"].options.shared or \
             not self.dependencies["grpc"].options.shared):
             raise ConanInvalidConfiguration(
-                "If built as shared, protobuf, googleapis, grpc-proto, and grpc must be shared as well."
-                " Please, use `protobuf/*:shared=True`, `googleapis/*:shared=True`, `grpc-proto/*:shared=True`,"
-                " and `grpc/*:shared=True`",
-            )
+                "If built as shared, protobuf, and grpc must be shared as well."
+                " Please, use `protobuf/*:shared=True`, and `grpc/*:shared=True`.")
 
     def layout(self):
         cmake_layout(self, src_folder="src")
@@ -105,13 +140,6 @@ def requirements(self):
         self.requires("libcurl/7.88.1")
         self.requires("openssl/[>=1.1 <4]")
         self.requires("zlib/1.2.13")
-        # `google-cloud-cpp` contains code generated from the proto files.
-        # Working with older versions of these protos almost always will fail, as
-        # at least some of the RPCs included in the GRPC-generator stubs will be
-        # missing.
-        # Working with newer versions of these protos almost always will work. There
-        # are very few breaking changes on the proto files.
-        self.requires(f"googleapis/{self._GOOGLEAPIS_VERSIONS[self.version]}", transitive_headers=True)
 
     def build_requirements(self):
         # For the grpc-cpp-plugin executable
@@ -119,7 +147,6 @@ def build_requirements(self):
 
     def generate(self):
         tc = CMakeToolchain(self)
-        tc.cache_variables["CMAKE_PROJECT_google-cloud-cpp_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake")
         tc.variables["BUILD_TESTING"] = False
         tc.variables["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False
         tc.variables["GOOGLE_CLOUD_CPP_ENABLE"] = ",".join(self._components())
@@ -147,124 +174,44 @@ def build(self):
         cmake.configure()
         cmake.build()
 
-    _GOOGLEAPIS_VERSIONS = {
-        "2.5.0": "cci.20221108",
-    }
-
-    _GA_COMPONENTS_BASE = {"bigquery", "bigtable", "iam", "pubsub", "spanner", "storage"}
-    _GA_COMPONENTS_VERSION = {
-        '2.5.0': {
-            "accessapproval",
-            "accesscontextmanager",
-            "apigateway",
-            "apigeeconnect",
-            "appengine",
-            "artifactregistry",
-            "asset",
-            "assuredworkloads",
-            "automl",
-            "baremetalsolution",
-            "batch",
-            "beyondcorp",
-            "billing",
-            "binaryauthorization",
-            "certificatemanager",
-            "channel",
-            "cloudbuild",
-            "composer",
-            "connectors",
-            "contactcenterinsights",
-            "container",
-            "containeranalysis",
-            "datacatalog",
-            "datamigration",
-            "dataplex",
-            "dataproc",
-            "datastream",
-            "debugger",
-            "deploy",
-            "dialogflow_cx",
-            "dialogflow_es",
-            "dlp",
-            "documentai",
-            "edgecontainer",
-            "eventarc",
-            "filestore",
-            "functions",
-            "gameservices",
-            "gkehub",
-            "iap",
-            "ids",
-            "iot",
-            "kms",
-            "language",
-            "logging",
-            "managedidentities",
-            "memcache",
-            "monitoring",
-            "networkconnectivity",
-            "networkmanagement",
-            "notebooks",
-            "optimization",
-            "orgpolicy",
-            "osconfig",
-            "oslogin",
-            "policytroubleshooter",
-            "privateca",
-            "profiler",
-            "recommender",
-            "redis",
-            "resourcemanager",
-            "resourcesettings",
-            "retail",
-            "run",
-            "scheduler",
-            "secretmanager",
-            "securitycenter",
-            "servicecontrol",
-            "servicedirectory",
-            "servicemanagement",
-            "serviceusage",
-            "shell",
-            "speech",
-            "storagetransfer",
-            "talent",
-            "tasks",
-            "texttospeech",
-            "tpu",
-            "trace",
-            "translate",
-            "video",
-            "videointelligence",
-            "vision",
-            "vmmigration",
-            "vmwareengine",
-            "vpcaccess",
-            "webrisk",
-            "websecurityscanner",
-            "workflows",
-        },
+    def _generate_proto_requires(self, component):
+        deps = self._PROTO_COMPONENT_DEPENDENCIES.get(self.version, dict())
+        return deps.get(component, [])
+
+    _SKIPPED_COMPONENTS = {
+        # Some protos do not compile due to inconvenient system macros clashing
+        # with proto enum values. Protobuf can workaround these problems, but
+        # the current version in Conan index (protobuf/3.21.4) do not contain
+        # the fixes for these cases.
+        # TODO - review after protobuf >= 4.23.x
+        'asset',
+        'channel',
+        'storagetransfer',
+        # TODO - certificatemanager crashes the gRPC code generator. Add it back
+        # after gRPC >= 1.53.x
+        'certificatemanager',
     }
 
     def _components(self):
-        result = self._GA_COMPONENTS_BASE
-        for v in sorted(self._GA_COMPONENTS_VERSION.keys()):
-            if v > Version(self):
-                break
-            result = result.union(self._GA_COMPONENTS_VERSION[v])
-        # Some protos do not compile due to inconvenient system macros clashing with proto enum values.
-        # Protobuf can workaround these problems, but the current version in Conan index (protobuf/3.21.4)
-        # do not contain the fixes for these cases.
-        # TODO - review after protobuf >= 3.22.x
-        result.remove('asset')
-        result.remove('channel')
-        result.remove('storagetransfer')
-        # Some of the macros are platform specific.
+        result = self._GA_COMPONENTS.get(self.version, []).copy()
+        for c in self._SKIPPED_COMPONENTS:
+            result.remove(c)
+        # TODO - these do not build on Android due to conflicts between OS
+        # macros and Proto enums. Revisit after Protobuf >= 4.23.x
         if self.settings.os == "Android":
             result.remove('accesscontextmanager')
             result.remove('talent')
-        # TODO - certificatemanager crashes the gRPC code generator. Add it back after gRPC >= 1.53.x
-        result.remove('certificatemanager')
+        return result
+
+    def _proto_components(self):
+        result = self._PROTO_COMPONENTS.get(self.version, []).copy()
+        for c in self._SKIPPED_COMPONENTS:
+            result.remove(c + '_protos')
+        # TODO - these do not build on Android due to conflicts between OS
+        # macros and Proto enums. Revisit after Protobuf >= 4.23.x
+        if self.settings.os == "Android":
+            result.remove('accesscontextmanager_protos')
+            result.remove('talent_protos')
         return result
 
     def package(self):
@@ -275,8 +222,7 @@ def package(self):
         rmdir(self, path=os.path.join(self.package_folder, "lib", "pkgconfig"))
 
     def _add_proto_component(self, component):
-        PROTOS_SHARED_REQUIRES=["googleapis::googleapis", "grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf"]
-        self.cpp_info.components[component].requires = PROTOS_SHARED_REQUIRES
+        self.cpp_info.components[component].requires = self._generate_proto_requires(component)
         self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"]
         self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}"
 
@@ -296,15 +242,29 @@ def package_info(self):
         self.cpp_info.components["rest_internal"].names["pkg_config"] = "google_cloud_cpp_common"
 
         # A small number of gRPC-generated stubs are used directly in the common components
-        # shared by all gRPC-based libraries.  These bust be defined without reference to `grpc_utils`.
-        GRPC_UTILS_REQUIRED_PROTOS=["iam_protos", "longrunning_operations_protos", "rpc_error_details_protos", "rpc_status_protos"]
+        # shared by all gRPC-based libraries.  These must be defined without reference to `grpc_utils`.
+        GRPC_UTILS_REQUIRED_PROTOS={"iam_protos", "longrunning_operations_protos", "rpc_error_details_protos", "rpc_status_protos"}
         for component in GRPC_UTILS_REQUIRED_PROTOS:
             self._add_proto_component(component)
 
-        self.cpp_info.components["grpc_utils"].requires = GRPC_UTILS_REQUIRED_PROTOS + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++", "grpc::_grpc"]
+        self.cpp_info.components["grpc_utils"].requires = list(GRPC_UTILS_REQUIRED_PROTOS) + ["common", "abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "grpc::grpc++", "grpc::_grpc"]
         self.cpp_info.components["grpc_utils"].libs = ["google_cloud_cpp_grpc_utils"]
         self.cpp_info.components["grpc_utils"].names["pkg_config"] = "google_cloud_cpp_grpc_utils"
 
+        for component in self._proto_components():
+            if component not in GRPC_UTILS_REQUIRED_PROTOS:
+                self._add_proto_component(component)
+
+        # Interface libraries for backwards compatibility
+        self.cpp_info.components["dialogflow_es_protos"].requires = ["cloud_dialogflow_v2_protos"]
+        self.cpp_info.components["logging_type_protos"].requires = ["logging_type_type_protos"]
+        self.cpp_info.components["speech_protos"].requires = ["cloud_speech_protos"]
+        self.cpp_info.components["texttospeech_protos"].requires = ["cloud_texttospeech_protos"]
+        self.cpp_info.components["trace_protos"].requires = [
+            "devtools_cloudtrace_v2_trace_protos",
+            "devtools_cloudtrace_v2_tracing_protos",
+        ]
+
         for component in self._components():
             # bigquery proto library predates the adoption of more consistent naming
             if component == 'bigquery':
@@ -317,11 +277,7 @@ def package_info(self):
                 continue
             # `storage` is the only component that does not depend on a matching `*_protos` library
             protos=f"{component}_protos"
-            if component != 'storage' and component not in GRPC_UTILS_REQUIRED_PROTOS:
-                self._add_proto_component(protos)
-            # The components in self._GA_COMPONENTS_BASE are hand-crafted and need custom
-            # definitions (see below)
-            if component in self._GA_COMPONENTS_BASE:
+            if component in self._REQUIRES_CUSTOM_DEPENDENCIES:
                 continue
             self._add_grpc_component(component, protos)
 
diff --git a/recipes/google-cloud-cpp/2.x/extract_dependencies.py b/recipes/google-cloud-cpp/2.x/extract_dependencies.py
new file mode 100755
--- /dev/null
+++ b/recipes/google-cloud-cpp/2.x/extract_dependencies.py
@@ -0,0 +1,365 @@
+#!/usr/bin/env python3
+
+import argparse
+import glob
+import os
+
+"""Extract google-cloud-cpp's component dependency info for use in Conan.
+
+google-cloud-cpp builds a number (about 100) of libraries from proto files.
+These libraries have dependencies between them. In Conan, one cannot use the
+dependencies preserved in the *-config.cmake files generated by the package, so
+we have to reconstruct the dependencies here.
+
+Fortunately, google-cloud-cpp uses a number of *.deps files to keep these
+dependencies. We just need to reimplement their algorithm to load these files
+and convert them to CMake dependencies.
+
+The *.deps files themselves are generated (and committed to GitHub) from
+Bazel rules.
+"""
+
+# Used in _generate_proto_requires(): common requirements
+_PROTO_DEPS_COMMON_REQUIRES = {"grpc::grpc++", "grpc::_grpc", "protobuf::libprotobuf"}
+
+# Used in _generate_proto_requires(): the *.deps files are generated from
+# Bazel and contain a few targets that do not exit (nor do they need to
+# exist) in CMake.
+_PROTO_DEPS_REMOVED_TARGETS = {
+    "cloud_kms_v1_kms_protos",
+    "cloud_orgpolicy_v1_orgpolicy_protos",
+    "cloud_oslogin_common_common_protos",
+    "cloud_recommender_v1_recommender_protos",
+    "identity_accesscontextmanager_type_type_protos",
+}
+
+# Used in _generate_proto_requires(): the *.deps files are generated from
+# Bazel and contain a few targets that have incorrect names for CMake.
+_PROTO_DEPS_REPLACED_TARGETS = {
+    "grafeas_v1_grafeas_protos": "grafeas_protos",
+    "identity_accesscontextmanager_v1_accesscontextmanager_protos": "accesscontextmanager_protos",
+    "cloud_osconfig_v1_osconfig_protos": "osconfig_protos",
+    "devtools_source_v1_source_protos": "devtools_source_v1_source_context_protos",
+}
+
+# A few *.deps files use ad-hoc naming.
+_PROTO_DEPS_REPLACED_NAMES = {
+    "common": "cloud_common_common",
+    "bigquery": "cloud_bigquery",
+    "dialogflow": "cloud_dialogflow_v2",
+    "logging_type": "logging_type_type",
+    "texttospeech": "cloud_texttospeech",
+    "speech": "cloud_speech",
+    "trace": "devtools_cloudtrace_v2_trace",
+}
+
+# A few *.deps files are not used.
+_PROTO_DEPS_UNUSED = {
+    "iam_policy",
+}
+
+# A few _protos libraries were introduced before `google-cloud-cpp` adopted
+# more consistent naming.
+_PROTO_BASE_COMPONENTS = {
+    "api_service_protos",
+    "api_visibility_protos",
+    "api_monitoring_protos",
+    "type_date_protos",
+    "api_control_protos",
+    "api_client_protos",
+    "api_annotations_protos",
+    "api_httpbody_protos",
+    "iam_v1_policy_protos",
+    "api_auth_protos",
+    "api_resource_protos",
+    "api_billing_protos",
+    "api_quota_protos",
+    "api_source_info_protos",
+    "api_backend_protos",
+    "type_datetime_protos",
+    "iam_v1_options_protos",
+    "api_endpoint_protos",
+    "api_launch_stage_protos",
+    "api_documentation_protos",
+    "devtools_source_v1_source_context_protos",
+    "type_color_protos",
+    "api_distribution_protos",
+    "api_config_change_protos",
+    "iam_v1_iam_policy_protos",
+    "type_expr_protos",
+    "api_routing_protos",
+    "api_usage_protos",
+    "logging_type_type_protos",
+    "type_calendar_period_protos",
+    "rpc_code_protos",
+    "api_system_parameter_protos",
+    "cloud_common_common_protos",
+    "type_postal_address_protos",
+    "type_latlng_protos",
+    "type_dayofweek_protos",
+    "api_monitored_resource_protos",
+    "type_money_protos",
+    "api_metric_protos",
+    "api_label_protos",
+    "api_log_protos",
+    "grafeas_protos",
+    "api_http_protos",
+    "type_timeofday_protos",
+    "api_field_behavior_protos",
+    "api_context_protos",
+    "api_logging_protos",
+}
+
+# A list of experimental components used when `google-cloud-cpp` does not
+# provide an easy-to-use list.
+_DEFAULT_EXPERIMENTAL_COMPONENTS = {
+    "apikeys",
+    "pubsublite",
+}
+
+# A list of components used when `google-cloud-cpp` does not provide an
+# easy-to-use list.
+_DEFAULT_COMPONENTS = {
+    "accessapproval",
+    "accesscontextmanager",
+    "apigateway",
+    "apigeeconnect",
+    "appengine",
+    "artifactregistry",
+    "asset",
+    "assuredworkloads",
+    "automl",
+    "baremetalsolution",
+    "batch",
+    "beyondcorp",
+    "bigquery",
+    "bigtable",
+    "billing",
+    "binaryauthorization",
+    "certificatemanager",
+    "channel",
+    "cloudbuild",
+    "composer",
+    "connectors",
+    "contactcenterinsights",
+    "container",
+    "containeranalysis",
+    "datacatalog",
+    "datamigration",
+    "dataplex",
+    "dataproc",
+    "datastream",
+    "debugger",
+    "deploy",
+    "dialogflow_cx",
+    "dialogflow_es",
+    "dlp",
+    "documentai",
+    "edgecontainer",
+    "eventarc",
+    "filestore",
+    "functions",
+    "gameservices",
+    "gkehub",
+    "iam",
+    "iap",
+    "ids",
+    "iot",
+    "kms",
+    "language",
+    "logging",
+    "managedidentities",
+    "memcache",
+    "monitoring",
+    "networkconnectivity",
+    "networkmanagement",
+    "notebooks",
+    "optimization",
+    "orgpolicy",
+    "osconfig",
+    "oslogin",
+    "policytroubleshooter",
+    "privateca",
+    "profiler",
+    "pubsub",
+    "recommender",
+    "redis",
+    "resourcemanager",
+    "resourcesettings",
+    "retail",
+    "run",
+    "scheduler",
+    "secretmanager",
+    "securitycenter",
+    "servicecontrol",
+    "servicedirectory",
+    "servicemanagement",
+    "serviceusage",
+    "shell",
+    "spanner",
+    "speech",
+    "storage",
+    "storagetransfer",
+    "talent",
+    "tasks",
+    "texttospeech",
+    "tpu",
+    "trace",
+    "translate",
+    "video",
+    "videointelligence",
+    "vision",
+    "vmmigration",
+    "vmwareengine",
+    "vpcaccess",
+    "webrisk",
+    "websecurityscanner",
+    "workflows",
+}
+
+# `google-cloud-cpp` managems these dependencies using CMake code.
+_HARD_CODED_DEPENDENCIES = {
+    "api_annotations_protos": ["api_http_protos"],
+    "api_auth_protos": ["api_annotations_protos"],
+    "api_client_protos": ["api_launch_stage_protos"],
+    "api_metric_protos": ["api_launch_stage_protos", "api_label_protos"],
+    "api_billing_protos": ["api_annotations_protos", "api_metric_protos"],
+    "api_distribution_protos": ["api_annotations_protos"],
+    "api_endpoint_protos": ["api_annotations_protos"],
+    "api_log_protos": ["api_label_protos"],
+    "api_logging_protos": ["api_annotations_protos", "api_label_protos"],
+    "api_monitored_resource_protos": ["api_launch_stage_protos", "api_label_protos"],
+    "api_monitoring_protos": ["api_annotations_protos"],
+    "api_quota_protos": ["api_annotations_protos"],
+    "api_usage_protos": ["api_annotations_protos", "api_visibility_protos"],
+    "api_service_protos": [
+        "api_annotations_protos",
+        "api_auth_protos",
+        "api_backend_protos",
+        "api_billing_protos",
+        "api_client_protos",
+        "api_context_protos",
+        "api_control_protos",
+        "api_documentation_protos",
+        "api_endpoint_protos",
+        "api_http_protos",
+        "api_label_protos",
+        "api_log_protos",
+        "api_logging_protos",
+        "api_metric_protos",
+        "api_monitored_resource_protos",
+        "api_monitoring_protos",
+        "api_quota_protos",
+        "api_resource_protos",
+        "api_source_info_protos",
+        "api_system_parameter_protos",
+        "api_usage_protos",
+    ],
+    "devtools_cloudtrace_v2_tracing_protos": [
+        "devtools_cloudtrace_v2_trace_protos",
+        "devtools_cloudtrace_v2_trace_protos",
+        "api_client_protos",
+        "api_field_behavior_protos",
+        "rpc_status_protos",
+    ],
+}
+
+
+def _components(source_folder):
+    libraries = os.path.join(source_folder, "libraries.bzl")
+    # Use the hard-coded list because the `google-cloud-cpp` does not provide
+    # an easy way to get all the components.
+    if not os.path.exists(libraries):
+        return _DEFAULT_COMPONENTS
+    # The `libraries.bzl` file is a Starlark file that simply defines some
+    # variables listing all GA, experimental, and "transition", components.
+    # We want both the GA and transition components, the latter are components
+    # that recently transitioned from experimental to GA.
+    g = dict()
+    with open(libraries) as f:
+        exec(compile(f.read(), libraries, "exec"), g)
+    return (
+        g["GOOGLE_CLOUD_CPP_GA_LIBRARIES"] + g["GOOGLE_CLOUD_CPP_TRANSITION_LIBRARIES"]
+    )
+
+
+def _experimental_components(source_folder):
+    libraries = os.path.join(source_folder, "libraries.bzl")
+    # Use the hard-coded list because the `google-cloud-cpp` does not provide
+    # an easy way to get all the components.
+    if not os.path.exists(libraries):
+        return _DEFAULT_EXPERIMENTAL_COMPONENTS
+    # The `libraries.bzl` file is a Starlark file that simply defines some
+    # variables listing all GA, experimental, and "transition", components.
+    # We want to return any experimental components, the caller will skip them
+    # as they are not built by Conan.
+    g = dict()
+    with open(libraries) as f:
+        exec(compile(f.read(), libraries, "exec"), g)
+    return g["GOOGLE_CLOUD_CPP_EXPERIMENTAL_LIBRARIES"]
+
+
+def _generate_proto_requires(depfile):
+    """Load the dependencies for a single google-cloud-cpp::*-protos library."""
+    requires = []
+    with open(depfile, "r", encoding="utf-8") as f:
+        for line in f.readlines():
+            line = line.strip()
+            line = line.replace(":", "_")
+            line = line.replace("_proto", "_protos")
+            line = line.replace("@com_google_googleapis//", "")
+            line = line.replace("google/", "")
+            line = line.replace("/", "_")
+            if line in _PROTO_DEPS_REMOVED_TARGETS:
+                continue
+            line = _PROTO_DEPS_REPLACED_TARGETS.get(line, line)
+            requires.append(line)
+    return list(_PROTO_DEPS_COMMON_REQUIRES) + requires
+
+
+def main():
+    """Generate a python file representing the google-cloud-cpp proto deps."""
+    parser = argparse.ArgumentParser(description=(__doc__))
+    parser.add_argument(
+        "-s",
+        "--source-folder",
+        help="a directory where `google-cloud-cpp` source has been extracted",
+    )
+    args = parser.parse_args()
+    source_folder = vars(args)["source_folder"]
+    deps_folder = os.path.join(source_folder, "external", "googleapis", "protodeps")
+    print("# Automatically generated by %s DO NOT EDIT" % __file__)
+    print("DEPENDENCIES = {")
+    proto_components = _PROTO_BASE_COMPONENTS.copy()
+    files = sorted(glob.glob(os.path.join(deps_folder, "*.deps")))
+    experimental = set(_experimental_components(source_folder))
+    for filename in files:
+        component = os.path.basename(filename).replace(".deps", "")
+        component = _PROTO_DEPS_REPLACED_NAMES.get(component, component)
+        if component in experimental or component in _PROTO_DEPS_UNUSED:
+            # Experimental components have an associated *_protos, component.
+            # The Conan package only compiles the GA components, so we need
+            # to skip these.
+            continue
+        component = component + "_protos"
+        deps = _generate_proto_requires(filename)
+        proto_components.add(component)
+        proto_components.update(deps)
+        print(f'    "{component}": {sorted(deps)},')
+    for component in sorted(_HARD_CODED_DEPENDENCIES.keys()):
+        deps = _HARD_CODED_DEPENDENCIES[component]
+        proto_components.add(component)
+        proto_components.update(deps)
+        print(f'    "{component}": {sorted(deps)},')
+    print("}")
+    proto_components = proto_components - _PROTO_DEPS_COMMON_REQUIRES
+    names = ['"%s"' % c for c in proto_components]
+    joined = ",\n    ".join(sorted(names))
+    print(f"\nPROTO_COMPONENTS = {{\n    {joined}\n}}")
+    names = ['"%s"' % c for c in _components(source_folder)]
+    joined = ",\n    ".join(sorted(names))
+    print(f"\nCOMPONENTS = {{\n    {joined}\n}}")
+
+
+if __name__ == "__main__":
+    main()


Test patch: