@@ -27,16 +27,35 @@ set(EXTERNAL_GOOGLEAPIS_PROTO_FILES
2727 # cmake-format: sort
2828 "google/api/annotations.proto"
2929 "google/api/auth.proto"
30+ "google/api/backend.proto"
31+ "google/api/billing.proto"
3032 "google/api/client.proto"
33+ "google/api/config_change.proto"
34+ "google/api/consumer.proto"
35+ "google/api/context.proto"
36+ "google/api/control.proto"
3137 "google/api/distribution.proto"
38+ "google/api/documentation.proto"
39+ "google/api/endpoint.proto"
40+ "google/api/error_reason.proto"
3241 "google/api/field_behavior.proto"
3342 "google/api/http.proto"
3443 "google/api/httpbody.proto"
3544 "google/api/label.proto"
3645 "google/api/launch_stage.proto"
46+ "google/api/log.proto"
47+ "google/api/logging.proto"
3748 "google/api/metric.proto"
3849 "google/api/monitored_resource.proto"
50+ "google/api/monitoring.proto"
51+ "google/api/quota.proto"
3952 "google/api/resource.proto"
53+ "google/api/routing.proto"
54+ "google/api/service.proto"
55+ "google/api/source_info.proto"
56+ "google/api/system_parameter.proto"
57+ "google/api/usage.proto"
58+ "google/api/visibility.proto"
4059 "google/devtools/cloudtrace/v2/trace.proto"
4160 "google/devtools/cloudtrace/v2/tracing.proto"
4261 "google/iam/v1/iam_policy.proto"
@@ -210,18 +229,6 @@ endfunction ()
210229
211230set (external_googleapis_installed_libraries_list
212231 # cmake-format: sort
213- google_cloud_cpp_api_annotations_protos
214- google_cloud_cpp_api_auth_protos
215- google_cloud_cpp_api_client_protos
216- google_cloud_cpp_api_distribution_protos
217- google_cloud_cpp_api_field_behavior_protos
218- google_cloud_cpp_api_http_protos
219- google_cloud_cpp_api_httpbody_protos
220- google_cloud_cpp_api_label_protos
221- google_cloud_cpp_api_launch_stage_protos
222- google_cloud_cpp_api_metric_protos
223- google_cloud_cpp_api_monitored_resource_protos
224- google_cloud_cpp_api_resource_protos
225232 google_cloud_cpp_bigtable_protos
226233 google_cloud_cpp_cloud_bigquery_protos
227234 google_cloud_cpp_cloud_speech_protos
@@ -236,63 +243,88 @@ set(external_googleapis_installed_libraries_list
236243 google_cloud_cpp_longrunning_operations_protos
237244 google_cloud_cpp_monitoring_protos
238245 google_cloud_cpp_pubsub_protos
239- google_cloud_cpp_rpc_code_protos
240- google_cloud_cpp_rpc_error_details_protos
241- google_cloud_cpp_rpc_status_protos
242246 google_cloud_cpp_spanner_protos
243- google_cloud_cpp_storage_protos
244- google_cloud_cpp_type_calendar_period_protos
245- google_cloud_cpp_type_color_protos
246- google_cloud_cpp_type_date_protos
247- google_cloud_cpp_type_datetime_protos
248- google_cloud_cpp_type_dayofweek_protos
249- google_cloud_cpp_type_expr_protos
250- google_cloud_cpp_type_fraction_protos
251- google_cloud_cpp_type_interval_protos
252- google_cloud_cpp_type_latlng_protos
253- google_cloud_cpp_type_localized_text_protos
254- google_cloud_cpp_type_money_protos
255- google_cloud_cpp_type_month_protos
256- google_cloud_cpp_type_phone_number_protos
257- google_cloud_cpp_type_postal_address_protos
258- google_cloud_cpp_type_quaternion_protos
259- google_cloud_cpp_type_timeofday_protos)
260-
261- # Keep these sorted to simplify maintenance
262- external_googleapis_add_library("google/api/client.proto" )
263- external_googleapis_add_library("google/api/distribution.proto" )
264- external_googleapis_add_library("google/api/field_behavior.proto" )
265- external_googleapis_add_library("google/api/http.proto" )
266- external_googleapis_add_library("google/api/httpbody.proto" )
267- external_googleapis_add_library("google/api/label.proto" )
268- external_googleapis_add_library("google/api/launch_stage.proto" )
269- external_googleapis_add_library("google/api/resource.proto" )
270- external_googleapis_add_library("google/type/calendar_period.proto" )
271- external_googleapis_add_library("google/type/color.proto" )
272- external_googleapis_add_library("google/type/date.proto" )
273- external_googleapis_add_library("google/type/datetime.proto" )
274- external_googleapis_add_library("google/type/dayofweek.proto" )
275- external_googleapis_add_library("google/type/expr.proto" )
276- external_googleapis_add_library("google/type/fraction.proto" )
277- external_googleapis_add_library("google/type/interval.proto" )
278- external_googleapis_add_library("google/type/latlng.proto" )
279- external_googleapis_add_library("google/type/localized_text.proto" )
280- external_googleapis_add_library("google/type/money.proto" )
281- external_googleapis_add_library("google/type/month.proto" )
282- external_googleapis_add_library("google/type/phone_number.proto" )
283- external_googleapis_add_library("google/type/postal_address.proto" )
284- external_googleapis_add_library("google/type/quaternion.proto" )
285- external_googleapis_add_library("google/type/timeofday.proto" )
286- external_googleapis_add_library("google/rpc/code.proto" )
287- external_googleapis_add_library("google/rpc/error_details.proto" )
247+ google_cloud_cpp_storage_protos)
248+
249+ # These proto files cannot be added in the foreach() loop because they have
250+ # dependencies.
251+ set (PROTO_FILES_WITH_DEPENDENCIES
252+ # cmake-format: sort
253+ "google/api/annotations.proto"
254+ "google/api/auth.proto"
255+ "google/api/billing.proto"
256+ "google/api/distribution.proto"
257+ "google/api/endpoint.proto"
258+ "google/api/log.proto"
259+ "google/api/logging.proto"
260+ "google/api/metric.proto"
261+ "google/api/monitored_resource.proto"
262+ "google/api/monitoring.proto"
263+ "google/api/quota.proto"
264+ "google/api/service.proto"
265+ "google/api/usage.proto"
266+ "google/rpc/status.proto" )
267+
268+ # For some directories *most* (but not all) the proto files are simple enough
269+ # that the libraries can be generated with a foreach() loop.
270+ foreach (proto IN LISTS EXTERNAL_GOOGLEAPIS_PROTO_FILES)
271+ if (proto MATCHES "^google/api/"
272+ OR proto MATCHES "^google/type"
273+ OR proto MATCHES "^google/rpc/" )
274+ external_googleapis_short_name(short_name "${proto} " )
275+ list (APPEND external_googleapis_installed_libraries_list
276+ google_cloud_cpp_${short_name} )
277+ list (FIND PROTO_FILES_WITH_DEPENDENCIES "${proto} " has_dependency)
278+ if (has_dependency EQUAL -1)
279+ external_googleapis_add_library("${proto} " )
280+ endif ()
281+ endif ()
282+ endforeach ()
288283
289284# Out of order because they have dependencies.
290285external_googleapis_add_library("google/api/annotations.proto" api_http_protos)
291286external_googleapis_add_library("google/api/auth.proto" api_annotations_protos)
292287external_googleapis_add_library("google/api/metric.proto"
293288 api_launch_stage_protos api_label_protos)
289+ external_googleapis_add_library("google/api/billing.proto"
290+ api_annotations_protos api_metric_protos)
291+ external_googleapis_add_library("google/api/distribution.proto"
292+ api_annotations_protos)
293+ external_googleapis_add_library("google/api/endpoint.proto"
294+ api_annotations_protos)
295+ external_googleapis_add_library("google/api/log.proto" api_label_protos)
296+ external_googleapis_add_library("google/api/logging.proto"
297+ api_annotations_protos api_label_protos)
294298external_googleapis_add_library("google/api/monitored_resource.proto"
295299 api_launch_stage_protos api_label_protos)
300+ external_googleapis_add_library("google/api/monitoring.proto"
301+ api_annotations_protos)
302+ external_googleapis_add_library("google/api/quota.proto" api_annotations_protos)
303+ external_googleapis_add_library("google/api/usage.proto" api_annotations_protos
304+ api_visibility_protos)
305+ external_googleapis_add_library(
306+ "google/api/service.proto"
307+ api_annotations_protos
308+ api_auth_protos
309+ api_backend_protos
310+ api_billing_protos
311+ api_context_protos
312+ api_control_protos
313+ api_documentation_protos
314+ api_endpoint_protos
315+ api_http_protos
316+ api_label_protos
317+ api_log_protos
318+ api_logging_protos
319+ api_metric_protos
320+ api_monitored_resource_protos
321+ api_monitoring_protos
322+ api_quota_protos
323+ api_resource_protos
324+ api_source_info_protos
325+ api_system_parameter_protos
326+ api_usage_protos)
327+
296328external_googleapis_add_library("google/iam/v1/options.proto"
297329 api_annotations_protos)
298330external_googleapis_add_library("google/iam/v1/policy.proto"
0 commit comments