Boost logo

Boost-Build :

Subject: Re: [Boost-build] May I use conditions with define?
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2011-04-07 12:44:04

Dmitry Timoshenko wrote:
> Hello,
> may I write something like this in requrements section of the project (or lib
> <define>UNICOMM_USE_COMPLEX_XML:<library>/smart//smart_data
> if user passes to bjam define=UNICOMM_USE_COMPLEX_XML
> I tried, but it doesn't matter... or may be it is possible to achive goal by
>another way?
> Thank you.

Hello Dmitry,

As 'define' is a free feature, it is not possible the way you wrote it AFAIK.
You can try this however:

replace <define>UNICOMM_USE_COMPLEX_XML:<library>/smart//smart_data
with <conditional>@use-complex-xml-properties

where use-complex-xml-properties is defined as:
rule use-complex-xml-properties ( properties * )
   if <define>UNICOMM_USE_COMPLEX_XML in $(properties) {
       return <library>/smart//smart_data ;

Or, another approach would be:

import feature ;
feature.feature use-complex-xml : off on : propagated optional composite ;
feature.compose <use-complex-xml>on :
<library>/smart//smart_data <define>UNICOMM_USE_COMPLEX_XML ;

bjam use-complex-xml=on


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at