Skip to content

Commit 1f3c6e2

Browse files
committed
doc: Introduce Doxygen
This adds a new CMake custom target if Doxygen is found on the build host. The Doxyfile will be generated in the build folder from the new Doxyfile.in which contains placeholders with CMake variables which are replaced by CMake. Doxygen style file headers were added to the library header files to actually create a first more or less useful Doxygen HTML output. Note: Doxygen still creates a lot of warnings about not yet documented functions and structs.
1 parent bd39aa3 commit 1f3c6e2

File tree

4 files changed

+2527
-5
lines changed

4 files changed

+2527
-5
lines changed

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ project(mqtt-tools
44
VERSION 0.1.0
55
LANGUAGES C)
66

7+
set(MQTTA_DESCRIPTION "A library to simplify agents that react on/with external events or MQTT messages by handling 95% of the MQTT use-cases.")
8+
set(MQTTA_URL "https://github.com/penguineer/mqtt-tools")
9+
710
#
811
# NOTE This project uses semantic versioning as described at
912
#
@@ -46,6 +49,18 @@ install(EXPORT ${PROJECT_NAME}-targets
4649
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
4750
)
4851

52+
# Documentation
53+
find_package(Doxygen)
54+
if(DOXYGEN_FOUND)
55+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
56+
"${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" @ONLY)
57+
add_custom_target(doc_${PROJECT_NAME} "${DOXYGEN_EXECUTABLE}"
58+
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
59+
COMMENT "Generating API documentation with Doxygen" VERBATIM
60+
SOURCES "${PROJECT_SOURCE_DIR}/Doxyfile.in"
61+
)
62+
endif(DOXYGEN_FOUND)
63+
4964
# For later
5065
#target_link_libraries(mqtt-clock ${POPT_LIBRARY})
5166
#target_link_libraries(mqtt-clock ${PTHREAD_LIBRARY})

0 commit comments

Comments
 (0)