Fail to use self build Boost 1.75 under Ubuntu Linux 20.04 x64 with CMake default and 3.19.4

Looking at the debug output:

-- [ /home/linux/dev/cmake-3.19.4-Linux-x86_64/share/cmake-3.19/Modules/FindBoost.cmake:2072 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-gcc9-mt-1_75;boost_filesystem-gcc9-mt;boost_filesystem-gcc9-mt;boost_filesystem-mt-1_75;boost_filesystem-mt;boost_filesystem-mt;boost_filesystem-mt;boost_filesystem
-- [ /home/linux/dev/cmake-3.19.4-Linux-x86_64/share/cmake-3.19/Modules/FindBoost.cmake:2127 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-gcc9-mt-d-1_75;boost_filesystem-gcc9-mt-d;boost_filesystem-gcc9-mt-d;boost_filesystem-mt-d-1_75;boost_filesystem-mt-d;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem

It looks like the specific versioning pattern in your build isn’t supported by FindBoost. That’s a deficiency which should be fixed.

The simple solution (which I would recommend) is to use “layout=system” which misses off all that nonsense. FindBoost tries its best with “layout=versioned”, but it’s such an ill-specified mixture of stuff, it’s all too easy to make a mistake. To get this perfect every time, we would need to reimplement every bit of versioning logic identically to “b2”, and that’s a really tough challenge, because it’s a unique build system which works differently to everything else out there. We do already hardcode a lot of its rules, but we’re at a great disadvantage trying to keep up. It’s all too easy for certain bits to fall through the cracks.

I was hopeful that the native Boost CMake support would make this work robustly and allow us to retire FindBoost for good. But I’m afraid I’m not personally using Boost at the moment, and I’ve not kept track of where upstream are at with their CMake migration work. I’m afraid I don’t have time to work on this at the moment, but if you wanted to add support for that missing field, it would certainly be appreciated.

Kind regards,
Roger