Skip to content

ptomulik/scons-tool-doxyfile

Repository files navigation

scons-tool-doxyfile

PyPi package version

Travis CI build status

image

SCons tool to generate Doxyfile for Doxygen. The generated Doxyfile may be further used by scons_doxygen tool.

Installation

There are few ways to install this tool for your project.

From pypi

This method may be preferable if you build your project under a virtualenv. To add doxyfile tool from pypi, type (within your wirtualenv):

pip install scons-tool-loader scons-tool-doxyfile

or, if your project uses pipenv:

pipenv install --dev scons-tool-loader scons-tool-doxyfile

Alternatively, you may add this to your Pipfile

[dev-packages]
scons-tool-loader = "*"
scons-tool-doxyfile = "*"

The tool will be installed as a namespaced package sconstool.doxyfile in project's virtual environment. You may further use scons-tool-loader to load the tool.

As a git submodule

  1. Create new git repository:

    mkdir /tmp/prj && cd /tmp/prj
    touch README.rst
    git init
  2. Add the scons-tool-doxyfile as a submodule:

    git submodule add git://github.com/ptomulik/scons-tool-doxyfile.git site_scons/site_tools/doxyfile
  3. For python 2.x create __init__.py in site_tools directory:

    touch site_scons/site_tools/__init__.py

    this will allow to directly import site_tools.doxyfile (this may be required by other tools).

Usage example

Git-based projects

  1. Copy doxygen template to src/, for example:

    mkdir src && cp site_scons/site_tools/doxyfile/Doxyfile.in src/
  2. Create some source files, for example src/test.hpp:

    // src/test.hpp
    /**
     * @brief Test class
     */
    class TestClass { };
  3. Write SConstruct file:

    # SConstruct
    env = Environment(tools=['doxyfile', 'doxygen'])
    SConscript('src/SConscript', exports=['env'], variant_dir='build', duplicate=0)
  4. Write src/SConscript:

    # src/SConscript
    Import(['env'])
    doxyfile = env.Doxyfile( INPUT = '.', RECURSIVE = True)
    env.Doxygen(doxyfile)
  5. Try it out:

    scons

    This shall create documentation under build directory.

  6. Check the generated documentation (it should contain docs for TestClass under Classes tab):

    firefox build/html/index.html

Details

Module contents and description

The scons-tool-doxyfile contains these crucial files:

  • __init__.py, doxyoptions.py and about.py files,
  • Doxyfile.in template,
  • SConstruct script, and
  • this README.rst

The tool provides a Doxyfile() builder which generates Doxyfile configuration file from Doxyfile.in template. It accepts several options to customize the generated Doxyfile. The options are passed as keyword arguments to Doxyfile:

env.Doxyfile(INPUT='.', RECURSIVE=True, STRIP_FROM_INC_PATH='.', ...)

Same template may be used to generate documentation for several sub-projects by using different sets of options (and variant builds, if necessary). You may also use your own template file, instead of default Doxyfile.in shipped along with this tool.

Option types

The options Doxyfile() builder accepts are categorized into several types:

Type Note Example value in SConscript Example output to Doxyfile
int integer 3 3
str string 'str1' or 'str 2' str1 or "str 2"
list list ['a b', False, 3] "a b" False 3
dict dictionary {'a' : 'A', 'b' : 'B'} a=A b=B
bool boolean True or False YES or NO
entry ref to file or directory 'foo' /tmp/prj/build/foo
file ref to file 'bar.txt' /tmp/prj/build/bar.txt
dir ref to directory '.' /tmp/prj/build
srcentry ref to source file or dir 'foo' /tmp/prj/src/foo
srcfile ref to source file 'foo.txt' /tmp/prj/src/foo.txt
srcdir ref to source directory '.' /tmp/prj/src
dualentry ref to entry + its source 'foo'
/tmp/prj/build/foo \
/tmp/prj/src/foo
dualfile ref to file + its source 'foo.txt'
/tmp/prj/build/foo.txt \
/tmp/prj/src/foo.txt
dualdir ref to dir + its source '.'
/tmp/prj/build \
/tmp/prj/src
entries list of entries ['foo', 'bar/gez']
/tmp/prj/build/foo \
/tmp/prj/build/bar/geez
files list of files ['foo', 'bar.txt']
/tmp/prj/build/foo \
/tmp/prj/build/bar.txt
dirs list of directories ['.', 'foo']
/tmp/prj/build \
/tmp/prj/build/foo
srcentries list of source entries ['.', 'foo']
/tmp/prj/src \
/tmp/prj/src/foo
srcfiles list of source files ['a.txt', 'b.txt']
/tmp/prj/src/a.txt \
/tmp/prj/src/b.txt
srcdirs list of source dirs ['.', 'foo']
/tmp/prj/src \
/tmp/prj/src/foo
dualentries list of dual entries ['.', 'foo']
/tmp/prj/build \
/tmp/prj/src \
/tmp/prj/build/foo \
/tmp/prj/src/foo
dualfiles list of dual files ['a.txt', 'b.txt']
/tmp/prj/build/a.txt \
/tmp/prj/src/a.txt \
/tmp/prj/build/b.txt \
/tmp/prj/src/b.txt
dualdirs list of dual directories ['.', 'foo']
/tmp/prj/build \
/tmp/prj/src \
/tmp/prj/build/foo \
/tmp/prj/src/foo

