Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2021-10-08 14:40:07


John Maddock wrote:
> I have a regex bug report relating to linking to ICU when using CMake:
> https://github.com/boostorg/regex/issues/143
>
> Is there a correct way to specify in the CMake file that if you use header X,
> then you should also link to library Y, but otherwise not?

I don't see how. CMake doesn't know whether someone will include
header X or not.

With compiled libraries, we use CMake options to control whether the
library is built with support for ICU or not, but here we don't build
anything.

I suppose you could still add a build option that won't do anything
except `target_link_libraries(boost_regex INTERFACE ICU::in)`, as
suggested in the issue (although for consistency the option should
be named BOOST_REGEX_ENABLE_ICU because that's the convention
the other libraries use.)


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