CMake Boost 1.59.0几何

时间:2015-11-21 12:33:09

标签: c++ boost boost-geometry

我对使用boost和C ++很新。我刚刚安装了Boost 1.59.0,我想使用几何库。

如果我包含FIND_PACKAGE( Boost 1.47 REQUIRED ),它会发现提升并且不会出现任何问题。如果我然后包含FIND_PACKAGE( Boost 1.47 COMPONENTS geometry REQUIRED ),我会收到以下错误:

 Unable to find the requested Boost libraries.

  Boost version: 1.59.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_geometry

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

如果我在CLI中运行以下[ -f /usr/include/boost/geometry/geometry.hpp ] && echo "Found" || echo "Not found",我会得到Found。所以它似乎就在那里,但CMake告诉我它不是。

我误解了什么?

1 个答案:

答案 0 :(得分:0)

只有构建的库才需要

COMPONENTS。 Geometry是一个仅限标题的库,因此不需要它。您只需找到提升标题位置。