Improve CMake bits
This commit is contained in:
+3
-1
@@ -11,4 +11,6 @@ build:
|
||||
- cmake --workflow --preset documentation-workflow
|
||||
# Copy built documentation to Read the Docs output directory
|
||||
- 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(setup_sphinx_environment)
|
||||
@@ -15,3 +18,11 @@ function(setup_sphinx_environment)
|
||||
# Export to parent scope
|
||||
set(SPHINX_EXECUTABLE "${SPHINX_EXECUTABLE}" PARENT_SCOPE)
|
||||
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(SetupSphinx)
|
||||
include(SphinxUtils)
|
||||
|
||||
setup_sphinx_environment()
|
||||
|
||||
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/source)
|
||||
set(SPHINX_BUILD ${CMAKE_BINARY_DIR})
|
||||
|
||||
# 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
|
||||
)
|
||||
add_sphinx_builder(html)
|
||||
add_sphinx_builder(markdown)
|
||||
add_sphinx_builder(rst)
|
||||
|
||||
Reference in New Issue
Block a user