[SCons] Add specific targets for building the docs
Documentation can be built independently of the code by using the 'scons sphinx' and 'scons doxygen' commands, as an alternative to using the options 'sphinx_docs=y' and 'doxygen_docs=y' to 'scons build'.
This commit is contained in:
parent
e09c6ca304
commit
6266986d7b
2 changed files with 14 additions and 4 deletions
12
SConstruct
12
SConstruct
|
|
@ -24,6 +24,10 @@ Basic usage:
|
|||
'scons samples' - Compile the C++ and Fortran samples.
|
||||
|
||||
'scons msi' - Build a Windows installer (.msi) for Cantera.
|
||||
|
||||
'scons sphinx' - Build the Sphinx documentation
|
||||
|
||||
'scons doxygen' - Build the Doxygen documentation
|
||||
"""
|
||||
|
||||
from buildutils import *
|
||||
|
|
@ -34,7 +38,7 @@ if not COMMAND_LINE_TARGETS:
|
|||
sys.exit(0)
|
||||
|
||||
valid_commands = ('build','clean','install','uninstall',
|
||||
'help','msi','samples')
|
||||
'help','msi','samples','sphinx','doxygen')
|
||||
|
||||
for command in COMMAND_LINE_TARGETS:
|
||||
if command not in valid_commands and not command.startswith('test'):
|
||||
|
|
@ -586,7 +590,6 @@ opts.AddVariables(*config_options)
|
|||
opts.Update(env)
|
||||
opts.Save('cantera.conf', env)
|
||||
|
||||
|
||||
if 'help' in COMMAND_LINE_TARGETS:
|
||||
### Print help about configuration options and exit.
|
||||
print """
|
||||
|
|
@ -614,6 +617,11 @@ running 'scons build'. The format of this file is:
|
|||
print '\n'.join(formatOption(env, opt))
|
||||
sys.exit(0)
|
||||
|
||||
if 'doxygen' in COMMAND_LINE_TARGETS:
|
||||
env['doxygen_docs'] = True
|
||||
if 'sphinx' in COMMAND_LINE_TARGETS:
|
||||
env['sphinx_docs'] = True
|
||||
|
||||
valid_arguments = (set(opt[0] for opt in windows_compiler_options) |
|
||||
set(opt[0] for opt in compiler_options) |
|
||||
set(opt[0] for opt in config_options))
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ if localenv['doxygen_docs']:
|
|||
if localenv['graphvizdir']:
|
||||
localenv.Append(PATH=localenv['graphvizdir'])
|
||||
|
||||
build(localenv.Command('#build/docs/doxygen/html/index.html',
|
||||
'doxygen/Doxyfile', 'doxygen $SOURCE'))
|
||||
docs = build(localenv.Command('#build/docs/doxygen/html/index.html',
|
||||
'doxygen/Doxyfile', 'doxygen $SOURCE'))
|
||||
env.Alias('doxygen', docs)
|
||||
install(pjoin('$inst_docdir', 'doxygen/html'),
|
||||
mglob(localenv, '#/build/docs/doxygen/html', 'html', 'svg', 'css', 'png'))
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ if localenv['sphinx_docs']:
|
|||
sphinxdocs = build(localenv.Command('${SPHINXBUILD}/html/index.html',
|
||||
'sphinx/conf.py',
|
||||
'${sphinx_cmd} -b html -d ${SPHINXBUILD}/doctrees ${SPHINXSRC} ${SPHINXBUILD}/html'))
|
||||
env.Alias('sphinx', sphinxdocs)
|
||||
|
||||
# Python examples: Create individual documentation pages with the source
|
||||
# for each example
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue