@@ -18,10 +18,22 @@ include(GoogleapisConfig)
1818set (DOXYGEN_PROJECT_NAME "Artifact Registry API C++ Client" )
1919set (DOXYGEN_PROJECT_BRIEF "A C++ Client Library for the Artifact Registry API" )
2020set (DOXYGEN_PROJECT_NUMBER "${PROJECT_VERSION} " )
21- set (DOXYGEN_EXCLUDE_SYMBOLS "internal" "artifactregistry_internal"
22- "artifactregistry_testing" "examples" )
23- set (DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /samples
24- ${CMAKE_CURRENT_SOURCE_DIR} /quickstart)
21+ set (DOXYGEN_EXCLUDE_SYMBOLS "internal" )
22+ set (DOXYGEN_EXAMPLE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /quickstart" )
23+
24+ unset (mocks_globs)
25+ unset (source_globs)
26+ set (service_dirs "" "v1/" )
27+ foreach (dir IN LISTS service_dirs)
28+ string (REPLACE "/" "_" ns "${dir} " )
29+ list (APPEND source_globs "${dir} *.h" "${dir} *.cc" "${dir} internal/*" )
30+ list (APPEND mocks_globs "${dir} mocks/*.h" )
31+ list (APPEND DOXYGEN_EXCLUDE_SYMBOLS "artifactregistry_${ns} internal" )
32+ if (NOT dir STREQUAL "" )
33+ list (APPEND DOXYGEN_EXAMPLE_PATH
34+ "${CMAKE_CURRENT_SOURCE_DIR} /${dir} samples" )
35+ endif ()
36+ endforeach ()
2537
2638include (GoogleCloudCppDoxygen )
2739google_cloud_cpp_doxygen_targets ("artifactregistry" DEPENDS cloud-docs
@@ -49,7 +61,7 @@ target_link_libraries(google_cloud_cpp_artifactregistry_protos
4961file (
5062 GLOB source_files
5163 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
52- "*.h" "*.cc" "internal/*.h" "internal/*.cc" )
64+ ${source_globs} )
5365list (SORT source_files)
5466add_library (google_cloud_cpp_artifactregistry ${source_files} )
5567target_include_directories (
@@ -80,7 +92,7 @@ add_library(google-cloud-cpp::artifactregistry ALIAS
8092file (
8193 GLOB relative_mock_files
8294 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
83- "mocks/*.h" )
95+ ${mocks_globs} )
8496list (SORT relative_mock_files)
8597set (mock_files)
8698foreach (file IN LISTS relative_mock_files)
@@ -188,3 +200,12 @@ install(
188200 COMPONENT google_cloud_cpp_development)
189201
190202external_googleapis_install_pc ("google_cloud_cpp_artifactregistry_protos" )
203+
204+ # google-cloud-cpp::artifactregistry must be defined before we can add the
205+ # samples.
206+ foreach (dir IN LISTS service_dirs)
207+ if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
208+ google_cloud_cpp_add_samples_relative ("artifactregistry"
209+ "${dir} samples/" )
210+ endif ()
211+ endforeach ()
0 commit comments