|
Boost-Build : |
From: Johannes Brunen (JBrunen_at_[hidden])
Date: 2004-05-07 01:52:02
Hi,
I have found a hack solution to the globbing problem:
"Johannes Brunen" writes:
>> I have a problem with the globbing operation. I have a build tree
>> which has the following structure:
>> (Upper case words are directories, lowercase words are files and text
>> between brackets is the file's context.)
>>
>> ROOT
>> jamfile (
>> project-root ;
>>
>> project ROOT
>> : requirements <threading>multi
>> ;
>>
>> PROJECT_ROOT_DIR = . ;
>>
>> build-project CPP/KERNEL/SYSKERNELl/SYSTEM ;
>> )
>> boost-build.jam (
>> boost-build C:/Development/Libraries/boost/boost/tools/build/v2 ;
>> )
>> project-root.jam ()
>> CPP
>> KERNEL
>> SYSKERNEL
>> SYSTEM
>> INC
>> a.hxx
>> b.hxx
>> ...
>> SRC
>> a.cxx
>> b.cxx
>> ....
>> jamfile (
>> project system
>> : usage-requirements <include>inc
>> : requirements <link>static
>> : source-location src
>> ;
>>
>> lib system : [ glob *.cxx ] ;
>> )
>>
>>
>> What I have in mind is that the system lib should be build from all
>> the files in the system's src directory.
"Dave Abrahams" writes:
>
>
>Seems like you need
>
> lib system : [ glob SRC/*.cxx ] ;
>
>in that case, no?
I added to the file boost/tools/build/v2/build/project.jam the following code
# This module defines rules common to all projects
module project-rules
{
....
rule globex ( subdir wildcards + )
{
import path ;
import project ;
local location = [ project.attribute $(__name__) location ] ;
local all-paths = [ path.glob $(location)/$(subdir) : $(wildcards) ] ;
return $(all-paths:D="") ;
}
}
and called it in my jamfile this way:
lib system : [ globex src *.cxx ] : <include>inc ;
This works fine but I would prefere a solution using the predefined glob rule
in the way Dave Abrahams suggested.
If such a solution does not exists is it possible to add a rule like globexto
project.jam?
Any suggestions?
With best regards
Johannes
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