Boost logo

Boost-Build :

Subject: [Boost-build] Target generation running scripts inside actions
From: Jose . (kasty.jose_at_[hidden])
Date: 2011-06-28 11:08:31


I use boost-build in my project and would like to generate several .CPP and
.H files using a custom Perl script whenever some perl templates with .TPL
extension change. At the same time, those .C and .H are required by other
modules. Right now I'm doing it as follows:

actions generate_FILE1_cpp
    perl "$(SOME_CONSTANT_PATH)/"
    cp $(SOME_CONSTANT_PATH)/auto_generated/FILE1.cpp $(<)
make FILE1.cpp : $(perl_sources) : @generate_FILE1_cpp ;

actions generate_FILE2_cpp
    cp $(SOME_CONSTANT_PATH)/auto_generated/FILE2.cpp $(<)
make FILE2.cpp : FILE1.cpp : @generate_FILE2_cpp ;

# the same scheme is replicated for the N files generated by the perl script
in the first action

lib libALLFILES :
                        # ... N files here ...

It seems to work, but the perl script generates around 10 files, and my
Jamfile gets too dirty with so much replication. I'm sure there is an easy
way to do it, but I'm finding the Boost-Build manual too simple for my
current needs. Can somebody advice a cleaner way to do it?


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