Boost logo

Boost-Build :

From: TEMPLIE Cédric (cedric.templie_at_[hidden])
Date: 2004-12-21 09:33:14


Hi,

To explain my issue, I explain my configuration.
I have 2 projects 1 and 2.
Project2 uses Project1. The following Jamfiles are in folders of
Project1 and Project2.

#
# Project1
#
project project1
: source-location
: requirements
#MSVC
#DEFINE
#LINKFLAGS
;

# Main target : to build the library and export headers
alias library : project1 export_lib export_headers ;
explicit project1 export_lib export_headers ;

# Files needed to build the project
local cppFiles = [ glob *.cpp *.c ] ;

# Headers to export
local headers = [ glob *.h ] ;

# Build the project from source files
lib project1
: $(cppFiles:BS)
;

# Exports
stage export_headers
: $(headers)
: <location>$(INCLUDE_ROOT)
;

stage export_lib
: project1
: <location>$(LIB_ROOT)
<include-type>LIB
;

#
# Project2
#
project project2
: source-location
: requirements
#MSVC
#DEFINE
#LINKFLAGS
;

# Main target : to build the library and export headers
alias library : project2 export_lib export_headers ;
explicit project2 export_lib export_headers ;

# Files needed to build the project
local cppFiles = [ glob *.cpp *.c ] ;

# Headers to export
local headers = [ glob *.h ] ;

# Build the project from source files
lib project2
: $(cppFiles:BS)
: <source>/project1//library
;

# Exports
stage export_headers
: $(headers)
: <location>$(INCLUDE_ROOT)
;

stage export_lib
: project2
: <location>$(LIB_ROOT)
<include-type>LIB
;

The problem is that I need something like <source> (building the
project1 and use results for building the project2) but when I stage the
project1, I do not want to stage the project2... That is the duplicate
target error I have...

I see that there is <use>, but use do not link with the generated lib,
so I have to specify the name of the lib in linkflags (it is fastidious
as I have 2 names depends on release or debug version).

If someone has an idea to help me ? or if my problem is not enough
clear, do not hesitate to ask ?

One more time, thanks in advance.

TEMPLIE Cédric

 


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