Boost logo

Boost-Build :

From: Fredrik Zetterman (fz_at_[hidden])
Date: 2008-02-10 12:36:27


I've been trying to figure out how to share variables across multiple
Jamfiles, and so far I haven't found any info on how to do so. I however
found the following statement on the boost build wiki:

"8. Variables, their usage; local, global variables; accessing variables
cross Jamfiles (again from the above example, I'm unable to access
BOOST_ROOT variable from anywhere else except the Jamfile that declared
it, even with the 'local' keyword dropped from variale declaration)."


A small example from what I'm trying to do:

import os ;
switch [ ]
   case "NT" :
     PLATFORM_EXCLUDE = linux ;
   case "*" :
     PLATFORM_EXCLUDE = win32 ;

# This works fine

build-project source/app ;

#This doesn't work

#Intended usage, should remove all *linux.cpp-files when compiling on NT
or vice versa
exe app
   : [ glob-tree *.cpp : *$(PLATFORM_EXCLUDE).cpp ]

I read that each Jamfile has it's own namespace, and that would explain
why above usage doesn't work.
But is it possible with some tricks (i.e. exporting it somehow)? If so,
what am I missing? And if it's not possible, then what would you recommend
me to do?

Best Regards,
Fredrik Zetterman

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