Boost logo

Boost :

Subject: Re: [boost] [cmake] Minimum viable cmakeification for Boost
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2017-06-20 13:31:01


Am 20.06.2017 2:30 nachm. schrieb "Thomas Heller" <thom.heller_at_[hidden]>:

On Tue, Jun 20, 2017 at 2:19 PM, Peter Dimov via Boost <
boost_at_[hidden]> wrote:

> "P F" wrote:
>
> - Having things like `::hl` or `::sl` is quite strange. In cmake, I set
>> `BUILD_SHARED_LIBS=On` when I want a shared library or I set it to
>> `BUILD_SHARED_LIBS=Off` when I want a static library. There should only be
>> one target `boost::config` or `boost::system` that I use.
>>
>
> Niall says that using the global BUILD_SHARED_LIBS is a cmake2ism, and
> that explicit targets are preferred nowadays.
>

Niall, can you point me to a reference stating this? Preferably some cmake
documentation telling me what the right(tm) thing to do is.

https://cmake.org/cmake/help/v3.9/command/add_library.html

The cmake docs still documents BUILD_SHARED_LIBS without giving any
alternative.

Any definite source on what a cmake2ism is or is not would be highly
appreciated.

As a general observation, I see a lot of statements along the lines of "I
state that XYZ is preferable over UVW", it would be nice to have to have
background information (pros and cons anyone? what do the cmake
authors/docs have to say about this?) on those statements so that everyone
can form their own opinion instead of having to choose whom to trust about
what's "standard" cmake.

>
> - Doing `if(NOT TARGET boost::assert::hl)` is wrong. A target does not
>> have to exists to be able to link against it.
>>
>
> The second sentence has nothing to do with the first. The if is just to
> detect if the target has already been declared, in order to avoid declaring
> it twice, like an (external) include guard.
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman
> /listinfo.cgi/boost
>


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