Boost logo

Boost :

Subject: Re: [boost] Switch to CMake -- Analysis
From: Roger Leigh (rleigh_at_[hidden])
Date: 2017-07-21 20:14:19

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:
> 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. It's basically what you're doing,
but a bit more comprehensive and flexible (by using the imported
targets, you allow for /export/ of the target configuration for use by
end users and downstream components).

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 for further details.


Boost list run by bdawes at, gregod at, cpdaniel at, john at