CMake Boost 名称不匹配警告

在CMake中查找Boost库时,使用的名称应为Boost,而不是boost。如果使用的boost则会报告以下警告:

1> [CMake] CMake Warning (dev) at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
1> [CMake]   The package name passed to `find_package_handle_standard_args` (Boost) does
1> [CMake]   not match the name of the calling package (boost).  This can lead to
1> [CMake]   problems in calling code that expects `find_package` result variables
1> [CMake]   (e.g., `_FOUND`) to follow a certain pattern.
1> [CMake] Call Stack (most recent call first):
1> [CMake]   C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.28/Modules/FindBoost.cmake:2392 (find_package_handle_standard_args)
1> [CMake]   D:/3rd/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
1> [CMake]   D:/3rd/vcpkg/scripts/buildsystems/vcpkg.cmake:813 (include)
1> [CMake]   src/AtsCore/CMakeLists.txt:9 (find_package)
1> [CMake] This warning is for project developers.  Use -Wno-dev to suppress it.

将名称改为正确的Boost即可解决该警告

#find_package(boost COMPONENTS system REQUIRED) # 错误
find_package(Boost COMPONENTS system REQUIRED) # 正确
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值