Boost logo

Boost :

Subject: Re: [boost] Switch to CMake -- Analysis
From: Artyom Beilis (artyom.beilis_at_[hidden])
Date: 2017-07-21 20:20:42


On Fri, Jul 21, 2017 at 11:14 PM, Roger Leigh via Boost
<boost_at_[hidden]> wrote:
> On 21/07/17 20:53, Artyom Beilis via Boost wrote:
> [...]
>>
>> And this is one of the most basic and trivial feature that exists in every
>> real world build system.
>>
>> And now take a look on this code:
>>
>>
>> https://github.com/artyom-beilis/cppcms/blob/master/booster/CMakeLists.txt#L124
>>
>> Lines 124-145 this is how I search ICU for Boost.Locale
>
>
> Note that you can further simplify this to a single line:
>
> find_package(ICU COMPONENTS uc data i18n)
>
> and then use the imported targets ICU::uc, ICU::data and ICU::i18n to link
> with. Handles all the debug postfixes, alternative library names on Windows
> (dt/data, in/i18n) etc.
> [snip]
> This requires FindICU.cmake, which is provided in newer CMake releases. But
> it's absolutely possible to copy this into your own project to support older
> CMake releases (I do this myself). See
> https://cmake.org/cmake/help/v3.9/module/FindICU.html for further details.
>
>
> Regards,
> Roger
>

You are 100% right except this code dates to days when CMake was about 2.6/2.8.
But indeed it can be updated.

Artyom


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