问题背景:
我正在尝试编译Limbo,它需要boost/polygon(我们可以检查root/CMakeLists.txt来了解这一点:find_package(Boost 1.55.0 REQUIRED COMPONENTS polygon
)。所以我
- 按照步骤5编译boost
- 然后我得到
boost_install/include
和boost_install/lib
,它们包含boost子组件的头文件和库。但是我在boost_install/lib/
中找不到
libboost_polygon**.so
或libboost_polygon**.a
问题是,编译Limbo
需要polygon
,但我没有它,所以Cmake错误发生:could not find a package configuration file provided by "boost_polygon" with any of the following names: boost_polygonConfig.cmake ....
,有人知道如何解决这个问题吗?谢谢!
Boost多边形仅为头库,不需要编译或构建,因此不需要添加到find_package(Boost ...)
命令中。相反,使用以下表单来链接仅针对Boost头的库:
find_package(Boost 1.55.0 REQUIRED)
add_library(your_library ....)
target_link_libraries(your_library PUBLIC Boost::headers)
查看Boost库是什么不是