Boost logo

Boost-Build :

From: Kostas Kostiadis (kos_at_[hidden])
Date: 2006-06-05 09:35:26


Fantastic...that's exactly what I was after...
I've noticed on the example for install here:

http://boost.sourceforge.net/boost-build2/doc/html/bbv2/advanced/builtins/ta
rgets.html#bbv2.builtins.stage

you can specify both EXE and LIB (as install-type) at the same time...
When would you want to use both?
(I'm guessing if you created and application linking to a bunch of static
libs, the install rule will only copy the executable...
Do you specify both if your application is linking against dynamic libs
(i.e. will this install any DLLs that may be required)?)

Also, are there any exapmles of how to use <install-source-root>?

Thanx again,
Kos

-----Original Message-----
From: boost-build-bounces_at_[hidden]
[mailto:boost-build-bounces_at_[hidden]] On Behalf Of Phillip Seaver
Sent: 05 June 2006 13:41
To: Boost.Build developer's and user's list
Subject: Re: [Boost-build] Install rule

Kostas Kostiadis wrote:
> Hello all,
>
> Googling around at the weekend I found out the ms10 was ancient, so I got
> the nightly build and discovered that the install rule will do almost
> exactly what I wanted for my distro...That's the good news :)
>
> However, there is still the issue of renaming the final target.
> Is there a way to do something like
>
> PROJ_NAME = hello ;
>
> Install bin : $(PROJ_NAME)
> : <variant>debug:<name>$(PROJ_NAME)_d
> : <variant>release:<name>$(PROJ_NAME)_r
> ;
>
>
> I know you can do things like <variant>release:<location>bin/release, but
> it's quite important that my executables live in the same place.
> (BTW, this doesn't have to be part of the install rule. If there is a way
> to build the targets like that in the first place, that's even better).
>

You can use the <tag> feature on your "exe" (and "lib", if you need it)
rules. This may be more complicated than you need, though. :-)

For lib and executable files, it adds "_d" to the end of the base name
("foo_d" on Unix and "foo_d.exe" on Windows) for debug builds and "_sym"
for release builds with debugging symbols. For libraries, it adds "_st"
if it's a single-threaded build. It changes the name of the built file,
then all you have to do is do "install name : foo : <location> bin ;"
(note the case of "install").

rule apago_tag ( name : type ? : property-set ) {
   local tags ;
   if [ type.is-subtype $(type) EXE ] || [ type.is-subtype $(type) LIB ] {
      local v = [ $(property-set).get <variant> ] ;
      local suffix ;
      local extension = [ type.generated-target-suffix $(type) :
$(property-set)
 ] ;
      extension = .$(extension) ;
      if $(v) = debug {
         suffix = _d ;
      } else {
         if [ $(property-set).get <debug-symbols> ] = "on" {
            suffix = _sym ;
         }
      }
      if [ type.is-subtype $(type) LIB ] && [ $(property-set).get
<threading> ]
= "single" {
         suffix ?= "" ;
         suffix = $(suffix)_st ;
      }
      if $(suffix) {
         return $(name)$(suffix)$(extension:E="") ;
      }
   }
}

_______________________________________________
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