Boost logo

Boost-Build :

Subject: [Boost-build] Copying source file required by target
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2018-07-26 17:08:30


I'm trying to replicate this CMake'ism for BBv2


I'm trying to achieve that with the make rule and simple actions:

make mwe.cpp : : @copy_mwe_if_not_exists ;
actions copy_mwe_if_not_exists { cp $(>) $(<) }
exe mwe : mwe.cpp : ;

Basically, this works, but there is one major issue"
- it creates source file in bin/mwe.cpp.
How can I force it to create mwe.cpp in the same directory as

I've tried to hack it modifying target path using the variables
expansion, but without luck.

I have also tried to follow the BBv2 generate example based on
file-target and common.copy action:
But constructing a target seems like an overkill for my purpose.
And, the rule (or common.copy) also creates file in `bin` directory.

BTW, I am aware the `copy_mwe_if_not_exists` is incomplete regarding its name:
- it will have to use cp or copy depending on OS
- it will have to check if file exists

Best regards,

Mateusz Loskot,

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