@@ -62,6 +62,41 @@ if (BUILD_TESTING OR GOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL)
6262 add_test (NAME ${target} COMMAND ${target} )
6363 endforeach ()
6464
65+ find_package (googleapis)
66+ add_library (google_cloud_cpp_testing_grpc is_proto_equal.cc
67+ is_proto_equal.h)
68+ target_link_libraries (
69+ google_cloud_cpp_testing_grpc
70+ PUBLIC google_cloud_cpp_common protobuf::libprotobuf GTest::gmock
71+ PRIVATE google_cloud_cpp_common_options)
72+
73+ create_bazel_config(google_cloud_cpp_testing_grpc YEAR 2020)
74+
75+ set (google_cloud_cpp_testing_grpc_unit_tests is_proto_equal_test.cc)
76+
77+ export_list_to_bazel("google_cloud_cpp_testing_grpc_unit_tests.bzl"
78+ "google_cloud_cpp_testing_grpc_unit_tests" YEAR 2020)
79+
80+ foreach (fname ${google_cloud_cpp_testing_grpc_unit_tests} )
81+ string (REPLACE "/" "_" target ${fname} )
82+ string (REPLACE ".cc" "" target ${target} )
83+ add_executable (${target} ${fname} )
84+ target_link_libraries (
85+ ${target}
86+ PRIVATE google_cloud_cpp_testing_grpc
87+ google_cloud_cpp_testing
88+ google_cloud_cpp_common
89+ protobuf::libprotobuf
90+ GTest::gmock_main
91+ GTest::gmock
92+ GTest::gtest
93+ google_cloud_cpp_common_options)
94+ if (MSVC )
95+ target_compile_options (${target} PRIVATE "/bigobj" )
96+ endif ()
97+ add_test (NAME ${target} COMMAND ${target} )
98+ endforeach ()
99+
65100 # Export the CMake targets to make it easy to create configuration files.
66101 install (
67102 EXPORT google_cloud_cpp_testing-targets
@@ -70,7 +105,7 @@ if (BUILD_TESTING OR GOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL)
70105 # Install the libraries and headers in the locations determined by
71106 # GNUInstallDirs
72107 install (
73- TARGETS google_cloud_cpp_testing
108+ TARGETS google_cloud_cpp_testing google_cloud_cpp_testing_grpc
74109 EXPORT google_cloud_cpp_testing-targets
75110 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
76111 COMPONENT google_cloud_cpp_runtime
@@ -82,7 +117,7 @@ if (BUILD_TESTING OR GOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL)
82117 # With CMake-3.12 and higher we could avoid this separate command (and the
83118 # duplication).
84119 install (
85- TARGETS google_cloud_cpp_testing
120+ TARGETS google_cloud_cpp_testing google_cloud_cpp_testing_grpc
86121 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
87122 COMPONENT google_cloud_cpp_development
88123 NAMELINK_ONLY
@@ -100,13 +135,22 @@ if (BUILD_TESTING OR GOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL)
100135 "Google Cloud C++ Client Library Testing Utilities" )
101136 set (GOOGLE_CLOUD_CPP_PC_DESCRIPTION
102137 "Testing Utilities used by the Google Cloud C++ Client Libraries." )
103- set (GOOGLE_CLOUD_CPP_PC_LIBS "-lgoogle_cloud_cpp_testing" )
104138
105- # Create and install the pkg-config files.
139+ # Create and install the pkg-config files. First for testing_utils:
140+ set (GOOGLE_CLOUD_CPP_PC_LIBS "-lgoogle_cloud_cpp_testing" )
141+ set (GOOGLE_CLOUD_CPP_PC_REQUIRES "google_cloud_cpp_common" )
106142 configure_file ("${PROJECT_SOURCE_DIR} /google/cloud/config.pc.in"
107143 "google_cloud_cpp_testing.pc" @ONLY)
108144 install (FILES "${CMAKE_CURRENT_BINARY_DIR} /google_cloud_cpp_testing.pc"
109145 DESTINATION "${CMAKE_INSTALL_LIBDIR} /pkgconfig" )
146+ # Then for testing_utils_grpc:
147+ set (GOOGLE_CLOUD_CPP_PC_LIBS "-lgoogle_cloud_cpp_testing_grpc" )
148+ set (GOOGLE_CLOUD_CPP_PC_REQUIRES
149+ "google_cloud_cpp_testing google_cloud_cpp_common" )
150+ configure_file ("${PROJECT_SOURCE_DIR} /google/cloud/config.pc.in"
151+ "google_cloud_cpp_testing_grpc.pc" @ONLY)
152+ install (FILES "${CMAKE_CURRENT_BINARY_DIR} /google_cloud_cpp_testing_grpc.pc"
153+ DESTINATION "${CMAKE_INSTALL_LIBDIR} /pkgconfig" )
110154
111155 # Create and install the CMake configuration files.
112156 configure_file ("config.cmake.in" "google_cloud_cpp_testing-config.cmake"
0 commit comments