Boost logo

Boost-Build :

From: Dirk Griffioen (dirk_at_[hidden])
Date: 2007-10-30 15:01:24


Phillip,

I would like to do that is because I have exe's that link to libs which
are built from the same sources but with diffent #defines so the gey get
different names and the exe too etc ... (yes, I know ... :)

Basically there are

a.exe
b.exe
c.exe

but they come in variaties (think link for mysql, link for oracle etc)

a-liba.exe
a-libb.exe
a-libc.exe
b-liba.exe
etc

They should be installed with their canonical name

liba/a.exe
liba/b.exe
libb/a.exe

So it's grouping (e.g. a porting matrix)

Right now they are installed as

liba/a-liba.exe
liba/b-liba.exe
libb/a-libb.exe

(whih is quite logical ...)

So I thought lets rename ... this I can do by either copy them by hand,
have a 'notfile copy target' or a @tag - see below. Thanks for the link!
(It works!)

I do believe restructuring of my code is what's actually needed :), but
this I can only do gradually, so for know this will do.

The general question is still, is it possible to 'rename on
installation' e.g have a <name> property that propagates ...

Regards, Dirk

Appendix:

*copy:*

import notfile ;
import common ;

CP = [ common.copy-command ] ;

actions copy_files
{
  cp-all.sh
}

notfile copy : @copy_files ;

(and 'copy' can be in the depency graph!)

*tag:*

rule a_tag ( name : type ? : property-set ) {
   if [ type.is-subtype $(type) EXE ] {
      local extension = [ type.generated-target-suffix $(type) :
$(property-set) ] ;
      extension = .$(extension) ;
     
     return "a"$(extension:E="") ;
   }
}

exe a-liba.exe
  : a.cpp
    liba
  : <tag>a_tag
  ;

Phillip Seaver wrote:
> Dirk Griffioen wrote, on 10/30/2007 1:21 PM:
>
>> Hi Phillip,
>>
>> I read the post differently
>>
>> exe myExe : myExe.cpp : <name>fooBar.exe ;
>>
>> would mean to me 'build an exe with the name myExe, but on install,
>> rename it to fooBar.exe'
>>
>> but I might have read into it, since that was my problem - hence my
>> answer ...
>>
>
> The "exe" rule just tells Boost.Build how to build an executable. It
> doesn't have anything to do with the install, other than as a source, AFAIK.
>
>
>> the
>> <tag>@apago_tag
>> way would add to a target, I would like strip as in change the target
>> name on installation
>>
>> Would it be possible to change the name of a target on installation?
>>
>
> The sample I gave does add to the output name, but it could, e.g.,
> always change executable names to "a.exe", if you wanted. The reason I
> wrote the rule that way is because I was installing all executables into
> the same directory, and have debug and release versions with the same
> name conflicted. "bjam debug release" would fail because it would see
> that both would have the same installed name and refuse to run.
>
> At least in my copy of Boost.Build (which is a few months behind
> current, I think), the "install" rule doesn't allow <tag> at all and
> doesn't allow <name> if it thinks the target would need to be relinked
> (Boost.Build-compiled executables and libraries). So, I think the
> answer is "No." Out of curiosity, why do you want the name to be
> different when it gets built versus installed? They should be going to
> completely different directories, so there wouldn't be a name conflict...
>
> Phillip
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
>
>

-- 
CodeShop BV
Wenckebachweg 150-B
1096 AB Amsterdam
www.code-shop.com
+31 6 411 92 024


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