CMake Boost 1.59.0 geometry

霸气de小男生 提交于 2019-12-24 17:42:02

问题


I am fairly new to using boost along with C++. I have just installed Boost 1.59.0 and I want to use the geometry library.

If I include FIND_PACKAGE( Boost 1.47 REQUIRED ) it finds boost and no problems arises. If I then include FIND_PACKAGE( Boost 1.47 COMPONENTS geometry REQUIRED ) I get the following error:

 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.

If I run the following [ -f /usr/include/boost/geometry/geometry.hpp ] && echo "Found" || echo "Not found" in the CLI I get Found as a result. So it seems that it's there, but CMake tells me it's not.

What am I misunderstanding?


回答1:


COMPONENTS is required only for built libraries. Geometry is an header-only library so it's not needed. You need only to find the boost headers location.



来源:https://stackoverflow.com/questions/33843400/cmake-boost-1-59-0-geometry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!