Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62247 - in trunk/tools/build/v2/tools: . doxygen
From: steven_at_[hidden]
Date: 2010-05-26 14:06:16


Author: steven_watanabe
Date: 2010-05-26 14:06:16 EDT (Wed, 26 May 2010)
New Revision: 62247
URL: http://svn.boost.org/trac/boost/changeset/62247

Log:
Handle cygwin vs. windows paths for doxygen
Added:
   trunk/tools/build/v2/tools/doxygen/
   trunk/tools/build/v2/tools/doxygen/windows-paths-check.doxyfile (contents, props changed)
   trunk/tools/build/v2/tools/doxygen/windows-paths-check.hpp (contents, props changed)
Text files modified:
   trunk/tools/build/v2/tools/doxygen.jam | 82 ++++++++++++++++++++++++++++++++++++++-
   1 files changed, 78 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-05-26 14:06:16 EDT (Wed, 26 May 2010)
@@ -37,6 +37,7 @@
 import common ;
 import modules ;
 import project ;
+import utility ;
 
 
 # Use to specify extra configuration paramters. These get translated
@@ -140,6 +141,11 @@
             ECHO "notice:" using doxygen ":" $(.doxygen) ;
         }
 
+ if [ .is-cygwin ]
+ {
+ .is-cygwin = true ;
+ }
+
         .doxproc = [ modules.binding $(__name__) ] ;
         .doxproc = $(.doxproc:D)/doxproc.py ;
 
@@ -170,6 +176,22 @@
     return $(.doxygen) ;
 }
 
+rule .is-cygwin ( )
+{
+ if [ os.on-windows ]
+ {
+ local file = [ path.make [ modules.binding $(__name__) ] ] ;
+ local dir = [ path.native
+ [ path.join [ path.parent $(file) ] doxygen ] ] ;
+ local command =
+ "cd \"$(dir)\" && \"$(.doxygen)\" windows-paths-check.doxyfile 2>&1" ;
+ result = [ SHELL $(command) ] ;
+ if [ MATCH "(Parsing file /)" : $(result) ]
+ {
+ return true ;
+ }
+ }
+}
 
 # Runs Doxygen on the given Doxygen configuration file (the source) to generate
 # the Doxygen files. The output is dumped according to the settings in the
@@ -192,6 +214,48 @@
 }
 
 
+rule translate-path ( path )
+{
+ if [ os.on-windows ]
+ {
+ if [ os.name ] = CYGWIN
+ {
+ if $(.is-cygwin)
+ {
+ return $(path) ;
+ }
+ else
+ {
+ return $(path:W) ;
+ }
+ }
+ else
+ {
+ if $(.is-cygwin)
+ {
+ match = [ MATCH ^(.):(.*) : $(path) ] ;
+ if $(match)
+ {
+ return /cygdrive/$(match[1])$(match[2]:T) ;
+ }
+ else
+ {
+ return $(path:T) ;
+ }
+ }
+ else
+ {
+ return $(path) ;
+ }
+ }
+ }
+ else
+ {
+ return $(path) ;
+ }
+}
+
+
 # Generates a doxygen configuration file (doxyfile) given a set of C++ sources
 # and a property list that may contain <doxygen:param> features.
 #
@@ -205,20 +269,30 @@
     for local param in [ feature.get-values <doxygen:param> : $(properties) ]
     {
         local namevalue = [ regex.match ([^=]*)=(.*) : $(param) ] ;
- text += "$(namevalue[1]) = $(namevalue[2])" ;
         if $(namevalue[1]) = OUTPUT_DIRECTORY
         {
- output-dir = "$(namevalue[2])" ;
+ output-dir = [ translate-path
+ [ utility.unquote $(namevalue[2]) ] ] ;
+ text += "OUTPUT_DIRECTORY = \"$(output-dir)\"" ;
+ }
+ else
+ {
+ text += "$(namevalue[1]) = $(namevalue[2])" ;
         }
     }
 
     if ! $(output-dir)
     {
- output-dir = [ on $(target) return $(LOCATE) ] ;
+ output-dir = [ translate-path [ on $(target) return $(LOCATE) ] ] ;
         text += "OUTPUT_DIRECTORY = \"$(output-dir)\"" ;
     }
 
- local headers = \"$(sources:G=)\" ;
+ local headers = ;
+ for local header in $(sources:G=)
+ {
+ header = [ translate-path $(header) ] ;
+ headers += \"$(header)\" ;
+ }
 
     # Doxygen generates LaTex by default. So disable it unconditionally, or at
     # least until someone needs, and hence writes support for, LaTex output.

Added: trunk/tools/build/v2/tools/doxygen/windows-paths-check.doxyfile
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/tools/doxygen/windows-paths-check.doxyfile 2010-05-26 14:06:16 EDT (Wed, 26 May 2010)
@@ -0,0 +1,3 @@
+INPUT = windows-paths-check.hpp
+GENERATE_HTML = NO
+GENERATE_LATEX = NO

Added: trunk/tools/build/v2/tools/doxygen/windows-paths-check.hpp
==============================================================================


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk