Skip to content

Commit

Permalink
Merge pull request #19 from CESNET/doxygen
Browse files Browse the repository at this point in the history
Add generation of Doxygen documentation
  • Loading branch information
SiskaPavel authored Oct 4, 2024
2 parents fa07656 + 4f7744c commit 5511961
Show file tree
Hide file tree
Showing 16 changed files with 2,938 additions and 18 deletions.
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

0 comments on commit 5511961

Please sign in to comment.