An entry is a path to file or directory (undecided). For each value of type entry, file or dir a single path is outputted to Doxyfile. If relative paths are provided by user, they are assumed to be relative to a directory containing the calling SConscript. Note, that SCons will write absolute paths to Doxyfile, so you should consider using STRIP_FROM_PATH, STRIP_FROM_INC_PATH and similar options.

In variant builds, the entry, file and directory, if given as relative paths, will point to a file or subdirectory of build dir.

A srcentry, srcfile, or srcdir will generate a path pointing to a source file or directory corresponding to given file. This, of course, becomes relevant when variant builds are used.

Dual entry, file (or directory) results with a single path or two paths being emitted to Doxyfile. For variant builds, pair of paths is written to Doxyfile: the first one in build dir and the second pointing to a corresponding source file or dir.

The values written to Doxyfile are automatically quoted if they contain white spaces. For example, the hash {'a' : 'be ce'} will result with a="be ce".

Values being assigned to Doxyfile options are subject of simple validation.

Supported options

The supported options are summarized in the following table:

Option Type Default

ABBREVIATE_BRIEF ALIASES

str str

ALLEXTERNALS bool NO
ALPHABETICAL_INDEX bool YES
ALWAYS_DETAILED_SEC bool NO
AUTOLINK_SUPPORT bool YES
BINARY_TOC bool NO
BRIEF_MEMBER_DESC bool YES
BUILTIN_STL_SUPPORT bool NO
CALLER_GRAPH bool NO
CALL_GRAPH bool NO

CASE_SENSE_NAMES CHM_FILE CHM_INDEX_ENCODING CITE_BIB_FILES

bool srcfile str files

OS specific

CLANG_ASSISTED_PARSING CLANG_OPTIONS

bool str

NO

CLASS_DIAGRAMS bool YES
CLASS_GRAPH bool YES

COLLABORATION_GRAPH COLS_IN_ALPHA_INDEX

bool str

YES

COMPACT_LATEX bool NO
COMPACT_RTF bool NO
CPP_CLI_SUPPORT bool NO
CREATE_SUBDIRS bool NO
DIRECTORY_GRAPH bool YES
DISABLE_INDEX bool NO

DISTRIBUTE_GROUP_DOC DOCBOOK_OUTPUT

bool dir

NO

DOCSET_BUNDLE_ID str org.doxygen.Project
DOCSET_FEEDNAME str "Doxygen generated docs"
DOCSET_PUBLISHER_ID str org.doxygen.Publisher

DOCSET_PUBLISHER_NAME DOTFILE_DIRS

str srcdirs

Publisher

DOT_CLEANUP bool YES

DOT_FONTNAME DOT_FONTPATH

str srcdir

Helvetica

DOT_FONTSIZE int 10
DOT_GRAPH_MAX_NODES int 50
DOT_IMAGE_FORMAT str png
DOT_MULTI_TARGETS bool NO

DOT_NUM_THREADS DOT_PATH

int str

0

DOT_TRANSPARENT bool NO
DOXYFILE_ENCODING str UTF-8

ECLIPSE_DOC_ID ENABLED_SECTIONS

str str

org.doxygen.Project

ENABLE_PREPROCESSING bool YES

ENUM_VALUES_PER_LINE EXAMPLE_PATH EXAMPLE_PATTERNS

int srcdirs str

4

EXAMPLE_RECURSIVE EXCLUDE EXCLUDE_PATTERNS EXCLUDE_SYMBOLS

bool srcdirs str str

NO

EXCLUDE_SYMLINKS EXPAND_AS_DEFINED

bool list

NO

