Hi,

I’m looking for a way to configure the output of bjam so that I can builds output depending on OS_COMPILER_VARIANT in a bin directory one above my Jamroot.  For example if bjam was invoked on an MSVC configured Windows machine the build would be outputted to:

[Jamroot location]/../bin/windows_msvc_release

I’ve worked out a simple way of doing this, an example is shown below which only depends on the variant – but the code feels wrong; what I am assuming I can do (but can’t get to work) is interrogate the <target-os>, <toolset> and <variant> keys directly from the my rule and generate a return path directly from their values, rather than testing each key in turn to see if it equals some predetermined value.

Googling around I can see that this may be feasible with a property_set, using the get function, but I can’t seem to coax the data into the form that I need.

Could anyone point me in the right direction?

Many thanks,

Phil.

>From my Jamroot:

path-constant TOP : . ;
path-constant INSTALL_ROOT : $(TOP)/../bin ;
path-constant INSTALL_RELEASE : $(INSTALL_ROOT)/release ;
path-constant INSTALL_DEBUG : $(INSTALL_ROOT)/debug ;
path-constant INSTALL_PROFILE : $(INSTALL_ROOT)/profile ;

# The below would be used as such
# install dist_lib : Libname : <conditional>@install-rule
rule install-rule ( properties * )
{    
     local result ;    
     if <variant>debug in $(properties)    
     {        result += <location>$(INSTALL_DEBUG) ;    }    
    else     
    {        
           if <variant>release in $(properties)        
           {            result += <location>$(INSTALL_RELEASE) ;        }  
          else       
          {           
                 if <variant>profile in $(properties)
                {                result += <location>$(INSTALL_PROFILE) ;            }      
          }    
    }        
   return $(result)  ;
}