generator: 1-n targets

View: New views
5 Messages — Rating Filter:   Alert me  

generator: 1-n targets

by Thomas Lehmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

having a dummy.template, how can I implement best
to get a

- dummy.h
- dummy_manager.h
- dummy_manager.cxx

I have seen the 1-to-1 generator example and this is
working well for me but I need three output files
with different names. My python script can do it easily
by the given input "dummy.template" but how can I make
boost recogize the dummy_manager.cxx?

How can I place those headers in another location than
the manager?

sincerely
Thomas

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: generator: 1-n targets

by Anatoly Shirokov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In the attachment there is a example which produces 5 output files.

BR,
Anatoly.

Thomas Lehmann:

> Hi!
>
> having a dummy.template, how can I implement best
> to get a
>
> - dummy.h
> - dummy_manager.h
> - dummy_manager.cxx
>
> I have seen the 1-to-1 generator example and this is
> working well for me but I need three output files
> with different names. My python script can do it easily
> by the given input "dummy.template" but how can I make
> boost recogize the dummy_manager.cxx?
>
> How can I place those headers in another location than
> the manager?
>
> sincerely
> Thomas
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>
>

import type ;
import generators ;
import feature ;
import common ;
import os ;
import "class" : new ;

type.register SDH : sdh ;

class soap-generator : generator
{
    import "class" : new ;

    rule __init__ ( * : * )
    {
        generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
    }

    rule run ( project name ? : property-set : sources * )
    {
        if ! $(sources[2])
        {
            # If no output name is specified, guess it from sources.
            if ! $(name)
            {
               name = [ generator.determine-output-name $(sources) ] ;
            }

            # Accept only single source.
            local t = [ $(sources[1]).type ] ;
            if $(t) = SDH
            {
                local a = [ new action $(sources[1]) : soap.gensrc : $(property-set) ] ;
                local t1 = [ new file-target soapc : CPP : $(project) : $(a) ] ;
                local t2 = [ new file-target soaprolisappserviceproxy : CPP : $(project) : $(a) ] ;
                local t3 = [ new file-target soaph : H : $(project) : $(a) ] ;
                local t4 = [ new file-target soapstub : H : $(project) : $(a) ] ;
                local t5 = [ new file-target soaprolisappserviceproxy : H : $(project) : $(a) ] ;

                return [ virtual-target.register $(t1) ]
                       [ virtual-target.register $(t2) ]
                       [ virtual-target.register $(t3) ]
                       [ virtual-target.register $(t4) ]
                       [ virtual-target.register $(t5) ]
                ;

            }
        }
    }
}

generators.register [ new soap-generator soap.soap : SDH : CPP H ] ;

GSOAP_ROOT = [ os.environ GSOAP_ROOT ] ;
SOAPCPP2 = $(GSOAP_ROOT)/bin/soapcpp2 ;

actions gensrc
{
    $(SOAPCPP2) -I$(GSOAP_ROOT)/import -d$(<[1]:D) -i -C -L -w -x $(>)
}


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: generator: 1-n targets

by Thomas Lehmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Anatoly Shirokov schrieb:
In the attachment there is a example which produces 5 output files.

BR,
Anatoly.

Thomas Lehmann:
  
Hi!

having a dummy.template, how can I implement best
to get a

- dummy.h
- dummy_manager.h
- dummy_manager.cxx

I have seen the 1-to-1 generator example and this is
working well for me but I need three output files
with different names. My python script can do it easily
by the given input "dummy.template" but how can I make
boost recogize the dummy_manager.cxx?

How can I place those headers in another location than
the manager?

sincerely
Thomas

_______________________________________________
Unsubscribe & other changes: 
http://lists.boost.org/mailman/listinfo.cgi/boost-build


    

  


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: generator: 1-n targets

by Thomas Lehmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, for the generator example. Is working great!
One answer is missing:

How can I install the headers to another path?
I can not do something like this:

install headers
    : [ glob-tree ../Binaries/$(HOSTNAME)/Generators/*.h ]
    : <location>Binaries/$(HOSTNAME)/includes
    ;

The glob-tree does not handle parent paths...
How can I run the issue?

sincerely
Thomas

In the attachment there is a example which produces 5 output files.

BR,
Anatoly.

Thomas Lehmann:
  
Hi!

having a dummy.template, how can I implement best
to get a

- dummy.h
- dummy_manager.h
- dummy_manager.cxx

I have seen the 1-to-1 generator example and this is
working well for me but I need three output files
with different names. My python script can do it easily
by the given input "dummy.template" but how can I make
boost recogize the dummy_manager.cxx?

How can I place those headers in another location than
the manager?

sincerely
Thomas

_______________________________________________
Unsubscribe & other changes: 
http://lists.boost.org/mailman/listinfo.cgi/boost-build


    

  


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: generator: 1-n targets

by Anatoly Shirokov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ops, I have missed it.

You can specify the 5-th parameter (it is output directory) of the
file-target command:

     rule run ( project name ? : property-set : sources * )
     {
         if ! $(sources[2])
         {
             local t = [ $(sources[1]).type ] ;
             local n = [ $(sources[1]).name ] ;
             if $(t) = CLS
             {
                local w = [ os.environ WRAPPER_DIR ] ;
                n = $(n:B) ;

                 local a = [ new action $(sources[1]) : wrapper.gensrc :
$(property-set) ] ;

                 local t1 = [ new file-target $(n) : CPP : $(project) :
$(a) : $(w) ] ;
                 local t2 = [ new file-target $(n) : H : $(project) :
$(a) : $(w) ] ;

                 return [ virtual-target.register $(t1) ]
                        [ virtual-target.register $(t2) ] ;

             }
         }
     }

BR,
Anatoly.


Thomas Lehmann :

> Thanks, for the generator example. Is working great!
> One answer is missing:
>
> How can I install the headers to another path?
> I can not do something like this:
>
> install headers
>     : [ glob-tree ../Binaries/$(HOSTNAME)/Generators/*.h ]
>     : <location>Binaries/$(HOSTNAME)/includes
>     ;
>
> The glob-tree does not handle parent paths...
> How can I run the issue?
>
> sincerely
> Thomas
>
>> In the attachment there is a example which produces 5 output files.
>>
>> BR,
>> Anatoly.
>>
>> Thomas Lehmann:
>>  
>>> Hi!
>>>
>>> having a dummy.template, how can I implement best
>>> to get a
>>>
>>> - dummy.h
>>> - dummy_manager.h
>>> - dummy_manager.cxx
>>>
>>> I have seen the 1-to-1 generator example and this is
>>> working well for me but I need three output files
>>> with different names. My python script can do it easily
>>> by the given input "dummy.template" but how can I make
>>> boost recogize the dummy_manager.cxx?
>>>
>>> How can I place those headers in another location than
>>> the manager?
>>>
>>> sincerely
>>> Thomas
>>>
>>> _______________________________________________
>>> Unsubscribe & other changes:
>>> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>>>
>>>
>>>    
>>
>>  
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build