Improve CMake bits
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user