Extension support
[senf.git] / senf / Ext / SConscript
1 # -*- python -*-
2
3 Import('env')
4 import SENFSCons, glob, os.path, yaptu
5
6 ###########################################################################
7
8 sconscripts = sorted(glob.glob("*/SConscript"))
9
10 EXTENSIONS = []
11 for script in sconscripts:
12     name = os.path.split(script)[0]
13     dox = os.path.join(name, 'Mainpage.dox')
14     title = ''
15     if os.path.exists(dox):
16         title = ([''] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
17                             if '\\mainpage' in line ])[-1]
18     EXTENSIONS.append((name, title))
19         
20
21 MAINPAGE="""
22 /** \mainpage Extensions
23
24     This folder contains additional SENF extensions which are built
25     into the senf libarary but are not part of senf proper.
26
27     \htmlonly
28     <dl>
29
30 {{  for name, title in EXTENSIONS:
31       <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
32 }}
33
34     </dl>
35     \endhtmlonly
36  */
37 """
38
39 file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
40
41 SConscript(sconscripts)
42
43 env.Clean('all','Mainpage.dox')
44 env.Clean('all_docs','Mainpage.dox')
45
46 SENFSCons.Doxygen(env)