且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CMake 找到 Boost 但导入的目标不适用于 Boost 版本

更新时间:2021-07-03 03:50:02

您的 CMake 版本太旧.更新 CMake,它将起作用.

Your CMake version is too old. Update CMake and it will work.

CMake 无法检测不同 Boost 库之间的依赖关系.它们已在 FindBoost 中明确实现.
对于每个 Boost 版本,此信息由 CMake 维护人员添加,并成为下一个 CMake 版本的一部分.因此,您必须确保您的 CMake 版本是在您尝试找到的 Boost 版本之后发布的.

CMake cannot detect the dependencies between the different Boost libraries. They have explicitly implemented in FindBoost.
For every Boost release this information is added by the CMake maintainers and it gets part of the next CMake release. So you have to make sure, that your CMake version was released after the Boost version you try to find.

Boost 1.63 需要 CMake 3.7 或更新版本.
Boost 1.64 需要 CMake 3.8 或更新版本.
Boost 1.65 和 1.65.1 需要 CMake 3.9.3 或更新版本.
Boost 1.66 需要 CMake 3.11 或更新版本.
Boost 1.67 需要 CMake 3.12 或更新版本.
Boost 1.68、1.69 需要 CMake 3.13 或更新版本.
Boost 1.70 需要 CMake 3.14 或更新版本.
Boost 1.71 需要 CMake 3.15.3 或更新版本.
Boost 1.72 需要 CMake 3.16.2 或更新版本.
Boost 1.73 需要 CMake 3.17.2 或更新版本.
Boost 1.74 需要 CMake 3.19 或更新版本.
Boost 1.75 需要 CMake 3.19.5 或更新版本.
Boost 1.76 需要 CMake 3.20.3 或更新版本.
Boost 1.77 需要 CMake 3.21.3 或更新版本.

Boost 1.63 requires CMake 3.7 or newer.
Boost 1.64 requires CMake 3.8 or newer.
Boost 1.65 and 1.65.1 require CMake 3.9.3 or newer.
Boost 1.66 requires CMake 3.11 or newer.
Boost 1.67 requires CMake 3.12 or newer.
Boost 1.68, 1.69 require CMake 3.13 or newer.
Boost 1.70 requires CMake 3.14 or newer.
Boost 1.71 requires CMake 3.15.3 or newer.
Boost 1.72 requires CMake 3.16.2 or newer.
Boost 1.73 requires CMake 3.17.2 or newer.
Boost 1.74 requires CMake 3.19 or newer.
Boost 1.75 requires CMake 3.19.5 or newer.
Boost 1.76 requires CMake 3.20.3 or newer.
Boost 1.77 requires CMake 3.21.3 or newer.

从 1.77 版开始,Boost 提供了一个 BoostConfig.cmake,它废弃了 FindBoost 和所需的更改.使用

Starting with version 1.77, Boost provides a BoostConfig.cmake that obsoletes FindBoost and the required changes. Using

find_package(Boost CONFIG)

确实排除 FindBoost 文件并仅搜索配置文件.
为了兼容性,CMake 将继续提供 FindBoost.

does exclude the FindBoost file and searches only for the config file.
For compatibility CMake will remain providing FindBoost.