$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r63371 - trunk/tools/build/v2/tools
From: steven_at_[hidden]
Date: 2010-06-26 17:08:55
Author: steven_watanabe
Date: 2010-06-26 17:08:54 EDT (Sat, 26 Jun 2010)
New Revision: 63371
URL: http://svn.boost.org/trac/boost/changeset/63371
Log:
Try to make the generation of PNGs from latex a bit more robust.
Text files modified: 
   trunk/tools/build/v2/tools/doxygen.jam |    61 +++++++++++++++++++++++++++++++++++++-- 
   1 files changed, 57 insertions(+), 4 deletions(-)
Modified: trunk/tools/build/v2/tools/doxygen.jam
==============================================================================
--- trunk/tools/build/v2/tools/doxygen.jam	(original)
+++ trunk/tools/build/v2/tools/doxygen.jam	2010-06-26 17:08:54 EDT (Sat, 26 Jun 2010)
@@ -65,6 +65,9 @@
 # Location for images when generating XML
 feature.feature doxygen:xml-imagedir : : free ;
 
+# Indicates whether the entire directory should be deleted
+feature.feature doxygen.rmdir : off on : optional incidental ;
+
 # Doxygen configuration input file.
 type.register DOXYFILE : doxyfile ;
 
@@ -308,6 +311,24 @@
 #
 rule run ( target : source : properties * )
 {
+    if <doxygen.rmdir>on in $(properties)
+    {
+        local output-dir =
+            [ path.make
+                [ MATCH <doxygen:param>OUTPUT_DIRECTORY=\"?([^\"]*) :
+                  $(properties) ] ] ;
+        local html-dir =
+            [ path.make
+                [ MATCH <doxygen:param>HTML_OUTPUT=(.*) :
+                  $(properties) ] ] ;
+        if $(output-dir) && $(html-dir) &&
+            [ path.glob $(output-dir) : $(html-dir) ]
+        {
+            HTMLDIR on $(target) =
+                [ path.native [ path.join $(output-dir) $(html-dir) ] ] ;
+            rm-htmldir $(target) ;
+        }
+    }
     doxygen-action $(target) : $(source) ;
     NAME on $(target) = $(.doxygen) ;
     RM on $(target) = [ modules.peek common : RM ] ;
@@ -319,6 +340,19 @@
                 *.xml ] ] ;
 }
 
+if [ os.name ] = NT
+{
+    RMDIR = rmdir /s /q ;
+}
+else
+{
+    RMDIR = rm -rf ;
+}
+
+actions quietly rm-htmldir
+{
+    $(RMDIR) $(HTMLDIR)
+}
 
 # The rules below require Boost.Book stylesheets, so we need some code to check
 # that the boostbook module has actualy been initialized.
@@ -429,10 +463,29 @@
     local directory = [ path.native
                         [ feature.get-values <doxygen:xml-imagedir> :
                           $(requirements) ] ] ;
+
+    local location = [ on $(target) return $(LOCATE) ] ;
+
+    local pdf-location =
+        [ path.native
+            [ path.join
+                [ path.make $(location) ]
+                [ path.make $(directory) ] ] ] ;
+    local html-location =
+        [ path.native
+            [ path.join
+                .
+                html
+                [ path.make $(directory) ] ] ] ;
+
+    common.MkDir $(pdf-location) ;
+    common.MkDir $(html-location) ;
+
+    DEPENDS $(target) : $(pdf-location) $(html-location) ;
+
     if [ os.name ] = NT
     {
         CP on $(target) = copy /y ;
-        MKDIR on $(target) = mkdir ;
         FROM on $(target) = \\*.png ;
         TOHTML on $(target) = .\\html\\$(directory) ;
         TOPDF on $(target) = \\$(directory) ;
@@ -440,7 +493,6 @@
     else
     {
         CP on $(target) = cp ;
-        MKDIR on $(target) = mkdir -p ;
         FROM on $(target) = /*.png ;
         TOHTML on $(target) = ./html/$(directory) ;
         TOPDF on $(target) = $(target:D)/$(directory) ;
@@ -449,8 +501,6 @@
 
 actions copy-latex-pngs
 {
-    $(MKDIR) $(TOHTML)
-    $(MKDIR) $(<:D)$(TOPDF)
     $(CP) $(>:S=)$(FROM) $(TOHTML)
     $(CP) $(>:S=)$(FROM) $(<:D)$(TOPDF)
     echo "Stamped" > "$(<)"
@@ -594,6 +644,8 @@
             [ new typed-target $(target:S=.dir) : $(project) : DOXYGEN_HTML_MULTIFILE
                 : $(target:S=.tag)
                 : [ targets.main-target-requirements $(requirements)
+                    <doxygen:param>"OUTPUT_DIRECTORY=\"$(output-dir-native)\""
+                    <doxygen:param>HTML_OUTPUT=$(target:B)
                     : $(project) ]
                 : [ targets.main-target-default-build $(default-build) : $(project) ]
                 ] ;
@@ -623,6 +675,7 @@
         {
             doxygen $(target).doxygen-xml-images.html : $(sources)
                 : $(requirements)
+                  <doxygen.rmdir>on
                   <doxygen:param>QUIET=YES
                   <doxygen:param>WARNINGS=NO
                   <doxygen:param>WARN_IF_UNDOCUMENTED=NO