blob: 7b78a21d8024580b070bdc2e9bcb9cbd8ed86f2d [file] [log] [blame]
Christopher Dunne0d72242007-06-14 17:58:59 +00001Import( 'env' )
2import os.path
3
Baptiste Lepilleurf66d3702008-01-20 16:49:53 +00004if 'doxygen' in env['TOOLS']:
5 doc_topdir = str(env['ROOTBUILD_DIR'])
6 html_dir = 'jsoncpp-api-doc'
Christopher Dunne0d72242007-06-14 17:58:59 +00007
Baptiste Lepilleurf66d3702008-01-20 16:49:53 +00008 doxygen_inputs = env.Glob( includes = '*.dox', dir = '#doc' ) \
9 + env.Glob( includes = '*.h', dir = '#include/json/' ) \
10 + env.Glob( includes = ('*.dox','*.h','*.inl','*.cpp'),
11 dir = '#src/lib_json' )
12## for p in doxygen_inputs:
13## print p.abspath
Christopher Dunnde10f452007-06-14 22:03:11 +000014
Baptiste Lepilleurf66d3702008-01-20 16:49:53 +000015 top_dir = env.Dir('#').abspath
16 include_top_dir = env.Dir('#include').abspath
17 env['DOXYFILE_DICT'] = { 'PROJECT_NAME': 'JsonCpp',
18 'PROJECT_NUMBER': env['JSONCPP_VERSION'],
19 'STRIP_FROM_PATH': top_dir,
20 'STRIP_FROM_INC_PATH': include_top_dir,
21 'HTML_OUTPUT': html_dir,
22 'HTML_HEADER': env.File('#doc/header.html').abspath,
23 'HTML_FOOTER': env.File('#doc/footer.html').abspath,
24 'INCLUDE_PATH': include_top_dir,
25 'PREDEFINED': 'JSONCPP_DOC_EXCLUDE_IMPLEMENTATION JSON_VALUE_USE_INTERNAL_MAP'
26 }
27 env['DOXYFILE_FILE'] = 'doxyfile.in'
28 doxfile_nodes = env.Doxyfile( os.path.join( doc_topdir, 'doxyfile' ), doxygen_inputs )
29 html_doc_path = os.path.join( doc_topdir, html_dir )
30 doc_nodes = env.Doxygen( source = doxfile_nodes,
31 target = os.path.join( html_doc_path, 'index.html' ) )
32 alias_doc_cmd = env.Alias('doc', doc_nodes )
33 env.Alias('doc', env.Install( html_doc_path, '#README.txt' ) )
Baptiste Lepilleur86ccb762009-11-19 13:05:54 +000034 if 'TarGz' in env['BUILDERS']:
35 targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % html_dir )
36 zip_doc_cmd = env.TarGz( targz_path, [env.Dir(html_doc_path)],
37 TARGZ_BASEDIR = env['ROOTBUILD_DIR'] )
38 env.Depends( zip_doc_cmd, alias_doc_cmd )
39 env.Alias( 'doc-dist', zip_doc_cmd )
Baptiste Lepilleurf66d3702008-01-20 16:49:53 +000040##
41## doxyfile = env.SubstInFile( '#doc/doxyfile', 'doxyfile.in',
42## SUBST_DICT = {
43## '%JSONCPP_VERSION%' : env['JSONCPP_VERSION'],
44## '%TOPDIR%' : env.Dir('#').abspath,
45## '%DOC_TOPDIR%' : str(doc_topdir) } )
46## doc_cmd = env.Doxygen( doxyfile )
47## alias_doc_cmd = env.Alias('doc', doc_cmd )
48## env.AlwaysBuild(alias_doc_cmd)
49##
50## for dir in doc_cmd:
51## env.Alias('doc', env.Install( '#' + dir.path, '#README.txt' ) )
52## filename = os.path.split(dir.path)[1]
53## targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % filename )
54## zip_doc_cmd = env.TarGz( targz_path, [env.Dir(dir)],
55## TARGZ_BASEDIR = doc_topdir )
56## env.Depends( zip_doc_cmd, alias_doc_cmd )
57## env.Alias( 'doc-dist', zip_doc_cmd )
58##
59## # When doxyfile gets updated, I get errors on the first pass.
60## # I have to run scons twice. Something is wrong with the dependencies
61## # here, but I avoid it by running "scons doc/doxyfile" first.