|
Boost-Build : |
From: K. Noel Belcourt (kbelco_at_[hidden])
Date: 2006-09-09 00:37:08
On Sep 7, 2006, at 3:35 PM, K. Noel Belcourt wrote:
>
> On Sep 7, 2006, at 3:26 PM, Rene Rivera wrote:
>
>> K. Noel Belcourt wrote:
>>> On Sep 7, 2006, at 2:28 PM, Rene Rivera wrote:
>>>
>>>> K. Noel Belcourt wrote:
>>>>> I've looked at what's done in the Boost distribution but from
>>>>> what I
>>>>> can tell, it seems to require modifications to the Jambase,
>>>>> which I'd
>>>>> rather avoid if possible. Any ideas?
>>>> No need to change Jambase... There's a global var "ARGV" which
>>>> holds all
>>>> the arguments. Take a look at how the Boost Jamfile.v2
>>>> <http://boost.cvs.sourceforge.net/boost/boost/Jamfile.v2?
>>>> revision=1.38&view=markup#l_175>
>>>> handles all the options it uses.
>>
>> Yes ;-) Everything is a module in BBv2 so you need to get the
>> variable
>> from the global module. Use "[ module.peek : ARGV ]" instead of "$
>> (ARGV)".
Okay, one more followup.
I want to initialize a constant using a command line value if one is
supplied by the user or with some default of my choosing if no
argument is supplied. Something like this though clearly this is
illegal since you can't change a constant.
constant sierra-root = [ MATCH "^--sierradir=(.*)" : $(argv) ] ;
sierra-root ?= /sierra/Release ;
So how can I initialize a constant in one step, either with a value
from the command line or with some specified default value.
Any ideas?
-- Noel
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