Improve CMake bits
This commit is contained in:
+3
-1
@@ -11,4 +11,6 @@ build:
|
|||||||
- cmake --workflow --preset documentation-workflow
|
- cmake --workflow --preset documentation-workflow
|
||||||
# Copy built documentation to Read the Docs output directory
|
# Copy built documentation to Read the Docs output directory
|
||||||
- mkdir -p $READTHEDOCS_OUTPUT/html
|
- mkdir -p $READTHEDOCS_OUTPUT/html
|
||||||
- cp -r build/* $READTHEDOCS_OUTPUT/html/
|
- cp -r build/html/* $READTHEDOCS_OUTPUT/html/
|
||||||
|
- cp -r build/markdown/* $READTHEDOCS_OUTPUT/html/
|
||||||
|
- cp -r build/rst/* $READTHEDOCS_OUTPUT/html/
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
# SetupSphinx.cmake - Find Sphinx for CI environments
|
# Sphinx related utilities
|
||||||
|
|
||||||
|
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/source)
|
||||||
|
set(SPHINX_BUILD ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
# Function to find Sphinx in the system
|
# Function to find Sphinx in the system
|
||||||
function(setup_sphinx_environment)
|
function(setup_sphinx_environment)
|
||||||
@@ -15,3 +18,11 @@ function(setup_sphinx_environment)
|
|||||||
# Export to parent scope
|
# Export to parent scope
|
||||||
set(SPHINX_EXECUTABLE "${SPHINX_EXECUTABLE}" PARENT_SCOPE)
|
set(SPHINX_EXECUTABLE "${SPHINX_EXECUTABLE}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Function to add a Sphinx builder target
|
||||||
|
function(add_sphinx_builder builder_name)
|
||||||
|
add_custom_target(${builder_name}
|
||||||
|
COMMAND ${SPHINX_EXECUTABLE} -b ${builder_name} ${SPHINX_SOURCE} ${SPHINX_BUILD}/${builder_name}
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
+5
-25
@@ -1,27 +1,7 @@
|
|||||||
# Find Sphinx
|
include(SphinxUtils)
|
||||||
include(SetupSphinx)
|
|
||||||
setup_sphinx_environment()
|
setup_sphinx_environment()
|
||||||
|
|
||||||
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/source)
|
add_sphinx_builder(html)
|
||||||
set(SPHINX_BUILD ${CMAKE_BINARY_DIR})
|
add_sphinx_builder(markdown)
|
||||||
|
add_sphinx_builder(rst)
|
||||||
# Build HTML documentation
|
|
||||||
add_custom_target(html
|
|
||||||
COMMAND ${SPHINX_EXECUTABLE} -b html ${SPHINX_SOURCE} ${SPHINX_BUILD}
|
|
||||||
COMMENT "Building HTML documentation"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
|
|
||||||
# Build markdown documentation
|
|
||||||
add_custom_target(markdown
|
|
||||||
COMMAND ${SPHINX_EXECUTABLE} -b markdown ${SPHINX_SOURCE} ${SPHINX_BUILD}
|
|
||||||
COMMENT "Building Markdown documentation"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
|
|
||||||
# Build reStructuredText documentation
|
|
||||||
add_custom_target(rst
|
|
||||||
COMMAND ${SPHINX_EXECUTABLE} -b rst ${SPHINX_SOURCE} ${SPHINX_BUILD}
|
|
||||||
COMMENT "Building reStructuredText documentation"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user