-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
#!/bin/sh | ||
|
||
ENABLE_VARS="code-coverage|yes|ENABLE_COVERAGE" | ||
ENABLE_VARS="code-coverage|On|ENABLE_COVERAGE docs|On|ENABLE_DOCS" | ||
DISABLE_VARS="docs|Off|ENABLE_DOCS" | ||
ENABLE_ENABLE_COVERAGE_DOC="enable coverage analysis" | ||
ENABLE_ENABLE_DOCS_DOC="enable building manpages" | ||
ENABLE_DISABLE_DOCS_DOC="disable building manpages" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
set(3VALUE_OPTS On Off Try) | ||
set(ENABLE_DOCS "Try" CACHE STRING "Enables documentation") | ||
|
||
if(ENABLE_DOCS) # only matches On | ||
set(REQ_DOCS REQUIRED) | ||
endif() | ||
find_program(SPHINX NAMES sphinx-build sphinx-build2 ${REQ_DOCS}) | ||
|
||
if(SPHINX AND ENABLE_DOCS) | ||
|
||
set(man5_inputs | ||
man5/flux-config-sched-fluxion-qmanager.rst | ||
man5/flux-config-sched-fluxion-resource.rst | ||
) | ||
foreach(file ${man5_inputs}) | ||
string(REPLACE ".rst" ".5" out ${file}) | ||
list(APPEND man5_outputs ${CMAKE_CURRENT_BINARY_DIR}/${out}) | ||
endforeach() | ||
|
||
add_custom_target(manpages | ||
ALL | ||
DEPENDS | ||
man5/index.rst | ||
${man5_inputs} | ||
COMMAND | ||
PYTHONPATH=$ENV{PYTHONPATH}:${CMAKE_CURRENT_SOURCE_DIR} | ||
SPHINX_BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} | ||
${Python_EXECUTABLE} -m sphinx -b man ${CMAKE_CURRENT_SOURCE_DIR} ./man5 | ||
BYPRODUCTS | ||
${man5_outputs} | ||
) | ||
install( | ||
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man5 | ||
TYPE MAN | ||
FILES_MATCHING PATTERN "*.5" PATTERN ".doctrees" EXCLUDE | ||
) | ||
add_custom_target(html | ||
DEPENDS | ||
man5/index.rst | ||
${man5_inputs} | ||
COMMAND | ||
PYTHONPATH=$ENV{PYTHONPATH}:${CMAKE_CURRENT_SOURCE_DIR} | ||
SPHINX_BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} | ||
${Python_EXECUTABLE} -m sphinx -b html ${CMAKE_CURRENT_SOURCE_DIR} ./html | ||
BYPRODUCTS | ||
${man5_outputs} | ||
) | ||
add_custom_target(docs | ||
DEPENDS html manpages) | ||
endif() |