|
Boost-Build : |
Subject: Re: [Boost-build] doxygen.jam generates wrong INPUTs in doxyfile
From: Simon Cooke (sjcfwd_at_[hidden])
Date: 2014-02-21 10:30:07
On Sat, Feb 1, 2014 at 12:48 PM, Vladimir Prus <ghost_at_[hidden]> wrote:
> On 30.01.2014 19:21, Simon Cooke wrote:
>>
>> Given the following simple project, the doxygen target fails to find
>> the source file when invoked from the Jamroot directory as 'b2
>> src//file.html':
>>
>> *** Jamroot:
>> project : build-dir _build ;
>>
>> *** src/Jamfile:
>> import doxygen : doxygen ;
>> doxygen file.html : file.h ;
>>
>> *** src/file.h:
>> /* empty */
>>
>> ... giving...
>>
>> Warning: tag INPUT: input source `file.h' does not exist
>>
>> In the doxyfile, the following line is generated:
>>
>> INPUT = "file.h"
>>
>> which is invalid when doxygen is invoked from the parent directory.
>>
>> In doxygen.jam (line 310) this is currently generated as follows:
>>
>> for local header in $(sources:G=)
>> {
>> header = [ translate-path $(header) ] ;
>> headers += \"$(header)\" ;
>> }
>>
>> The following change seems to fix the problem for me:
>>
>> for local header in $(sources)
>> {
>> header = [ path.native [ path.root [ path.make $(header:G=) ]
>> [ on $(header) return
>> $(SEARCH) ] ] ] ;
>> header = [ translate-path $(header) ] ;
>> headers += \"$(header)\" ;
>> }
>>
>> Is this the correct way to fix this issue?
>
>
> Hi Simon,
>
> I think it's a right approach, with just a minor improvement. Looking at
> existing code,
> e.g. in link.jam:do-link-recursively, I see this pattern:
>
> local source-path = [ on $(source) return $(LOCATE) ] [ on
> $(source) return $(SEARCH) ] ;
> local absolute-source = [ path.root
> [ path.root [ path.make $(source:G=) ]
> [ path.make $(source-path[1]) ] ]
> [ path.pwd ] ] ;
>
> Which will both in cases where the source is result of some other action,
> and where it has directory
> component.
>
Hi Volodya,
Thank you for your suggestion. I adapted it to give the following modification:
$ git diff
index 6a56ccd..49de625 100644
--- a/src/tools/doxygen.jam
+++ b/src/tools/doxygen.jam
@@ -307,8 +307,12 @@ rule headers-to-doxyfile ( target : sources * :
properties * )
}
local headers ;
- for local header in $(sources:G=)
+ for local header in $(sources)
{
+ local header-path = [ on $(header) return $(LOCATE) ]
+ [ on $(header) return $(SEARCH) ] ;
+ header = [ path.native [ path.root [ path.make $(header:G=) ]
+ [ path.make
$(header-path[1]) ] ] ] ;
header = [ translate-path $(header) ] ;
headers += \"$(header)\" ;
}
I have tested this successfully under Windows (both cmd and cygwin)
and Linux, for both absolute and relative paths and for generated
source files.
Rather than converting each input to an absolute path as in your
example, this still uses relative paths when appropriate.
> Maybe this code can be extracted in a function and used in doxygen.jam? Pull
> requests welcome ;-)
>
If this version looks ok then I'll make a pull request on GitHub.
> Thanks,
> Volodya
Thanks,
Simon
Boost-Build 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