找不到Boost-缺少python3组件

找不到Boost-缺少python3组件,boost,cmake,Boost,Cmake,在ROS2中尝试编译cv_桥时,cmakefind_包未找到boost-python3包 随后出现以下错误: --- stderr: cv_bridge CMake Error at /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message): Could NOT find Boost (missing: python3) (found version

在ROS2中尝试编译
cv_桥
时,cmake
find_包
未找到
boost-python3

随后出现以下错误:

--- stderr: cv_bridge
CMake Error at /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Boost (missing: python3) (found version "1.72.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindBoost.cmake:2145 (find_package_handle_standard_args)
  CMakeLists.txt:32 (find_package)


---
Failed   <<< cv_bridge  [ Exited with code 1 ]
——标准:cv_桥
CMake错误位于/usr/local/ceral/CMake/3.17.1/share/CMake/Modules/findpackagehandlestandardardargs。CMake:164(消息):
找不到Boost(缺少:python3)(找到版本“1.72.0”)
调用堆栈(最新调用优先):
/usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445(\u FPHSA\u FAILURE\u MESSAGE)
/usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindBoost.cmake:2145(查找包、手柄、标准参数)
CMakeLists.txt:32(查找包)
---

失败确保CMake使用内置的Boost CMake文件而不是安装的Boost CMake文件修复了该问题:

colcon构建--symlink安装--cmake args'-DBoost\u NO\u BOOST\u cmake:BOOL=0'

添加CMake参数
-D Boost\u NO\u Boost\u CMake:BOOL=0

如本文所述和引用:

这告诉cmake不要直接使用boost中包含的cmake配置文件。相反,cmake中的配置文件与以前的boost版本一样使用


CMake本身不提供Boost配置文件,它提供FindBoost.CMake模块。您可以添加到FindBoost模块文档的链接。