如何单独编译boost/polygon ?



问题背景:

我正在尝试编译Limbo,它需要boost/polygon(我们可以检查root/CMakeLists.txt来了解这一点:find_package(Boost 1.55.0 REQUIRED COMPONENTS polygon)。所以我

  1. 按照步骤5编译boost
  2. 然后我得到boost_install/includeboost_install/lib,它们包含boost子组件的头文件和库。但是我在boost_install/lib/
  3. 中找不到libboost_polygon**.solibboost_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库是什么不是