Boost logo

Boost-Build :

Subject: Re: [Boost-build] Compiling dozens of files called main.cpp
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2010-01-19 02:50:10

Boris Schaeling wrote:
> I'm trying to compile dozens of files in countless subdirectories. I
> came up with this simple Jamroot file as all files are called main.cpp:
> import testing ;
> compile [ glob-tree main.cpp ] ;

I think the problem is that the test target name is derived from the first
source file.

Note that compile accepts a third, optional, argument that accepts a
specific target name. Could you try an explicit loop and uniquely name the
targets instead?

[caveat: haven't actually tried this]

import testing ;
import numbers ;

local mains = [ glob-tree main.cpp ] ;
local n = 1 ;

for local m in $(mains)
    compile $(m) : : main.test$(n) ;
    n = [ numbers.increment $(n) ] ;

HTH / Johan

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