Boost logo

Boost-Build :

From: Gulam Shakir (gshakir_at_[hidden])
Date: 2007-05-16 13:54:19


I am using swig to generate ruby wrappers and depending on where the "bjam" is invoked I need access to directory of the source or the target so that I can change to that directory before running swig. If the directory is not changed, then swig does not find the right headers. I tried using the path.jam methods with no luck.

Any help anyone?

Thanks!

This is what I have:

================
swig.jam
================

import type : register ;
register SWIGTO : swigto : main ;

import type : register ;
register SWIG : swig ;

import feature : feature ;
feature swig-options : : free ;
import toolset : flags ;
flags swig.swigto OPTIONS <swig-options> ;

import path : parent ;
actions rubyswig
{
    echo "src:" $(>) ;
    echo "dest " $(<) ;
    echo "opt: " $(OPTIONS) ;
    echo "top: " $(UTIL) ;
    #cd HOW TO CHANGE DIR ;
    /usr/bin/swig -c++ -ruby -o $(>).cpp $(>)
    #/usr/bin/swig -c++ -ruby -o ruby/profile_wrap.cpp ruby/profile.swig
}

rule swigto ( target : sources * : properties * )
{
    rubyswig $(target) : $(sources) ;
}

import generators : register-standard ;
register-standard swig.swigto : SWIG : SWIGTO ;


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