mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
Generate doxygen into a sub-folder of build
When no OUTPUT_DIRECTORY was set for doxygen, then the parent directory of the doxyfile was used. If the doxyfile is in the root-directory, then this was the build-directory itself, which led to the complete build-directory (including all other build artifacts) to be installed. The OUTPUT_DIRECTORY set (if not given) now includes the name of the doxyfile itself (+ suffix '.doxy'). The install of doxygen-generated files also did not preserve the directory structure. The doxy playground example was simplified and updated, as separate installation is no longer needed. Signed-off-by: Thomas Nagy <tnagy2pow10@gmail.com>
This commit is contained in:
parent
1b65d73c56
commit
b1a606c8e6
@ -30,20 +30,11 @@ def configure(conf):
|
|||||||
#
|
#
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
# if the documentation is to packed, simply set doxy_tar to the filename
|
||||||
bld(
|
bld(
|
||||||
features='doxygen',
|
features='doxygen',
|
||||||
doxyfile='test.conf',
|
doxyfile='test.conf',
|
||||||
doxy_tar='docs.tar.bz2')
|
install_path='${PREFIX}/doc')
|
||||||
|
|
||||||
# if the documentation is to be installed
|
|
||||||
bld.add_group()
|
|
||||||
bld.post_mode = Build.POST_LAZY
|
|
||||||
bld(features='special_doxygen_stuff')
|
|
||||||
|
|
||||||
@TaskGen.feature('special_doxygen_stuff')
|
|
||||||
def special_doxygen_stuff(self):
|
|
||||||
node = self.path.get_bld().make_node('html')
|
|
||||||
self.bld.install_files('${PREFIX}/doc/html', node.ant_glob('**', remove=False))
|
|
||||||
|
|
||||||
# and additional targets
|
# and additional targets
|
||||||
bld(features='cxx cxxshlib', source='subdir/c.cpp', target='somelib')
|
bld(features='cxx cxxshlib', source='subdir/c.cpp', target='somelib')
|
||||||
|
@ -8,6 +8,9 @@ Doxygen support
|
|||||||
|
|
||||||
Variables passed to bld():
|
Variables passed to bld():
|
||||||
* doxyfile -- the Doxyfile to use
|
* doxyfile -- the Doxyfile to use
|
||||||
|
* doxy_tar -- destination archive for generated documentation (if desired)
|
||||||
|
* install_path -- where to install the documentation
|
||||||
|
* pars -- dictionary overriding doxygen configuration settings
|
||||||
|
|
||||||
When using this tool, the wscript will look like:
|
When using this tool, the wscript will look like:
|
||||||
|
|
||||||
@ -79,12 +82,11 @@ class doxygen(Task.Task):
|
|||||||
if self.pars.get('OUTPUT_DIRECTORY'):
|
if self.pars.get('OUTPUT_DIRECTORY'):
|
||||||
# Use the path parsed from the Doxyfile as an absolute path
|
# Use the path parsed from the Doxyfile as an absolute path
|
||||||
output_node = self.inputs[0].parent.get_bld().make_node(self.pars['OUTPUT_DIRECTORY'])
|
output_node = self.inputs[0].parent.get_bld().make_node(self.pars['OUTPUT_DIRECTORY'])
|
||||||
output_node.mkdir()
|
|
||||||
self.pars['OUTPUT_DIRECTORY'] = output_node.abspath()
|
|
||||||
else:
|
else:
|
||||||
# If no OUTPUT_PATH was specified in the Doxyfile build path from where the Doxyfile lives
|
# If no OUTPUT_PATH was specified in the Doxyfile, build path from the Doxyfile name + '.doxy'
|
||||||
self.inputs[0].parent.get_bld().mkdir()
|
output_node = self.inputs[0].parent.get_bld().make_node(self.inputs[0].name + '.doxy')
|
||||||
self.pars['OUTPUT_DIRECTORY'] = self.inputs[0].parent.get_bld().abspath()
|
output_node.mkdir()
|
||||||
|
self.pars['OUTPUT_DIRECTORY'] = output_node.abspath()
|
||||||
|
|
||||||
# Override with any parameters passed to the task generator
|
# Override with any parameters passed to the task generator
|
||||||
if getattr(self.generator, 'pars', None):
|
if getattr(self.generator, 'pars', None):
|
||||||
@ -149,7 +151,9 @@ class doxygen(Task.Task):
|
|||||||
if not getattr(self.generator, 'doxy_tar', None):
|
if not getattr(self.generator, 'doxy_tar', None):
|
||||||
self.generator.bld.install_files(self.generator.install_path,
|
self.generator.bld.install_files(self.generator.install_path,
|
||||||
self.outputs,
|
self.outputs,
|
||||||
postpone=False)
|
postpone=False,
|
||||||
|
cwd=self.output_dir,
|
||||||
|
relative_trick=True)
|
||||||
return Task.Task.post_run(self)
|
return Task.Task.post_run(self)
|
||||||
|
|
||||||
class tar(Task.Task):
|
class tar(Task.Task):
|
||||||
|
Loading…
Reference in New Issue
Block a user