Boost logo

Boost Users :

Subject: Re: [Boost-users] 1.66 changes in layout suffix seems to break cmake finder
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2018-01-08 15:36:30

On 8 January 2018 at 16:14, Stephan Menzel via Boost-users <
boost-users_at_[hidden]> wrote:

> Hello,
> I am currently trying to upgrade my projects to 1.66 and I am puzzled by a
> change in bjam's 'laout' parameter.
> I am building boost for MSVC14 (x64). Normally I use the following command
> line:
> > bjam.exe --layout=versioned variant=release address-model=64
> link=static,shared runtime-link=shared threading=multi stage
> to achieve the build flags and setup that I need.
> Up until 1.65 this yielded libs named like:
> libboost_atomic-vc140-mt-1_65.lib
> This is what appears to be the most flexible for my use case and I always
> discover them using the 'normal' CMake finders like this:
> CACHE PATH "set root of boost install")
> CACHE PATH "set boost includes")
> CACHE PATH "set boost library dir")
> set(Boost_ADDITIONAL_VERSIONS "1.66.0")
> find_package(Boost REQUIRED COMPONENTS ...)
> Now over the years the meaning of the --layout parameter and its defaults
> have occasionally changed by I always managed to get something like this.
> But now, with 1.66 the filenames are changed to that:
> libboost_atomic-vc140-mt-x64-1_66.lib
> With this, CMake won't find the libs anymore. I have tried all different
> variantions of --layout I know (system, tagged, versioned) but I cannot get
> the old naming scheme back. I could rename the files manually but I am a
> bit afraid that this might break some linker (autolink) magick and also it
> doesn't seem right. Trying with several CMake finder options also got me
> nowhere. Using layout system is not desired as I like to quickly
> distinguish between versions on sight.
> So my question is:
> Is there a way to get >=1.66 to build with the filename scheme it had
> until now? Or is there a change to the CMake finders that will fix this?
> Thanks for any suggestions...

Indeed CMake's FindBoost module needs to be uprgaded to be able to find
libs with the new name layout (although it needs to be upgraded each time
there is a boost release anyway...)
I would recommand trying this patch which is imminent to be merged in CMake
(just remplace your local FindBoost.cmake found in your CMake install dir):
Here is the related discussion:

This mean to use the usual find_package( Boost ... ) instead of manually do
the discovery. Just specify BOOST_ROOT in CMake cli to specify the root
directory of your Boost install.

A. Joël Lamotte

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at