[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(advisorynotifications): generate library #10814

Merged
merged 10 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ may elicit a deprecation warning. See [#9086] for more details.

## v2.8.0 - TBD

### New Libraries

We are happy to announce the following GA libraries. Unless specifically noted,
the APIs in these libraries are stable, and are ready for production use.

- [Advisory Notifications](/google/cloud/advisorynotifications/README.md)

### [TPU](/google/cloud/tpu/README.md)

The library has been expanded to include the TPU v2 API.
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ See each library's `README.md` file for more information about:
- [Access Context Manager API](google/cloud/accesscontextmanager/README.md)
[\[quickstart\]](google/cloud/accesscontextmanager/quickstart/README.md)
[\[reference\]](https://googleapis.dev/cpp/google-cloud-accesscontextmanager/latest)
- [Advisory Notifications API](google/cloud/advisorynotifications/README.md)
[\[quickstart\]](google/cloud/advisorynotifications/quickstart/README.md)
[\[reference\]](https://googleapis.dev/cpp/google-cloud-advisorynotifications/latest)
- [API Gateway API](google/cloud/apigateway/README.md)
[\[quickstart\]](google/cloud/apigateway/quickstart/README.md)
[\[reference\]](https://googleapis.dev/cpp/google-cloud-apigateway/latest)
Expand Down
Binary file modified ci/abi-dumps/google_cloud_cpp_accessapproval.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_apigateway.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_appengine.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_asset.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_automl.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_batch.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_bigquery.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_bigtable.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_billing.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_channel.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_cloudbuild.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_common.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_composer.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_connectors.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_container.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_dataplex.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_dataproc.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_debugger.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_deploy.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_dlp.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_eventarc.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_filestore.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_functions.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_gkehub.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_grpc_utils.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_iam.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_iap.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_ids.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_iot.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_kms.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_language.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_logging.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_memcache.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_notebooks.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_optimization.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_orgpolicy.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_osconfig.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_oslogin.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_privateca.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_profiler.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_pubsub.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_recommender.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_redis.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_retail.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_run.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_scheduler.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_serviceusage.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_shell.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_spanner.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_speech.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_storage.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_talent.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_tasks.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_texttospeech.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_tpu.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_trace.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_translate.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_video.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_vision.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_vmmigration.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_vpcaccess.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_webrisk.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_workflows.expected.abi.dump.gz
Binary file not shown.
1 change: 1 addition & 0 deletions ci/cloudbuild/builds/lib/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function integration::bazel_args() {
"--test_env=GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT}"
"--test_env=GOOGLE_CLOUD_CPP_TEST_REGION=${GOOGLE_CLOUD_CPP_TEST_REGION}"
"--test_env=GOOGLE_CLOUD_CPP_TEST_ZONE=${GOOGLE_CLOUD_CPP_TEST_ZONE}"
"--test_env=GOOGLE_CLOUD_CPP_TEST_ORGANIZATION=${GOOGLE_CLOUD_CPP_TEST_ORGANIZATION}"
"--test_env=GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE=${GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE}"
"--test_env=GOOGLE_CLOUD_CPP_AUTO_RUN_EXAMPLES=${GOOGLE_CLOUD_CPP_AUTO_RUN_EXAMPLES}"
"--test_env=GOOGLE_CLOUD_CPP_EXPERIMENTAL_LOG_CONFIG=${GOOGLE_CLOUD_CPP_EXPERIMENTAL_LOG_CONFIG}"
Expand Down
5 changes: 5 additions & 0 deletions ci/etc/expected_install_directories
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
./include/google/cloud/accesscontextmanager
./include/google/cloud/accesscontextmanager/internal
./include/google/cloud/accesscontextmanager/mocks
./include/google/cloud/advisorynotifications
./include/google/cloud/advisorynotifications/v1
./include/google/cloud/advisorynotifications/v1/internal
./include/google/cloud/advisorynotifications/v1/mocks
./include/google/cloud/apigateway
./include/google/cloud/apigateway/internal
./include/google/cloud/apigateway/mocks
Expand Down Expand Up @@ -497,6 +501,7 @@
./lib64/cmake
./lib64/cmake/google_cloud_cpp_accessapproval
./lib64/cmake/google_cloud_cpp_accesscontextmanager
./lib64/cmake/google_cloud_cpp_advisorynotifications
./lib64/cmake/google_cloud_cpp_apigateway
./lib64/cmake/google_cloud_cpp_apigeeconnect
./lib64/cmake/google_cloud_cpp_apikeys
Expand Down
1 change: 1 addition & 0 deletions ci/etc/full_feature_list
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
accessapproval
accesscontextmanager
advisorynotifications
apigateway
apigeeconnect
apikeys
Expand Down
2 changes: 2 additions & 0 deletions ci/etc/integration-tests-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export GOOGLE_CLOUD_CPP_USER_PROJECT="${GOOGLE_CLOUD_PROJECT}"
export GOOGLE_CLOUD_CPP_TEST_REGION="us-central1"
# Some quickstart programs require a zone.
export GOOGLE_CLOUD_CPP_TEST_ZONE="us-central1-a"
# Some quickstart programs require an organization.
export GOOGLE_CLOUD_CPP_TEST_ORGANIZATION="1006341795026"

# This file contains an invalidated service account key. That is, the file is
# in the right format for a service account, but it is not associated with a
Expand Down
1 change: 1 addition & 0 deletions cmake/GoogleCloudCppFeatures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set(GOOGLE_CLOUD_CPP_GA_LIBRARIES
# cmake-format: sorted
"accessapproval"
"accesscontextmanager"
"advisorynotifications"
"apigateway"
"apigeeconnect"
"appengine"
Expand Down
6 changes: 6 additions & 0 deletions external/googleapis/protodeps/advisorynotifications.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@com_google_googleapis//google/api:annotations_proto
@com_google_googleapis//google/api:client_proto
@com_google_googleapis//google/api:field_behavior_proto
@com_google_googleapis//google/api:http_proto
@com_google_googleapis//google/api:launch_stage_proto
@com_google_googleapis//google/api:resource_proto
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@com_google_googleapis//google/cloud/advisorynotifications/v1:service.proto
1 change: 1 addition & 0 deletions external/googleapis/update_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare -A -r LIBRARIES=(
"@com_google_googleapis//google/identity/accesscontextmanager/type:type_cc_grpc" \
"@com_google_googleapis//google/identity/accesscontextmanager/v1:accesscontextmanager_cc_grpc"
)"
["advisorynotifications"]="@com_google_googleapis//google/cloud/advisorynotifications/v1:advisorynotifications_cc_grpc"
["apigateway"]="@com_google_googleapis//google/cloud/apigateway/v1:apigateway_cc_grpc"
["apigeeconnect"]="@com_google_googleapis//google/cloud/apigeeconnect/v1:apigeeconnect_cc_grpc"
["apikeys"]="@com_google_googleapis//google/api/apikeys/v2:apikeys_cc_grpc"
Expand Down
8 changes: 8 additions & 0 deletions generator/generator_config.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ service {
retryable_status_codes: ["kUnavailable"]
}

# Advisory Notifications
service {
service_proto_path: "google/cloud/advisorynotifications/v1/service.proto"
product_path: "google/cloud/advisorynotifications/v1"
initial_copyright_year: "2023"
retryable_status_codes: ["kUnavailable"]
}

# API Gateway
service {
service_proto_path: "google/cloud/apigateway/v1/apigateway_service.proto"
Expand Down
68 changes: 68 additions & 0 deletions google/cloud/advisorynotifications/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(default_visibility = ["//visibility:private"])

licenses(["notice"]) # Apache 2.0

service_dirs = ["v1/"]

src_dirs = service_dirs + [d + "internal/" for d in service_dirs]

filegroup(
name = "srcs",
srcs = glob([d + "*.cc" for d in src_dirs]),
)

filegroup(
name = "hdrs",
srcs = glob([d + "*.h" for d in src_dirs]),
)

filegroup(
name = "mocks",
srcs = glob([d + "mocks/*.h" for d in service_dirs]),
)

cc_library(
name = "google_cloud_cpp_advisorynotifications",
srcs = [":srcs"],
hdrs = [":hdrs"],
visibility = ["//:__pkg__"],
deps = [
"//:common",
"//:grpc_utils",
"@com_google_googleapis//google/cloud/advisorynotifications/v1:advisorynotifications_cc_grpc",
],
)

cc_library(
name = "google_cloud_cpp_advisorynotifications_mocks",
hdrs = [":mocks"],
visibility = ["//:__pkg__"],
deps = [
":google_cloud_cpp_advisorynotifications",
"@com_google_googletest//:gtest",
],
)

[cc_test(
name = sample.replace("/", "_").replace(".cc", ""),
srcs = [sample],
tags = ["integration-test"],
deps = [
"//:advisorynotifications",
"//google/cloud/testing_util:google_cloud_cpp_testing_private",
],
) for sample in glob([d + "samples/*.cc" for d in service_dirs])]
213 changes: 213 additions & 0 deletions google/cloud/advisorynotifications/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
# ~~~
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ~~~

include(GoogleapisConfig)
set(DOXYGEN_PROJECT_NAME "Advisory Notifications API C++ Client")
set(DOXYGEN_PROJECT_BRIEF
"A C++ Client Library for the Advisory Notifications API")
set(DOXYGEN_PROJECT_NUMBER "${PROJECT_VERSION}")
set(DOXYGEN_EXCLUDE_SYMBOLS "internal")
set(DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/quickstart)

unset(mocks_globs)
unset(source_globs)
set(service_dirs "v1/")
foreach (dir IN LISTS service_dirs)
string(REPLACE "/" "_" ns "${dir}")
list(APPEND source_globs "${dir}*.h" "${dir}*.cc" "${dir}internal/*")
list(APPEND mocks_globs "${dir}mocks/*.h")
list(APPEND DOXYGEN_EXAMPLE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/${dir}samples")
list(APPEND DOXYGEN_EXCLUDE_SYMBOLS "advisorynotifications_${ns}internal")
endforeach ()

include(GoogleCloudCppDoxygen)
google_cloud_cpp_doxygen_targets("advisorynotifications" DEPENDS cloud-docs
google-cloud-cpp::advisorynotifications_protos)
coryan marked this conversation as resolved.
Show resolved Hide resolved

include(GoogleCloudCppCommon)

include(CompileProtos)
google_cloud_cpp_find_proto_include_dir(PROTO_INCLUDE_DIR)
google_cloud_cpp_load_protolist(
proto_list
"${PROJECT_SOURCE_DIR}/external/googleapis/protolists/advisorynotifications.list"
)
google_cloud_cpp_load_protodeps(
proto_deps
"${PROJECT_SOURCE_DIR}/external/googleapis/protodeps/advisorynotifications.deps"
)
google_cloud_cpp_grpcpp_library(
google_cloud_cpp_advisorynotifications_protos # cmake-format: sort
${proto_list} PROTO_PATH_DIRECTORIES "${EXTERNAL_GOOGLEAPIS_SOURCE}"
"${PROTO_INCLUDE_DIR}")
external_googleapis_set_version_and_alias(advisorynotifications_protos)
target_link_libraries(google_cloud_cpp_advisorynotifications_protos
PUBLIC ${proto_deps})

file(
GLOB source_files
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
${source_globs})
list(SORT source_files)
add_library(google_cloud_cpp_advisorynotifications ${source_files})
target_include_directories(
google_cloud_cpp_advisorynotifications
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>)
target_link_libraries(
google_cloud_cpp_advisorynotifications
PUBLIC google-cloud-cpp::grpc_utils google-cloud-cpp::common
google-cloud-cpp::advisorynotifications_protos)
google_cloud_cpp_add_common_options(google_cloud_cpp_advisorynotifications)
set_target_properties(
google_cloud_cpp_advisorynotifications
PROPERTIES EXPORT_NAME google-cloud-cpp::advisorynotifications
VERSION "${PROJECT_VERSION}"
SOVERSION "${PROJECT_VERSION_MAJOR}")
target_compile_options(google_cloud_cpp_advisorynotifications
PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})

add_library(google-cloud-cpp::advisorynotifications ALIAS
google_cloud_cpp_advisorynotifications)

# Create a header-only library for the mocks. We use a CMake `INTERFACE` library
# for these, a regular library would not work on macOS (where the library needs
# at least one .o file). Unfortunately INTERFACE libraries are a bit weird in
# that they need absolute paths for their sources.
file(
GLOB relative_mock_files
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
${mocks_globs})
list(SORT relative_mock_files)
set(mock_files)
foreach (file IN LISTS relative_mock_files)
list(APPEND mock_files "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
endforeach ()
add_library(google_cloud_cpp_advisorynotifications_mocks INTERFACE)
target_sources(google_cloud_cpp_advisorynotifications_mocks
INTERFACE ${mock_files})
target_link_libraries(
google_cloud_cpp_advisorynotifications_mocks
INTERFACE google-cloud-cpp::advisorynotifications GTest::gmock_main
GTest::gmock GTest::gtest)
set_target_properties(
google_cloud_cpp_advisorynotifications_mocks
PROPERTIES EXPORT_NAME google-cloud-cpp::advisorynotifications_mocks)
target_include_directories(
google_cloud_cpp_advisorynotifications_mocks
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>)
target_compile_options(google_cloud_cpp_advisorynotifications_mocks
INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})

include(CTest)
if (BUILD_TESTING)
add_executable(advisorynotifications_quickstart "quickstart/quickstart.cc")
target_link_libraries(advisorynotifications_quickstart
PRIVATE google-cloud-cpp::advisorynotifications)
google_cloud_cpp_add_common_options(advisorynotifications_quickstart)
add_test(
NAME advisorynotifications_quickstart
COMMAND
cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake"
$<TARGET_FILE:advisorynotifications_quickstart>
GOOGLE_CLOUD_CPP_TEST_ORGANIZATION GOOGLE_CLOUD_CPP_TEST_REGION)
set_tests_properties(advisorynotifications_quickstart
PROPERTIES LABELS "integration-test;quickstart")
endif ()

# Get the destination directories based on the GNU recommendations.
include(GNUInstallDirs)

# Export the CMake targets to make it easy to create configuration files.
install(
EXPORT google_cloud_cpp_advisorynotifications-targets
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_advisorynotifications"
COMPONENT google_cloud_cpp_development)

# Install the libraries and headers in the locations determined by
# GNUInstallDirs
install(
TARGETS google_cloud_cpp_advisorynotifications
google_cloud_cpp_advisorynotifications_protos
EXPORT google_cloud_cpp_advisorynotifications-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT google_cloud_cpp_runtime
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT google_cloud_cpp_runtime
NAMELINK_SKIP
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT google_cloud_cpp_development)
# With CMake-3.12 and higher we could avoid this separate command (and the
# duplication).
install(
TARGETS google_cloud_cpp_advisorynotifications
google_cloud_cpp_advisorynotifications_protos
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT google_cloud_cpp_development
NAMELINK_ONLY
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT google_cloud_cpp_development)

google_cloud_cpp_install_proto_library_protos(
"google_cloud_cpp_advisorynotifications_protos"
"${EXTERNAL_GOOGLEAPIS_SOURCE}")
google_cloud_cpp_install_proto_library_headers(
"google_cloud_cpp_advisorynotifications_protos")
google_cloud_cpp_install_headers("google_cloud_cpp_advisorynotifications"
"include/google/cloud/advisorynotifications")
google_cloud_cpp_install_headers("google_cloud_cpp_advisorynotifications_mocks"
"include/google/cloud/advisorynotifications")

google_cloud_cpp_add_pkgconfig(
advisorynotifications
"The Advisory Notifications API C++ Client Library"
"Provides C++ APIs to use the Advisory Notifications API."
"google_cloud_cpp_grpc_utils"
" google_cloud_cpp_common"
" google_cloud_cpp_advisorynotifications_protos")

# Create and install the CMake configuration files.
include(CMakePackageConfigHelpers)
configure_file("config.cmake.in"
"google_cloud_cpp_advisorynotifications-config.cmake" @ONLY)
write_basic_package_version_file(
"google_cloud_cpp_advisorynotifications-config-version.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY ExactVersion)

install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_advisorynotifications-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_advisorynotifications-config-version.cmake"
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_advisorynotifications"
COMPONENT google_cloud_cpp_development)

external_googleapis_install_pc("google_cloud_cpp_advisorynotifications_protos")

# google-cloud-cpp::advisorynotifications must be defined before we can add the
# samples.
foreach (dir IN LISTS service_dirs)
if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
google_cloud_cpp_add_samples_relative("advisorynotifications"
"${dir}samples/")
endif ()
endforeach ()
Loading