EXPAND_ONLY_PREDEF EXTENSION_MAPPING

bool str

NO

EXTERNAL_GROUPS bool YES
EXTERNAL_PAGES bool YES

EXTERNAL_SEARCH EXTERNAL_SEARCH_ID

bool str

NO

EXTRACT_ALL bool NO
EXTRACT_ANON_NSPACES bool NO
EXTRACT_LOCAL_CLASSES bool YES
EXTRACT_LOCAL_METHODS bool NO
EXTRACT_PACKAGE bool NO
EXTRACT_PRIVATE bool NO

EXTRACT_STATIC EXTRA_PACKAGES EXTRA_SEARCH_MAPPINGS

bool str str

NO

EXT_LINKS_IN_WINDOW FILE_PATTERNS FILE_VERSION_FILTER FILTER_PATTERNS

bool str str dict

NO

FILTER_SOURCE_FILES FILTER_SOURCE_PATTERNS

bool dict

NO

FORCE_LOCAL_INCLUDES bool NO
FORMULA_FONTSIZE int 10
FORMULA_TRANSPARENT bool YES
FULL_PATH_NAMES bool YES
GENERATE_AUTOGEN_DEF bool NO
GENERATE_BUGLIST bool YES
GENERATE_CHI bool NO
GENERATE_DEPRECATEDLIST bool YES
GENERATE_DOCBOOK bool NO
GENERATE_DOCSET bool NO
GENERATE_ECLIPSEHELP bool NO
GENERATE_HTML bool YES
GENERATE_HTMLHELP bool NO
GENERATE_LATEX bool YES
GENERATE_LEGEND bool YES
GENERATE_MAN bool NO
GENERATE_PERLMOD bool NO
GENERATE_QHP bool NO

GENERATE_RTF GENERATE_TAGFILE

bool file

NO

GENERATE_TESTLIST bool YES
GENERATE_TODOLIST bool YES
GENERATE_TREEVIEW bool NO
GENERATE_XML bool NO
GRAPHICAL_HIERARCHY bool YES
GROUP_GRAPHS bool YES

HAVE_DOT HHC_LOCATION

bool str

NO

HIDE_FRIEND_COMPOUNDS bool NO
HIDE_IN_BODY_DOCS bool NO
HIDE_SCOPE_NAMES bool NO
HIDE_UNDOC_CLASSES bool NO
HIDE_UNDOC_MEMBERS bool NO
HIDE_UNDOC_RELATIONS bool YES
HTML_COLORSTYLE_GAMMA int 80
HTML_COLORSTYLE_HUE int 220
HTML_COLORSTYLE_SAT int 100

HTML_DYNAMIC_SECTIONS HTML_EXTRA_FILES HTML_EXTRA_STYLESHEET

bool srcfiles srcfile

NO

HTML_FILE_EXTENSION HTML_FOOTER HTML_HEADER

str srcfile srcfile

.html

HTML_INDEX_NUM_ENTRIES int 100

HTML_OUTPUT HTML_STYLESHEET

str srcfile

html

HTML_TIMESTAMP bool YES

IDL_PROPERTY_SUPPORT IGNORE_PREFIX IMAGE_PATH

bool str srcdirs

YES

INCLUDED_BY_GRAPH INCLUDE_FILE_PATTERNS

bool str

YES

INCLUDE_GRAPH INCLUDE_PATH

bool srcdirs

YES

INHERIT_DOCS bool YES
INLINE_GROUPED_CLASSES bool NO
INLINE_INFO bool YES
INLINE_INHERITED_MEMB bool NO
INLINE_SIMPLE_STRUCTS bool NO

INLINE_SOURCES INPUT

bool srcentries

NO

INPUT_ENCODING INPUT_FILTER

str str

UTF-8

INTERACTIVE_SVG bool NO
INTERNAL_DOCS bool NO
JAVADOC_AUTOBRIEF bool NO

LATEX_BATCHMODE LATEX_BIB_STYLE

bool str

NO

LATEX_CMD_NAME LATEX_EXTRA_FILES LATEX_FOOTER LATEX_HEADER

str srcfiles srcfile srcfile

latex

LATEX_HIDE_INDICES bool NO
LATEX_OUTPUT str latex

LATEX_SOURCE_CODE LAYOUT_FILE

bool srcfile

NO

LOOKUP_CACHE_SIZE int 0
MACRO_EXPANSION bool NO
MAKEINDEX_CMD_NAME str makeindex
MAN_EXTENSION str .3
MAN_LINKS bool NO
MAN_OUTPUT str man

