Skip to content

Commit

Permalink
address some review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolduc committed Oct 27, 2022
1 parent 0b93df5 commit dcab21d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
1 change: 0 additions & 1 deletion ci/cloudbuild/builds/cmake-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ expected_dirs+=(
./lib64/cmake/google_cloud_cpp_googleapis
./lib64/cmake/google_cloud_cpp_grafeas
./lib64/cmake/google_cloud_cpp_grpc_utils
./lib64/cmake/google_cloud_cpp_pubsub
./lib64/cmake/google_cloud_cpp_pubsub_mocks
./lib64/cmake/google_cloud_cpp_rest_internal
./lib64/cmake/google_cloud_cpp_rest_protobuf_internal
Expand Down
1 change: 1 addition & 0 deletions ci/verify_current_targets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(ga_libraries
iam
logging
pubsub
pubsub_mocks
spanner
storage)

Expand Down
33 changes: 29 additions & 4 deletions cmake/AddPkgConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ macro (google_cloud_cpp_set_pkgconfig_paths)
endmacro ()

#
# Create the pkgconfig configuration file (aka *.pc file) and the rules to
# install it.
# Implementation to create the pkgconfig configuration file (aka *.pc file) and
# the rules to install it.
#
# * library: the name of the library, such as `storage`, or `spanner`
# * ARGN: the names of any pkgconfig modules the generated module depends on
#
function (google_cloud_cpp_add_pkgconfig library name description)
function (google_cloud_cpp_add_pkgconfig_impl library name description pc_libs)
set(GOOGLE_CLOUD_CPP_PC_NAME "${name}")
set(GOOGLE_CLOUD_CPP_PC_DESCRIPTION "${description}")
set(GOOGLE_CLOUD_CPP_PC_LIBS "-lgoogle_cloud_cpp_${library}")
set(GOOGLE_CLOUD_CPP_PC_LIBS "${pc_libs}")
string(CONCAT GOOGLE_CLOUD_CPP_PC_REQUIRES ${ARGN})
google_cloud_cpp_set_pkgconfig_paths()

Expand All @@ -56,3 +56,28 @@ function (google_cloud_cpp_add_pkgconfig library name description)
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
COMPONENT google_cloud_cpp_development)
endfunction ()

#
# Create the pkgconfig configuration file (aka *.pc file) and the rules to
# install it.
#
# * library: the name of the library, such as `storage`, or `spanner`
# * ARGN: the names of any pkgconfig modules the generated module depends on
#
function (google_cloud_cpp_add_pkgconfig library name description)
google_cloud_cpp_add_pkgconfig_impl("${library}" "${name}" "${description}"
"-lgoogle_cloud_cpp_${library}" ${ARGN})
endfunction ()

#
# Create the pkgconfig configuration file (aka *.pc file) and the rules to
# install it for an interface library. These libraries only contain headers, so
# they do not generate lib files to link against with `-l`.
#
# * library: the name of the library, such as `storage`, or `spanner`
# * ARGN: the names of any pkgconfig modules the generated module depends on
#
function (google_cloud_cpp_add_pkgconfig_interface library name description)
google_cloud_cpp_add_pkgconfig_impl("${library}" "${name}" "${description}"
"" ${ARGN})
endfunction ()
11 changes: 5 additions & 6 deletions google/cloud/pubsub/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,13 @@ install(
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_pubsub"
COMPONENT google_cloud_cpp_development)

google_cloud_cpp_add_pkgconfig(
pubsub_mocks "Mocks for the Google Cloud Pub/Sub C++ Client Library"
"Provides mock classes for the Google Cloud Pub/Sub C++ APIs."
"google_cloud_cpp_pubsub" " gtest")
google_cloud_cpp_add_pkgconfig_interface(
pubsub_mocks "Google Cloud C++ Pub/Sub Mocks"
"Mocks for the Google Cloud Pub/Sub C++ Client Library"
"google_cloud_cpp_pubsub" " gmock_main")

# Create and install the CMake configuration files.
include(CMakePackageConfigHelpers)
configure_file("config-mocks.cmake.in"
configure_file("mocks-config.cmake.in"
"google_cloud_cpp_pubsub_mocks-config.cmake" @ONLY)
write_basic_package_version_file(
"google_cloud_cpp_pubsub_mocks-config-version.cmake"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,6 @@

include(CMakeFindDependencyMacro)
find_dependency(google_cloud_cpp_pubsub)
find_dependency(gtest)
find_dependency(GTest)

include("${CMAKE_CURRENT_LIST_DIR}/pubsub_mocks-targets.cmake")

0 comments on commit dcab21d

Please sign in to comment.