Boost logo

Boost-Build :

Subject: [Boost-build] Boost.Build Message
From: Ian Emmons (iemmons_at_[hidden])
Date: 2016-09-03 11:48:18


I am attempting to convert a Jamfile's unit-test target into a run target, but I am having trouble getting equivalent behavior. The difficulty comes from a requirement that a certain text file be present in the same directory as the test executable. Here is a simplified version of the original, which works correctly:

   unit-test MyTest
      : [ glob *.cpp ]
        <<library-dependencies>>
      : <include>.
        <dependency>Config.txt
      : # default build
      : # usage requirements
      ;

   explicit Config.txt ;
   make Config.txt : $(SrcDir)/Config.txt : @common.copy ;

Here is my attempt using the run target:

   run [ glob *.cpp ]
        <<library-dependencies>>
      : # arguments
      : # input files
      : <include>.
        <dependency>Config.txt
      : MyTest
      : # default build
      ;

   explicit Config.txt ;
   make Config.txt : $(SrcDir)/Config.txt : @common.copy ;

Here is what goes wrong: With unit-test, the test executable is linked at this path:

../MyTest.test/msvc-14/release/address-model-64/threading-multi/MyTest

and the config file is copied into the same directory. With the run target, the test executable is linked into the same place, but the config file is copied to here:

../msvc-14/release/address-model-64/threading-multi/Config.txt

How can I make the run target behave like the unit-test target? Alternately, why does the common.copy operation inherit unit-test's target directory but not run's?

Thanks in advance,

Ian


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