Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generation of Doxygen documentation #19

Merged
merged 4 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,24 @@ jobs:

cppcheck:
uses: ./.github/workflows/cppcheck.yml

doxygen:
runs-on: ubuntu-latest
container: oraclelinux:9
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Install doxygen
run: |
dnf config-manager --set-enabled ol9_codeready_builder
dnf install -y doxygen
- name: make doxygen
run: make doxygen
- name: upload Doxygen artifact
uses: actions/upload-artifact@v4
with:
name: doxygen
path: ./build/doc/doxygen/html
retention-days: 7
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ option(TELEMETRY_BUILD_SHARED "Build shared library" ON)
option(TELEMETRY_PACKAGE_BUILDER "Enable RPM package builder (make rpm)" ON)
option(TELEMETRY_INSTALL_TARGETS "Generate the install target" ON)
option(TELEMETRY_ENABLE_TESTS "Build Unit tests (make test)" OFF)
option(TELEMETRY_ENABLE_DOC_DOXYGEN "Enable build of code documentation" OFF)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -40,6 +41,7 @@ if (TELEMETRY_ENABLE_TESTS)
endif()

add_subdirectory(src)
add_subdirectory(doc)

if (TELEMETRY_PACKAGE_BUILDER)
add_subdirectory(pkg)
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ test: build
@$(MAKE) --no-print-directory -C build
@$(MAKE) test --no-print-directory -C build

doxygen: build
@cd build && $(CMAKE) $(CMAKE_ARGS) -DTELEMETRY_ENABLE_DOC_DOXYGEN=ON ..
@$(MAKE) --no-print-directory -C build $@
3 changes: 3 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if (TELEMETRY_ENABLE_DOC_DOXYGEN)
add_subdirectory(doxygen)
endif()
21 changes: 21 additions & 0 deletions doc/doxygen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
find_package(Doxygen REQUIRED)

set(DOXYGEN_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/")

if (NOT DOXYGEN_WARN_AS_ERROR)
set(DOXYGEN_WARN_AS_ERROR "NO")
endif()

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
"${DOXYGEN_DIRECTORY}/Doxyfile"
@ONLY
)

add_custom_target(
doxygen
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
WORKING_DIRECTORY "${DOXYGEN_DIRECTORY}"
COMMENT "Generating API documentation with Doxygen to ${DOXYGEN_DIRECTORY}"
VERBATIM
)
Loading