MARKDOWN_SUPPORT MATHJAX_CODEFILE MATHJAX_EXTENSIONS

bool srcfile str

YES

MATHJAX_FORMAT str HTML-CSS
MATHJAX_RELPATH str http://cdn.mathjax.org/mathjax/latest
MAX_DOT_GRAPH_DEPTH int 0

MAX_INITIALIZER_LINES MSCFILE_DIRS MSCGEN_PATH

int dirs str

30

MULTILINE_CPP_IS_BRIEF bool NO
OPTIMIZE_FOR_FORTRAN bool NO
OPTIMIZE_OUTPUT_FOR_C bool NO
OPTIMIZE_OUTPUT_JAVA bool NO

OPTIMIZE_OUTPUT_VHDL OUTPUT_DIRECTORY

bool dir

NO

OUTPUT_LANGUAGE str English
PAPER_TYPE str a4
PDF_HYPERLINKS bool YES

PERLMOD_LATEX PERLMOD_MAKEVAR_PREFIX

bool str

NO

PERLMOD_PRETTY bool YES

PERL_PATH PREDEFINED PROJECT_BRIEF PROJECT_LOGO

str list str str

/usr/bin/perl

PROJECT_NAME PROJECT_NUMBER QCH_FILE QHG_LOCATION QHP_CUST_FILTER_ATTRS QHP_CUST_FILTER_NAME QHP_NAMESPACE QHP_SECT_FILTER_ATTRS

str str str str str str str str

"My Project"

QHP_VIRTUAL_FOLDER str doc
QT_AUTOBRIEF bool NO
QUIET bool NO
RECURSIVE bool NO
REFERENCED_BY_RELATION bool NO
REFERENCES_LINK_SOURCE bool YES
REFERENCES_RELATION bool NO

REPEAT_BRIEF RTF_EXTENSIONS_FILE

bool file

YES

RTF_HYPERLINKS bool NO

RTF_OUTPUT RTF_STYLESHEET_FILE

str file

rtf

SEARCHDATA_FILE str searchdata.xml

SEARCHENGINE SEARCHENGINE_URL

bool str

YES

SEARCH_INCLUDES bool YES
SEPARATE_MEMBER_PAGES bool NO
SERVER_BASED_SEARCH bool NO
SHORT_NAMES bool NO
SHOW_FILES bool YES
SHOW_INCLUDE_FILES bool YES
SHOW_NAMESPACES bool YES
SHOW_USED_FILES bool YES
SIP_SUPPORT bool NO
SKIP_FUNCTION_MACROS bool YES
SORT_BRIEF_DOCS bool NO
SORT_BY_SCOPE_NAME bool NO
SORT_GROUP_NAMES bool NO
SORT_MEMBERS_CTORS_1ST bool NO
SORT_MEMBER_DOCS bool YES
SOURCE_BROWSER bool NO
SOURCE_TOOLTIPS bool YES
STRICT_PROTO_MATCHING bool NO

STRIP_CODE_COMMENTS STRIP_FROM_INC_PATH STRIP_FROM_PATH

bool srcdirs srcdirs

YES

SUBGROUPING bool YES

TAB_SIZE TAGFILES TCL_SUBST

int str str

4

TEMPLATE_RELATIONS bool NO
TOC_EXPAND bool NO
TREEVIEW_WIDTH int 250
TYPEDEF_HIDES_STRUCT bool NO
UML_LIMIT_NUM_FIELDS int 10
UML_LOOK bool NO
USE_HTAGS bool NO

USE_MATHJAX USE_MDFILE_AS_MAINPAGE

bool srcfile

NO

USE_PDFLATEX bool YES
VERBATIM_HEADERS bool YES
WARNINGS bool YES
WARN_FORMAT str "$file:$line: $text"
WARN_IF_DOC_ERROR bool YES

WARN_IF_UNDOCUMENTED WARN_LOGFILE

bool file

YES

WARN_NO_PARAMDOC XML_DTD

bool str

NO

XML_OUTPUT str xml

XML_PROGRAMLISTING XML_SCHEMA

bool str

YES

Notes to developers

Regenerating documentation for options

If you change some options in doxyoptions.py, then you should regenerate option's documentation in README.rst. New documentation may be generated by running:

scons -Q doc-options

After that, copy-paste the output of the above command to an appropriate place in this README.rst (note, just skip scons messages).

LICENSE

Copyright (c) 2013-2020 by Paweł Tomulik <ptomulik@meil.pw.edu.pl>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE