Friday, February 28, 2025

Re: [revision] devel/boost: Install BoostConfig.cmake

Le Fri, Feb 28, 2025 at 05:10:44PM +0000, Johannes Thyssen Tishman a écrit :
> From [1]:
> > CMake 3.29 and below provide a FindBoost module, but it needs constant
> > updates to keep up with upstream Boost releases. Upstream Boost 1.70
> > and above provide a BoostConfig.cmake package configuration file.
> > find_package(Boost CONFIG) finds the upstream package directly,
> > without the find module.
> >
> > CMake 3.30 and above prefer to not provide the FindBoost module so
> > that find_package(Boost) calls, without the CONFIG or NO_MODULE
> > options, find the upstream BoostConfig.cmake directly. This policy
> > provides compatibility for projects that have not been ported to use
> > the upstream Boost package.
> >
> > The OLD behavior of this policy is for find_package(Boost) to load
> > CMake's FindBoost module. The NEW behavior is for find_package(Boost)
> > to search for the upstream BoostConfig.cmake.
> >
> > This policy was introduced in CMake version 3.30. It may be set by
> > cmake_policy() or cmake_minimum_required(). If it is not set, CMake
> > warns, and uses OLD behavior.
>
> So if a project explicitly sets a policy version >= 3.30, CMake won't
> look for the FindBoost.cmake module installed by devel/cmake/core and
> will instead look for the BoostConfig.cmake file which our devel/boost
> does not install.

i have bumped into some ports where it was also an issue, cant remember
right now, but this is the way to go. a variable for 1.84.0 would be
welcome to avoid the PLIST churn at each update.

No comments:

Post a Comment