@@ -31,10 +31,22 @@ include(GoogleapisConfig)
3131set (DOXYGEN_PROJECT_NAME "Cloud Channel API C++ Client" )
3232set (DOXYGEN_PROJECT_BRIEF "A C++ Client Library for the Cloud Channel API" )
3333set (DOXYGEN_PROJECT_NUMBER "${PROJECT_VERSION} " )
34- set (DOXYGEN_EXCLUDE_SYMBOLS "internal" "channel_internal" "channel_testing"
35- "examples" )
36- set (DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /samples
37- ${CMAKE_CURRENT_SOURCE_DIR} /quickstart)
34+ set (DOXYGEN_EXCLUDE_SYMBOLS "internal" )
35+ set (DOXYGEN_EXAMPLE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /quickstart" )
36+
37+ unset (mocks_globs)
38+ unset (source_globs)
39+ set (service_dirs "" "v1/" )
40+ foreach (dir IN LISTS service_dirs)
41+ string (REPLACE "/" "_" ns "${dir} " )
42+ list (APPEND source_globs "${dir} *.h" "${dir} *.cc" "${dir} internal/*" )
43+ list (APPEND mocks_globs "${dir} mocks/*.h" )
44+ list (APPEND DOXYGEN_EXCLUDE_SYMBOLS "channel_${ns} internal" )
45+ if (NOT dir STREQUAL "" )
46+ list (APPEND DOXYGEN_EXAMPLE_PATH
47+ "${CMAKE_CURRENT_SOURCE_DIR} /${dir} samples" )
48+ endif ()
49+ endforeach ()
3850
3951include (GoogleCloudCppDoxygen )
4052google_cloud_cpp_doxygen_targets ("channel" DEPENDS cloud-docs
@@ -60,7 +72,7 @@ target_link_libraries(google_cloud_cpp_channel_protos PUBLIC ${proto_deps})
6072file (
6173 GLOB source_files
6274 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
63- "*.h" "*.cc" "internal/*.h" "internal/*.cc" )
75+ ${source_globs} )
6476list (SORT source_files)
6577add_library (google_cloud_cpp_channel ${source_files} )
6678target_include_directories (
@@ -90,7 +102,7 @@ add_library(google-cloud-cpp::channel ALIAS google_cloud_cpp_channel)
90102file (
91103 GLOB relative_mock_files
92104 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
93- "mocks/*.h" )
105+ ${mocks_globs} )
94106list (SORT relative_mock_files)
95107set (mock_files)
96108foreach (file IN LISTS relative_mock_files)
@@ -176,3 +188,10 @@ install(
176188 COMPONENT google_cloud_cpp_development)
177189
178190external_googleapis_install_pc ("google_cloud_cpp_channel_protos" )
191+
192+ # google-cloud-cpp::channel must be defined before we can add the samples.
193+ foreach (dir IN LISTS service_dirs)
194+ if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
195+ google_cloud_cpp_add_samples_relative ("channel" "${dir} samples/" )
196+ endif ()
197+ endforeach ()
0 commit comments