CMake doesn't find Boost libraries

前端 未结 5 1536
醉话见心
醉话见心 2020-12-15 06:10

I\'m trying to use a CMake script to compile a Boost-based application on Windows. The header-only libraries work fine, but CMake fails to find the libraries (the following

5条回答
  •  有刺的猬
    2020-12-15 06:53

    I came here with a similar issue and just wanted to say my fix was similar, but not exactly the same.

    My install prefix was C:\lib\boost\boost_1_57_0. I set a BOOST_ROOT environment variable pointing to that directory, but CMake (3.1.0) still couldn't find the headers. I realized the headers defaulted to install to C:\lib\boost\boost_1_57_0\include\boost-1_57\boost. I'm not going to run multiple versions so I just moved the final Boost directory down one and removed the boost-1_57 directory and ended up with headers here:

    C:\lib\boost\boost_1_57_0\include\boost
    

    And CMake found everything.

提交回复
热议问题