[CMake] CMake's FindBoost Module Can't Detect Boost Version

Mateusz Loskot mateusz at loskot.net
Tue Dec 17 13:03:27 EST 2019


On Tue, 17 Dec 2019 at 18:43, Osman Zakir <osmanzakir90 at hotmail.com> wrote:
>
> I tried passing -DBoost_COMPILER and -DBoost_DEBUG

That is incorrect!

The options must read  -DBoost_DEBUG=ON
and -DBoost_COMPILER=-vc141 or vc142, depending on
what b2.exe generated in names for your MSVC version.

> but it seems it's only looking for up to Boost 1.71.0; the test versions go up to there only.
> Should I edit the FindBoost.cmake file to have it look for version 1.72.0 as well?

If you have read/searched the FindBoost docs page
https://cmake.org/cmake/help/latest/module/FindBoost.html?highlight=version
you would have learned that you can specify
-DBoost_ADDITIONAL_VERSIONS=1.72

> I don't know about all of the flags I need to pass, but if it can find the Boost version then it should be able to detect all of the stuff on its own, right?

It should, but it still may need hints like Boost_COMPILER, or
Boost_ARCHITECTURE.

FindBoost is a Find-module.
A Find-module is a ***guesser***.
A guesser has right to fail to guess...no hard promises.

https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html

"Unlike a package configuration file, it is not shipped with upstream,
but is used by downstream to find the files by guessing locations of
files with platform-specific hints."

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the CMake mailing list