diff --git a/SConstruct b/SConstruct index ee061a443..f4d358fa7 100644 --- a/SConstruct +++ b/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)) diff --git a/doc/SConscript b/doc/SConscript index 8e433d840..141aeef55 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -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