1

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?

genpfault
  • 51,148
  • 11
  • 85
  • 139
YnkDK
  • 681
  • 9
  • 26
  • 1
    http://cmake.3232098.n2.nabble.com/Difficulties-with-component-search-by-FindBoost-tp7585638p7585639.html – llonesmiz Nov 21 '15 at 12:41

1 Answers1

4

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.

Jepessen
  • 11,744
  • 14
  • 82
  • 149