Skip to content
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
15 changes: 9 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,18 @@ jobs:
- name: Checkout
uses: actions/[email protected]

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

- name: Configure Project
uses: threeal/[email protected]
with:
options: BUILD_DOCS=ON

- name: Build Documentation
run: sphinx-build -b html docs build/docs -W --keep-going
run: cmake --build build --target docs

- name: Upload Documentation
uses: actions/[email protected]
with:
path: build/docs
path: build/docs/html
15 changes: 9 additions & 6 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@ jobs:
- name: Checkout
uses: actions/[email protected]

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

- name: Configure Project
uses: threeal/[email protected]
with:
options: BUILD_DOCS=ON

- name: Build Documentation
run: sphinx-build -b html docs docs/build -W --keep-going
run: cmake --build build --target docs

- name: Upload Documentation
uses: actions/[email protected]
with:
path: docs/build
path: build/docs/html

- name: Deploy Pages
id: deploy-pages
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ if(NOT_SUBPROJECT)
endif()

add_subdirectory(components)

if(NOT_SUBPROJECT AND BUILD_DOCS)
add_subdirectory(docs)
endif()
28 changes: 28 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
find_package(Python REQUIRED)

message(STATUS "Installing Python dependencies")
execute_process(
COMMAND ${Python_EXECUTABLE} -m pip install -r ${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt
RESULT_VARIABLE RES
ERROR_VARIABLE ERR
OUTPUT_QUIET
)
if(NOT RES EQUAL 0 )
message(FATAL_ERROR "Failed to install Python dependencies:\n${ERR}")
endif()

get_target_property(errors_docs_BINARY_DIR errors_docs BINARY_DIR)
get_target_property(errors_format_docs_BINARY_DIR errors_format_docs BINARY_DIR)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html
COMMAND ${Python_EXECUTABLE} -m sphinx -b html ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/html -W --keep-going
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/conf.py
${CMAKE_CURRENT_SOURCE_DIR}/index.rst
${errors_docs_BINARY_DIR}/errors_docs.stamp
${errors_format_docs_BINARY_DIR}/errors_format_docs.stamp
)

add_custom_target(docs ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
add_dependencies(docs errors_docs errors_format_docs)