Boost logo

Boost-Build :

From: Jorge Suit Perez Ronda (josp.jorge_at_[hidden])
Date: 2007-04-23 04:56:01


Andrej van der Zee wrote:
> Hi,
>
> I am new to bjam and now I am struggling with the
> names of targets. I want to build an exe-target with a
> dot in its name ("name.ext"). For example, if I do the
> following:
>
> exe name.ext
> : [ glob *.cpp ]
> ;
>
> It creates an executable called "name" instead of
> "name.ext".
>
> Also, I want to build an Apache module (a shared
> library) that is called "mod_name.so". When I use
> something like this:
>
> lib mod_name
> : [ glob *.cpp ]
> ;
>
> It prepends "lib" to the name.
>
> Is there anyway to have more control over the target
> names? How can I fix this?
>
>
You can use the <tag> feature

for instance, the following piece of code build the name of the shared
module without the "lib" prefix:

import type ;

rule tag ( name : type ? : property-set )
{
    if $(type) = SHARED_LIB
    {
        local suffix = [ type.generated-target-suffix $(type)
                                                      : $(property-set) ] ;
        suffix = .$(suffix) ;
        return $(name)$(suffix:E="") ;
    }
}

lib mod_name
   : [ glob *.cpp ] : <tag>@tag
   ;

documentation for <tag> feature can be found at:

http://boost.org/boost-build2/doc/html/bbv2/advanced/builtins/features.html

hope it helps,

best regards

Jorge

> Thanks,
>
> Andrej
>
>
>
>
>
> ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
> now.
> http://uk.answers.yahoo.com/
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
>
>


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