blob: 3e4205c535efea1694a71d3526b4a4ee3964f19b [file] [log] [blame]
Christopher Dunne0d72242007-06-14 17:58:59 +00001Import( 'env' )
2import os.path
3
4if 'doxygen' in env['TOOLS']:
5 doc_topdir = env['ROOTBUILD_DIR']
6 doxyfile = env.SubstInFile( '#doc/doxyfile', 'doxyfile.in',
7 SUBST_DICT = {
8 '%JSONCPP_VERSION%' : env['JSONCPP_VERSION'],
9 '%TOPDIR%' : env.Dir('#').abspath,
10 '%DOC_TOPDIR%' : str(doc_topdir) } )
11 doc_cmd = env.Doxygen( doxyfile )
12 alias_doc_cmd = env.Alias('doc', doc_cmd )
13 env.AlwaysBuild(alias_doc_cmd)
14
15 for dir in doc_cmd:
16 env.Alias('doc', env.Install( '#' + dir.path, '#README.txt' ) )
17 filename = os.path.split(dir.path)[1]
18 targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % filename )
19 zip_doc_cmd = env.TarGz( targz_path, [env.Dir(dir)],
20 TARGZ_BASEDIR = doc_topdir )
21 env.Depends( zip_doc_cmd, alias_doc_cmd )
22 env.Alias( 'doc-dist', zip_doc_cmd )
Christopher Dunnde10f452007-06-14 22:03:11 +000023
24 # When doxyfile gets updated, I get errors on the first pass.
25 # I have to run scons twice. Something is wrong with the dependencies
26 # here, but I avoid it by running "scons doc/doxyfile" first.