Add Doxygen documentation generation

This commit is contained in:
Matias Fontanini
2016-07-30 09:15:14 -07:00
parent db1c99c662
commit b147123eba
5 changed files with 1664 additions and 1 deletions

View File

@@ -39,6 +39,22 @@ add_subdirectory(include)
add_subdirectory(examples)
# Add a target to generate API documentation using Doxygen
find_package(Doxygen QUIET)
if(DOXYGEN_FOUND)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY
)
add_custom_target(
docs
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
set(GOOGLETEST_ROOT ${CMAKE_SOURCE_DIR}/third_party/googletest)
if(EXISTS "${GOOGLETEST_ROOT}/CMakeLists.txt")
set(GOOGLETEST_INCLUDE ${GOOGLETEST_ROOT}/googletest/include)

View File

@@ -71,3 +71,9 @@ If you want to use _cppkafka_, you'll need to link your application with:
* _cppkafka_
* _rdkafka_
# Documentation
You can generate the documentation by running `make docs` inside the build directory. This requires
_Doxygen_ to be installed. The documentation will be written in html format at
`<build-dir>/docs/html/`.

1630
docs/Doxyfile.in Normal file

File diff suppressed because it is too large Load Diff

11
docs/mainpage.dox Normal file
View File

@@ -0,0 +1,11 @@
/**
* \mainpage Documentation
*
* \section intro_sec Introduction
*
* <i>cppkafka</i> is a C++11 wrapper for <i>rdkafka</i>, an <i>Apache Kafka</i> client library.
*
* <i>cppkafka</i> provides a high level interface for producing and consuming <i>Kafka</i>
* messages.
*
*/

View File

@@ -156,7 +156,7 @@ TEST_F(ConsumerTest, Rebalance) {
consumer1.set_revocation_callback([&](const vector<TopicPartition>&) {
revocation_called = true;
});
consumer1.subscribe({ KAFKA_TOPIC });
consumer1.subscribe(KAFKA_TOPIC);
ConsumerRunner runner1(consumer1, 1, 3);
// Create a second consumer and subscribe to the topic