Improve CMake bits

This commit is contained in:
Jared Dillard
2025-12-02 16:48:29 -08:00
parent 543efabebb
commit db32dc60a7
3 changed files with 20 additions and 27 deletions
@@ -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()