Skip to content

Commit

Permalink
Merge pull request #46 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 9, 2024
2 parents 82a3c7b + 54e429a commit ecbcb19
Show file tree
Hide file tree
Showing 7 changed files with 2,883 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,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 CMAKE_ARGS="-DDOXYGEN_WARN_AS_ERROR=YES"
- name: upload Doxygen artifact
uses: actions/upload-artifact@v4
with:
name: doxygen
path: ./build/doc/doxygen/html
retention-days: 7
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(NM_NG_ENABLE_DOC_DOXYGEN "Enable build of code documentation" OFF)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wunused -Wconversion -Wsign-conversion")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Werror")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -ggdb3")
Expand All @@ -26,3 +28,4 @@ include(cmake/dependencies.cmake)
add_subdirectory(modules)
add_subdirectory(common)
add_subdirectory(pkg)
add_subdirectory(doc)
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ tidy: all
tidy-fix: all
$(RUN_CLANG_TIDY) -p build -quiet -fix -j $(shell nproc) -header-filter="$(HEADER_FILTER)" $(SOURCE_DIR)

.PHONY: doxygen
doxygen: build
@cd build && $(CMAKE) $(CMAKE_ARGS) -DNM_NG_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 (NM_NG_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 ecbcb19

Please sign in to comment.