Variant as variable.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Variant as variable.

Bernhard Glück
Very short question:
How can i get the current variant into a variable ( not in a target )
e.g something like
local variantName = getvariant ;

which should set variantName to debug,release or profile ( with the
standard defined variants )
Or would there be another easiert way to customize a directory for
installation ?
We have a quite large library in development and want to install all
built files in directories like
Distribution/Platform/LinkStyle/Variant

Right now i create a path-constant with the install directory out of
platform and link styles but i can't get the variant name as a string.

Thanks
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Variant as variable.

Vladimir Prus
On Monday 06 February 2006 03:17, Bernhard Glück wrote:

> Very short question:
> How can i get the current variant into a variable ( not in a target )
> e.g something like
> local variantName = getvariant ;
>
> which should set variantName to debug,release or profile ( with the
> standard defined variants )
> Or would there be another easiert way to customize a directory for
> installation ?
> We have a quite large library in development and want to install all
> built files in directories like
> Distribution/Platform/LinkStyle/Variant
>
> Right now i create a path-constant with the install directory out of
> platform and link styles but i can't get the variant name as a string.
If you're really brave, you can take the attached patch, apply it to your
Boost.Build, and then use something like:

  exe a : a.cpp ;

  install dist : a : <indirect-conditional>$(__name__).mess-with-properties ;

  rule mess-with-properties ( properties * )
  {
      if <variant>debug in $(properties)
       {
           return <location>MYDEBUG ;
       }
  }

The patch is work-in-progress on http://zigzag.cs.msu.su/boost.build/ticket/23 
and will be done in a couple of days, so you might just wait a bit until the
interface and semantics is finalized.

- Volodya

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

indirect-conditional.diff (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Variant as variable.

Vladimir Prus
On Monday 06 February 2006 18:44, Vladimir Prus wrote:

>   exe a : a.cpp ;
>
>   install dist : a : <indirect-conditional>$(__name__).mess-with-properties
> ;
>
>   rule mess-with-properties ( properties * )
>   {
>       if <variant>debug in $(properties)
>        {
>            return <location>MYDEBUG ;
>        }
>   }
>
> The patch is work-in-progress on
> http://zigzag.cs.msu.su/boost.build/ticket/23 and will be done in a couple
> of days, so you might just wait a bit until the interface and semantics is
> finalized.

The patch, test, and docs are checked in. You can read about the syntax at:

http://boost.org/boost-build2/doc/html/bbv2/advanced/targets.html#id2572031

and you might also want to check a new FAQ entry:

http://boost.org/boost-build2/doc/html/bbv2/faq.html#id2577795

Let me know if this works for you.

- Volodya

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