5
votes

I am trying to compile a program using Boost with CMake under Mac OS X.

I have got the following error:

CMake Error at /Applications/CMake.app/Contents/share/cmake-3.4/Modules/FindBoost.cmake:721 (file): file STRINGS file "/Users/.../src/boost_1_60_0/boost/boost/version.hpp" cannot be read. Call Stack (most recent call first): CMakeLists.txt:44 (find_package)

Boost version: 0.0.0

Indeed, when I go inside boost_1_60_0/boost, there isn't a folder called boost.

Is my FindBoost not up-to-date?

1
Are you giving hints? Then you have to drop the last boost and only pass the path until the /src.usr1234567
boost-1.60 is too new. I had to add set(Boost_ADDITIONAL_VERSIONS "1.60" "1.60.0") before the find package to find boost even with the latest cmake-3.4.1.drescherjm

1 Answers

4
votes

I beleive that you set your env wrong ! try to set entry BOOST_INCLUDE_DIR = "/Users/.../src/boost_1_60_0" It looks like you are getting it directly to /boost_1_60_0/boost which won't work as your CMAKE will look for the verion.hpp in BOOST_INCLUDE_DIR/boost/ folder.

BTW, are you sure that the version.hpp is not there ? that's strange !

Cheers