Skip to content

Refactor Doxygen XML Build #110

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

Merged
merged 2 commits into from
Dec 27, 2023
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
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Install Requirements
run: pip3 install -r docs/requirements.txt
- name: Install Dependencies
run: |
sudo apt-get install -y doxygen
pip3 install -r docs/requirements.txt

- name: Build Documentation
run: sphinx-build -b html docs build/docs -W --keep-going
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Install Requirements
run: pip3 install -r docs/requirements.txt
- name: Install Dependencies
run: |
sudo apt-get install -y doxygen
pip3 install -r docs/requirements.txt

- name: Build Documentation
run: sphinx-build -b html docs docs/build -W --keep-going
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ if(NOT_SUBPROJECT)
catch_discover_tests(errors_test)
endif()

# Build XML documentation
if(BUILD_DOCS)
include(cmake/add_xml_docs.cmake)
add_xml_docs(errors_docs include/errors/error.hpp)
include(cmake/GenerateDocs.cmake)
target_generate_xml_docs(errors)
endif()

if(BUILD_EXAMPLES)
Expand Down
14 changes: 14 additions & 0 deletions cmake/GenerateDocs.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Function to generate an XML documentation of a specific target.
# Arguments:
# - TARGET: The target for which to generate an XML documentation.
function(target_generate_xml_docs TARGET)
find_package(Doxygen REQUIRED)

# Configure Doxygen to generate an XML documentation.
set(DOXYGEN_GENERATE_HTML NO)
set(DOXYGEN_GENERATE_XML YES)
set(DOXYGEN_XML_OUTPUT ${TARGET}_docs)

get_target_property(TARGET_HEADER_SET ${TARGET} HEADER_SET)
doxygen_add_docs(${TARGET}_docs ${TARGET_HEADER_SET} USE_STAMP_FILE)
endfunction()
30 changes: 0 additions & 30 deletions cmake/add_xml_docs.cmake

This file was deleted.

3 changes: 1 addition & 2 deletions components/format/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ if(NOT_SUBPROJECT)
catch_discover_tests(errors_format_test)
endif()

# Build XML documentation
if(BUILD_DOCS)
add_xml_docs(errors_format_docs include/errors/format.hpp)
target_generate_xml_docs(errors_format)
endif()
endif()