Boost logo

Boost :

Subject: Re: [boost] [test] How to execute shell commands
From: Mike Dev (mike.dev_at_[hidden])
Date: 2018-10-18 14:01:04


> -----Original Message-----
> From: Boost <boost-bounces_at_[hidden]> On Behalf Of Steven Watanabe via Boost
> Sent: Wednesday, October 17, 2018 7:19 PM
>
> I would recommend using a make target (warning untested):
>
> make CMakeCache.txt : CMakeLists.txt : @echo ;
> always CMakeCache.txt ;
>
> actions echo
> {
> cmake -S "$(>:D)" -B $(<:D)
> cmake --build "$(<:D)"
> }
>
> Note 1: The directory will be created automatically.
> Note 2: Avoiding cd simplifies the path handling a lot.
> Note 3: This could probably be split into two separate actions.

Thanks you very much, that got me mostly there.
In cmake versions older than 3.13 this apparently has to be

actions echo
{
    cmake -H"$(>:D)" -B$(<:D)
    cmake --build "$(<:D)"
}

(no space between B and the path and -H instead of -S).

Now I only need a way to properly hook this up, so it gets only re-run, if one of the cmake files change.

Best

Mike


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk