File tree Expand file tree Collapse file tree 4 files changed +50
-12
lines changed
Expand file tree Collapse file tree 4 files changed +50
-12
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,18 @@ jobs:
4848 - name : Checkout
49495050
51- - name : Install Dependencies
52- run : |
53- sudo apt-get install -y doxygen
54- pip3 install -r docs/requirements.txt
51+ - name : Install Doxygen
52+ run : sudo apt-get install -y doxygen
53+
54+ - name : Configure Project
55+ 56+ with :
57+ options : BUILD_DOCS=ON
5558
5659 - name : Build Documentation
57- run : sphinx- build -b html docs build/docs -W --keep-going
60+ run : cmake -- build build --target docs
5861
5962 - name : Upload Documentation
60636164 with :
62- path : build/docs
65+ path : build/docs/html
Original file line number Diff line number Diff line change @@ -23,18 +23,21 @@ jobs:
2323 - name : Checkout
24242525
26- - name : Install Dependencies
27- run : |
28- sudo apt-get install -y doxygen
29- pip3 install -r docs/requirements.txt
26+ - name : Install Doxygen
27+ run : sudo apt-get install -y doxygen
28+
29+ - name : Configure Project
30+ 31+ with :
32+ options : BUILD_DOCS=ON
3033
3134 - name : Build Documentation
32- run : sphinx- build -b html docs docs/ build -W --keep-going
35+ run : cmake -- build build --target docs
3336
3437 - name : Upload Documentation
35383639 with :
37- path : docs/build
40+ path : build/ docs/html
3841
3942 - name : Deploy Pages
4043 id : deploy-pages
Original file line number Diff line number Diff line change @@ -82,3 +82,7 @@ if(NOT_SUBPROJECT)
8282endif ()
8383
8484add_subdirectory (components)
85+
86+ if (NOT_SUBPROJECT AND BUILD_DOCS)
87+ add_subdirectory (docs)
88+ endif ()
Original file line number Diff line number Diff line change 1+ find_package (Python REQUIRED)
2+
3+ message (STATUS "Installing Python dependencies" )
4+ execute_process (
5+ COMMAND ${Python_EXECUTABLE} -m pip install -r ${CMAKE_CURRENT_SOURCE_DIR} /requirements.txt
6+ RESULT_VARIABLE RES
7+ ERROR_VARIABLE ERR
8+ OUTPUT_QUIET
9+ )
10+ if (NOT RES EQUAL 0 )
11+ message (FATAL_ERROR "Failed to install Python dependencies:\n ${ERR} " )
12+ endif ()
13+
14+ get_target_property (errors_docs_BINARY_DIR errors_docs BINARY_DIR)
15+ get_target_property (errors_format_docs_BINARY_DIR errors_format_docs BINARY_DIR)
16+
17+ add_custom_command (
18+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /html/index.html
19+ COMMAND ${Python_EXECUTABLE} -m sphinx -b html ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} /html -W --keep-going
20+ DEPENDS
21+ ${CMAKE_CURRENT_SOURCE_DIR} /conf.py
22+ ${CMAKE_CURRENT_SOURCE_DIR} /index.rst
23+ ${errors_docs_BINARY_DIR} /errors_docs.stamp
24+ ${errors_format_docs_BINARY_DIR} /errors_format_docs.stamp
25+ )
26+
27+ add_custom_target (docs ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR} /html/index.html)
28+ add_dependencies (docs errors_docs errors_format_docs)
You can’t perform that action at this time.
0 commit comments