@@ -19,10 +19,22 @@ set(DOXYGEN_PROJECT_NAME "Cloud Natural Language API C++ Client")
1919set (DOXYGEN_PROJECT_BRIEF
2020 "A C++ Client Library for the Cloud Natural Language API" )
2121set (DOXYGEN_PROJECT_NUMBER "${PROJECT_VERSION} " )
22- set (DOXYGEN_EXCLUDE_SYMBOLS "internal" "language_internal" "language_testing"
23- "examples" )
24- set (DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /samples
25- ${CMAKE_CURRENT_SOURCE_DIR} /quickstart)
22+ set (DOXYGEN_EXCLUDE_SYMBOLS "internal" )
23+ set (DOXYGEN_EXAMPLE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /quickstart" )
24+
25+ unset (mocks_globs)
26+ unset (source_globs)
27+ set (service_dirs "" "v1/" )
28+ foreach (dir IN LISTS service_dirs)
29+ string (REPLACE "/" "_" ns "${dir} " )
30+ list (APPEND source_globs "${dir} *.h" "${dir} *.cc" "${dir} internal/*" )
31+ list (APPEND mocks_globs "${dir} mocks/*.h" )
32+ list (APPEND DOXYGEN_EXCLUDE_SYMBOLS "language_${ns} internal" )
33+ if (NOT dir STREQUAL "" )
34+ list (APPEND DOXYGEN_EXAMPLE_PATH
35+ "${CMAKE_CURRENT_SOURCE_DIR} /${dir} samples" )
36+ endif ()
37+ endforeach ()
2638
2739include (GoogleCloudCppDoxygen )
2840google_cloud_cpp_doxygen_targets ("language" DEPENDS cloud-docs
@@ -48,7 +60,7 @@ target_link_libraries(google_cloud_cpp_language_protos PUBLIC ${proto_deps})
4860file (
4961 GLOB source_files
5062 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
51- "*.h" "*.cc" "internal/*.h" "internal/*.cc" )
63+ ${source_globs} )
5264list (SORT source_files)
5365add_library (google_cloud_cpp_language ${source_files} )
5466target_include_directories (
@@ -78,7 +90,7 @@ add_library(google-cloud-cpp::language ALIAS google_cloud_cpp_language)
7890file (
7991 GLOB relative_mock_files
8092 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
81- "mocks/*.h" )
93+ ${mocks_globs} )
8294list (SORT relative_mock_files)
8395set (mock_files)
8496foreach (file IN LISTS relative_mock_files)
@@ -180,3 +192,10 @@ install(
180192 COMPONENT google_cloud_cpp_development)
181193
182194external_googleapis_install_pc ("google_cloud_cpp_language_protos" )
195+
196+ # google-cloud-cpp::language must be defined before we can add the samples.
197+ foreach (dir IN LISTS service_dirs)
198+ if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
199+ google_cloud_cpp_add_samples_relative ("language" "${dir} samples/" )
200+ endif ()
201+ endforeach ()
0 commit comments