How to access Beast on Boost 1.66 and 1.67 from CMake

2.8k views Asked by At

I'm trying to make a CMake project with Beast, and it's properly installed from source in /usr/local/include/boost, but I can't get CMake to find it. I though it might have been a 3.10.2, so I tired 3.11.4 and 3.12.0-rc1, but neither worked. Does anyone know what to do?

Environment: Windows CLion 2018.1.5 with Ubuntu 18.04LTS on WSL.

When attempting to run CMake, I get the following error:

CMake Warning at /home/aidan/Apps/cmake-3.11.4-Linux-x86_64/share/cmake-3.11/Modules/FindBoost.cmake:1723 (message):
  No header defined for beast; skipping header check
Call Stack (most recent call first):
  CMakeLists.txt:15 (find_package)


CMake Error at /home/aidan/Apps/cmake-3.11.4-Linux-x86_64/share/cmake-3.11/Modules/FindBoost.cmake:2044 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.67.0

  Boost include path: /usr/local/include

  Could not find the following Boost libraries:

          boost_beast

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:15 (find_package)
1

There are 1 answers

0
vre On BEST ANSWER

Boost beast is a header only library. Header only libraries must not be referenced in a find_package(Boost COMPONENTS ...) call. So remove beast from the find_package(Boost COMPONENTS ... REQUIRED) call.

To find out whether a Boost library is header only or not, please have a look to the following Boost page.