Replace all relative includes with abolute ones
[senf.git] / Examples / SConscript
index cdb256a..c5e6c01 100644 (file)
@@ -1,10 +1,37 @@
-import sys, glob, os.path, datetime
-sys.path.append('senfscons')
+# -*- python -*-
+
 Import('env')
-import SENFSCons
+import SENFSCons, glob, yaptu
 
 ###########################################################################
 
+EXAMPLES = []
+for dox in sorted(glob.glob("*/Mainpage.dox")):
+    title = ([None] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
+                        if '\\mainpage' in line ])[-1]
+    if title:
+        EXAMPLES.append( (dox.split('/',1)[0], title) )
+
+MAINPAGE="""
+/** \mainpage Examples
+
+    \htmlonly
+    <dl>
+
+{{  for name, title in EXAMPLES:
+      <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
+}}
+
+    </dl>
+    \endhtmlonly
+ */
+"""
+
+file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
+
 SConscript(glob.glob("*/SConscript"))
 
-SENFSCons.Doxygen(env)
\ No newline at end of file
+env.Clean('all','Mainpage.dox')
+env.Clean('all_docs','Mainpage.dox')
+
+SENFSCons.Doxygen(env)