|
Boost : |
Subject: Re: [boost] CMake - one more time
From: Paul Fultz II (pfultz2_at_[hidden])
Date: 2016-04-24 22:13:53
> On Apr 24, 2016, at 6:43 PM, Rob Stewart <rstewart_at_[hidden]> wrote:
>
> On April 23, 2016 1:19:08 PM EDT, Paul Fultz II <pfultz2_at_[hidden]> wrote:
>>> On Apr 23, 2016, at 9:30 AM, Raffi Enficiaud
>> <raffi.enficiaud_at_[hidden]> wrote:
>>
>>> Let me (try to) explain my point with an "analogy" with templates vs
>> overloads:
>>>
>>> What cmake can do is:
>>> -------- declare possibly N combinations
>>> targetA(variant1, compilation_options1);
>>> targetA(variant1, compilation_optionsM);
>>> ...
>>> targetA(variantN, compilation_optionM);
>>> --------
>>>
>>> and then consume a subset of the declared combination:
>>>
>>> --------
>>> targetA(variantX, compilation_optionsY);
>>> --------
>>> with 1<= X <= N, 1 <= Y <= M.
>>>
>>>
>>> --------
>>> What BJam can do is:
>>>
>>> --------
>>> template <class variants, class compilation_options>
>>> targetA(variants, compilation_options);
>>>
>>> -------- and then consume any:
>>> targetA(variantX, compilation_optionsY);
>>> --------
>>>
>>> with the same flexibility as templates: the instance of generating a
>> version of targetA is defined at the point it is consumed.
>>
>> I do not follow this analogy at all.
>
> With CMake, you often have to add special cases and conditional logic to account for variations that might be chosen,
Most variations such as shared/static or debug/release are already supported by cmake, so the build script usually doesnât need conditional logic. However,
> those variations have to be chosen in separate invocations, if not in separate build trees.
Yes that is generally true, although I donât consider it very problematic.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk