On 8 January 2018 at 16:14, Stephan Menzel via Boost-users <boost-users@lists.boost.org> 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:

set(BOOST_ROOT ${WHERE_MY_THIRD_PARTY_STUFF_IS}/boost-1.66.0
CACHE PATH "set root of boost install")
set(BOOST_INCLUDEDIR ${BOOST_ROOT}/include
CACHE PATH "set boost includes")
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/lib
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): https://gitlab.kitware.com/cmake/cmake/merge_requests/1625
Here is the related discussion: https://gitlab.kitware.com/cmake/cmake/issues/17575

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