Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111336221
SConscript
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Apr 30, 21:29
Size
3 KB
Mime Type
text/x-python
Expires
Fri, May 2, 21:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25895563
Attached To
rTAMAAS tamaas
SConscript
View Options
# -*- mode:python; coding: utf-8 -*-
# vim: set ft=python:
#
# Copyright (©) 2016-2021 EPFL (École Polytechnique Fédérale de Lausanne),
# Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import print_function
from SCons.Script import Import, Glob, Dir, File
def add_sources(source_list, dirname, fnames):
source_list += Dir(dirname).glob('*.hh')
source_list += Dir(dirname).glob('*.cpp')
Import('main_env')
Import('libTamaas')
doc_env = main_env.Clone()
doc_env['man_section'] = 7
# Generating Doxyfile
doxygen_verbose = {True: "NO", False: "YES"}
doxyfile_target = doc_env.Substfile('doxygen/Doxyfile', 'doxygen/Doxyfile.in',
SUBST_DICT={
'@version@': '$version',
'@build_dir@': Dir('doxygen').path,
'@logo@': File('icon.svg').path,
'@src_dir@': Dir('#src').abspath,
'@verbose@':
doxygen_verbose[doc_env["verbose"]],
})
# Generate Doxygen API documentation
doc_env.Tool('doxygen')
doxygen_target = doc_env.Doxygen('doxygen/xml/index.xml',
[doxyfile_target, 'icon.svg'])
# Adding all source files as dependencies
sources = []
Dir('#src').walk(add_sources, sources)
doc_env.Depends(doxygen_target, sources)
# Generate Sphinx User documentation
sphinx_targets_map = {
"html": "sphinx/html/index.html",
"man": "sphinx/tamaas.${man_section}",
"latex": "sphinx/latex/Tamaas.tex"
}
doc_env.Tool('sphinx')
doc_env['IMPLICIT_COMMAND_DEPENDENCIES'] = 0
sphinx_sources = [Glob('sphinx/source/*'), Glob('sphinx/source/figures/*')]
sphinx_targets = {
builder: doc_env.Sphinx(sphinx_targets_map[builder], sphinx_sources)
for builder in doc_env['doc_builders']
}
for target in sphinx_targets.values():
doc_env.Depends(target, doxygen_target)
# Alias for both docs
doc_targets = [doxygen_target] + list(sphinx_targets.values())
main_env.Alias('build-doc', doc_targets)
# Install target for documentation
share = Dir('share', doc_env['prefix'])
doc_install = []
sphinx_prefix_map = {}
if "html" in doc_env['doc_builders']:
doc_install.append(doc_env.Install(target=share.Dir('doc').Dir('tamaas'),
source=sphinx_targets['html'][0].dir))
if "man" in doc_env['doc_builders']:
doc_install.append(doc_env.Install(
target=share.Dir('man') .Dir(doc_env.subst('man${man_section}')),
source=sphinx_targets['man']))
main_env.Alias('install-doc', doc_install)
Event Timeline
Log In to Comment