Boost logo

Boost-Build :

From: renej_frog (renej.frog_at_[hidden])
Date: 2004-03-18 19:05:20


me again on multiple generated source files from an IDL file using
omniidl. At the moment I'm using the following:

# --- omniidl.jam ---
rule omniidl ( idl_sources : hh_dir : cc_dir )
{
for local f in $(idl_sources)
{
local idl_file = $(f) ;
local hh_file = $(hh_dir)/$(f:B).hh ;
local ccSK_file = $(cc_dir)/$(f:B)SK.cc ;
local ccDynSK_file = $(cc_dir)/$(f:B)DynSK.cc ;
Depends all : $(hh_file) $(ccSK_file) $(ccDynSK_file) ;
Depends $(hh_file) : $(f) ;
Depends $(ccSK_file) : $(f) ;
Depends $(ccDynSK_file) : $(f) ;
make-omniorb-stubs $(hh_file) $(ccSK_file) $(ccDynSK_file) :
$(idl_file) ;
}
}
actions make-omniorb-stubs
{
omniidl -b cxx -Wba -C $(1[2]:D) -I/usr/share/idl/omniORB
-I/usr/share/idl/omniORB/COS $(2)
mv -f $(1[2]:D)/$(2:B).hh $(1[1]:D)/
}
# -------------------

and using it like this:

# --- Jamfile ---
IDL_SOURCES =
Test
;

omniidl ../idl/$(IDL_SOURCES).idl : include/stubs : src/generated ;

SK_DynSK = SK DynSK ;

lib libIDLstubs :
src/generated/$(IDL_SOURCES)$(SK_DynSK).cc
;

# -------------

the result of running omniidl with *.idl are 3 files: *.hh *SK.cc and
*DynSK.cc

when using the Jamfile above I see that the 3 files are generated if
needed, but the generated files are not compiled and hence the library
is not built. Of course, a second to bjam will compile the generated
files and build the library. Am I missing something or am I way off
trying to achive what I want using the above?

there are a couple of constraints:

* the generated source files have extensions .hh and .cc (this is due
to omniidl; you can instruct it to use .hpp and .cpp, but then it
assumes that all generated header files have .hpp extensions... which
is not the case for generated header files I have no control over)

* de IDL files are placed in ../idl/*
The jam files as shown above give problems when I do a bjam in another
directory which relies on the project directory holding the Jamfile
shown above: "don't know how to make ../idl/Test.idl". It seems that
the relative ../idl path in "this" project is also assumed to be
relative in the "other" project.

any help appreciated...

renej

 


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