|
17 | 17 | find_package(google_cloud_cpp_common CONFIG REQUIRED) |
18 | 18 | find_package(google_cloud_cpp_grpc_utils CONFIG REQUIRED) |
19 | 19 |
|
20 | | -include(EnableClangTidy) |
21 | | -include(EnableWerror) |
22 | 20 | set(DOXYGEN_PROJECT_NAME "Google Cloud Spanner C++ Client") |
23 | 21 | set(DOXYGEN_PROJECT_BRIEF "A C++ Client Library for Google Cloud Spanner") |
24 | | -set(DOXYGEN_PROJECT_NUMBER "${SPANNER_CLIENT_VERSION}") |
| 22 | +set(DOXYGEN_PROJECT_NUMBER "${GOOGLE_CLOUD_CPP_CLIENT_VERSION}") |
25 | 23 | set(DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/samples |
26 | 24 | ${CMAKE_CURRENT_SOURCE_DIR}/../../../quickstart) |
27 | | -include(EnableDoxygen) |
| 25 | +set(DOXYGEN_EXCLUDE_SYMBOLS "internal" "spanner_testing") |
| 26 | +set(DOXYGEN_PREDEFINED "SPANNER_CLIENT_NS=v${GOOGLE_CLOUD_CPP_VERSION_MAJOR}") |
| 27 | +set(DOXYGEN_EXCLUDE_PATTERNS |
| 28 | + "*/google/cloud/spanner/README.md" "*/google/cloud/spanner/internal/*" |
| 29 | + "*/google/cloud/spanner/benchmarks/*" "*/google/cloud/spanner/testing/*" |
| 30 | + "*/google/cloud/spanner/*_test.cc") |
| 31 | + |
| 32 | +include(GoogleCloudCppCommon) |
28 | 33 |
|
29 | 34 | # Define a function to fetch the current git revision. Using a function creates |
30 | 35 | # a new scope, so the CMake variables do not leak to the global namespace. |
@@ -224,10 +229,10 @@ target_link_libraries( |
224 | 229 | spanner_client PUBLIC google_cloud_cpp_grpc_utils google_cloud_cpp_common |
225 | 230 | googleapis-c++::spanner_protos) |
226 | 231 | set_target_properties( |
227 | | - spanner_client PROPERTIES VERSION "${SPANNER_CLIENT_VERSION}" |
228 | | - SOVERSION "${SPANNER_CLIENT_VERSION_MAJOR}") |
| 232 | + spanner_client PROPERTIES VERSION "${GOOGLE_CLOUD_CPP_VERSION}" |
| 233 | + SOVERSION "${GOOGLE_CLOUD_CPP_VERSION_MAJOR}") |
229 | 234 | target_compile_options(spanner_client |
230 | | - PUBLIC ${GOOGLE_CLOUD_CPP_SPANNER_EXCEPTIONS_FLAG}) |
| 235 | + PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) |
231 | 236 |
|
232 | 237 | google_cloud_cpp_add_clang_tidy(spanner_client) |
233 | 238 | google_cloud_cpp_add_common_options(spanner_client) |
@@ -260,7 +265,7 @@ target_include_directories( |
260 | 265 | $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}> |
261 | 266 | $<INSTALL_INTERFACE:include>) |
262 | 267 | target_compile_options(spanner_client_mocks |
263 | | - INTERFACE ${GOOGLE_CLOUD_CPP_SPANNER_EXCEPTIONS_FLAG}) |
| 268 | + INTERFACE ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) |
264 | 269 |
|
265 | 270 | # Define the tests in a function so we have a new scope for variable names. |
266 | 271 | function (spanner_client_define_tests) |
@@ -311,7 +316,7 @@ function (spanner_client_define_tests) |
311 | 316 | $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}> |
312 | 317 | $<INSTALL_INTERFACE:include>) |
313 | 318 | target_compile_options(spanner_client_testing |
314 | | - PUBLIC ${GOOGLE_CLOUD_CPP_SPANNER_EXCEPTIONS_FLAG}) |
| 319 | + PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) |
315 | 320 |
|
316 | 321 | set(spanner_client_unit_tests |
317 | 322 | # cmake-format: sortable |
@@ -454,12 +459,9 @@ add_subdirectory(benchmarks) # macro benchmarks |
454 | 459 |
|
455 | 460 | # Only compile the samples if we're building with exceptions enabled. They |
456 | 461 | # require exceptions to keep them simple and idiomatic. |
457 | | -if (GOOGLE_CLOUD_CPP_SPANNER_ENABLE_CXX_EXCEPTIONS) |
| 462 | +if (GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) |
458 | 463 | add_subdirectory(samples) |
459 | | -endif (GOOGLE_CLOUD_CPP_SPANNER_ENABLE_CXX_EXCEPTIONS) |
460 | | - |
461 | | -# Get the destination directories based on the GNU recommendations. |
462 | | -include(GNUInstallDirs) |
| 464 | +endif (GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) |
463 | 465 |
|
464 | 466 | # Export the CMake targets to make it easy to create configuration files. |
465 | 467 | install(EXPORT spanner-targets |
@@ -493,15 +495,15 @@ google_cloud_cpp_install_headers("spanner_client_mocks" |
493 | 495 | "include/google/cloud/spanner") |
494 | 496 |
|
495 | 497 | # Setup global variables used in the following *.in files. |
496 | | -set(GOOGLE_CLOUD_SPANNER_CONFIG_VERSION_MAJOR ${SPANNER_CLIENT_VERSION_MAJOR}) |
497 | | -set(GOOGLE_CLOUD_SPANNER_CONFIG_VERSION_MINOR ${SPANNER_CLIENT_VERSION_MINOR}) |
498 | | -set(GOOGLE_CLOUD_SPANNER_CONFIG_VERSION_PATCH ${SPANNER_CLIENT_VERSION_PATCH}) |
499 | | -set(GOOGLE_CLOUD_SPANNER_PC_NAME "The Google Cloud Spanner C++ Client Library") |
500 | | -set(GOOGLE_CLOUD_SPANNER_PC_DESCRIPTION |
| 498 | +set(GOOGLE_CLOUD_CPP_CONFIG_VERSION_MAJOR ${GOOGLE_CLOUD_CPP_VERSION_MAJOR}) |
| 499 | +set(GOOGLE_CLOUD_CPP_CONFIG_VERSION_MINOR ${GOOGLE_CLOUD_CPP_VERSION_MINOR}) |
| 500 | +set(GOOGLE_CLOUD_CPP_CONFIG_VERSION_PATCH ${GOOGLE_CLOUD_CPP_VERSION_PATCH}) |
| 501 | +set(GOOGLE_CLOUD_CPP_PC_NAME "The Google Cloud Spanner C++ Client Library") |
| 502 | +set(GOOGLE_CLOUD_CPP_PC_DESCRIPTION |
501 | 503 | "Provides C++ APIs to access Google Cloud Spanner.") |
502 | | -set(GOOGLE_CLOUD_SPANNER_PC_REQUIRES |
| 504 | +set(GOOGLE_CLOUD_CPP_PC_REQUIRES |
503 | 505 | "google_cloud_cpp_grpc_utils google_cloud_cpp_common") |
504 | | -set(GOOGLE_CLOUD_SPANNER_PC_LIBS "-lspanner_client") |
| 506 | +set(GOOGLE_CLOUD_CPP_PC_LIBS "-lspanner_client") |
505 | 507 |
|
506 | 508 | # Create and install the pkg-config files. |
507 | 509 | configure_file("${PROJECT_SOURCE_DIR}/google/cloud/spanner/config.pc.in" |
|
0 commit comments