[Scons-users] Scons and external file generator

Dirk Bächle tshortik at gmx.de
Mon Nov 17 12:03:30 EST 2014


Hi,

On 17.11.2014 11:20, Непомнящий Евгений Игоревич wrote:
> Hello!
>
> I have external generator gen.exe, which receive input file and generate some
> .h and .cpp files from it (names and quantity depends on input file)
>
> Suppose, I have gen.in, and generator create gen/a.h and gen/a.cpp.
> Also I have b.cpp, which include gen/a.h
>
> How to write sconstruct file to call gen.exe, enumerate cpp files in
> directory gen and build program from gen/a.cpp and b.cpp?
what you want to do is define a Builder/Tool for your application 
"gen.exe", and then add a customized Emitter. How this can be done is 
described at

   http://scons.org/wiki/ToolsForFools

. In the Emitter, you then have to parse your input file (*.in) and 
return the proper lists of "targets" and "sources" for your build step. 
If you get stuck while doing this, continue to ask questions please. ;)

Good luck and best regards,

Dirk




More information about the Scons-users mailing list