[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-build
Subject:    Re: [Boost-build] doxygen.jam generates wrong INPUTs in doxyfile
From:       Vladimir Prus <ghost () cs ! msu ! su>
Date:       2014-02-21 15:46:45
Message-ID: 530774E5.4000306 () cs ! msu ! su
[Download RAW message or body]

On 21.02.2014 19:30, Simon Cooke wrote:
> On Sat, Feb 1, 2014 at 12:48 PM, Vladimir Prus <ghost@cs.msu.su> 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.

You might as well just send a patch as attachment; I download a patch and apply locally
most of the times anyway.

Thanks,
Volodya

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic