Boost logo

Boost-Build :

Subject: [Boost-build] path-constant in Jamroot does not work in subdirs
From: Andrej van der Zee (andrejvanderzee_at_[hidden])
Date: 2012-06-12 22:13:31


Hi,

Since some upgrades I found that I can only build my project from the
root directory with the Jamroot file. It seems to have some problems
with the path-constant, which I did not have before. In my Jamroot:

import os ;
using gcc ;
path-constant TOP : . ;

if [ os.environ INSTALL_PATH ] = ""
{
        path-constant INSTALL_PATH : /mbrace ;
}
else
{
        path-constant INSTALL_PATH : [ os.environ INSTALL_PATH ] ;
}

project root
   : requirements
                 <include>$(TOP)
                 <variant>debug:<define>TCPIP_DEBUG
                                                                 <dll-path>$(INSTALL_PATH)/lib
                 <define>_INSTALL_PATH=$(INSTALL_PATH)
                 <define>_SOURCE_PATH=$(TOP)
                  <threading>multi
   ;

use-project /libs/core : core ;

build-project core ;
build-project pcap-parser ;

Then in the Jamfiles in subdirectories I use the INSTALL_PATH like this:

lib pcap_compress
        : [ glob *.cpp : main.cpp ]
    <...cut...>
        ;

exe pcap-compress
        : main.cpp
   <...cut...>
        : <include>..
        ;

build-project regression-tests ;

install $(INSTALL_PATH)/bin : pcap-compress ;

And this gives me the following errors:

andrej_at_amd64:~/git/tcpip/pcap-parser/compress$ bjam
../../pcap-parser/dt/Jamfile:29: in modules.load
*** argument error
* rule install ( name : sources * : requirements * : default-build * )
* called with: ( : pcap-dt )
* missing argument name
/usr/share/boost-build/tools/stage.jam:499:see definition of rule
'install' being called
/usr/share/boost-build/build/project.jam:314: in load-jamfile
/usr/share/boost-build/build/project.jam:62: in project.load
/usr/share/boost-build/build/project.jam:766: in project.use
/usr/share/boost-build/build/project.jam:89: in load-used-projects
/usr/share/boost-build/build/project.jam:73: in load
/usr/share/boost-build/build/project.jam:115: in load-parent
/usr/share/boost-build/build/project.jam:464: in initialize
/usr/share/boost-build/build/project.jam:309: in load-jamfile
/usr/share/boost-build/build/project.jam:62: in load
/usr/share/boost-build/build/project.jam:115: in load-parent
/usr/share/boost-build/build/project.jam:464: in initialize
/usr/share/boost-build/build/project.jam:309: in load-jamfile
/usr/share/boost-build/build/project.jam:62: in load
/usr/share/boost-build/build/project.jam:168: in project.find
/usr/share/boost-build/build-system.jam:570: in load
/usr/share/boost-build/kernel/modules.jam:283: in import
/usr/share/boost-build/kernel/bootstrap.jam:142: in boost-build
/usr/share/boost-build/boost-build.jam:8: in module scope

When I replace INSTALL_PATH with an absolute path or when I run bjam
from the Jamroot-directory, it works fine. What happened?

Thank you,
Andrej


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