Add SConstruct files to Examples
[senf.git] / Examples / SConscript
1 # -*- python -*-
2
3 Import('env')
4 import SENFSCons, glob, yaptu
5
6 ###########################################################################
7
8 EXAMPLES = []
9 for dox in sorted(glob.glob("*/Mainpage.dox")):
10     title = ([None] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
11                         if '\\mainpage' in line ])[-1]
12     if title:
13         EXAMPLES.append( (dox.split('/',1)[0], title) )
14
15 MAINPAGE="""
16 /** \mainpage Examples
17
18     \htmlonly
19     <dl>
20
21 {{  for name, title in EXAMPLES:
22       <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
23 }}
24
25     </dl>
26     \endhtmlonly
27  */
28 """
29
30 file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
31
32 SConscript(glob.glob("*/SConscript"))
33
34 env.Clean('all','Mainpage.dox')
35 env.Clean('all_docs','Mainpage.dox')
36
37 SENFSCons.Doxygen(env)