CMake错误:找不到请求的Boost库 我试图安装一个具有提升依赖性的特定C++库。我安装的Boost没有问题,包含路径在/usr/local/include/下

CMake错误:找不到请求的Boost库 我试图安装一个具有提升依赖性的特定C++库。我安装的Boost没有问题,包含路径在/usr/local/include/下,c++,boost,cmake,C++,Boost,Cmake,但是,当我调用cmake时,会出现以下错误: CMake Error at /usr/local/Cellar/cmake/3.3.2/share/cmake/Modules/FindBoost.cmake:1245 (message): Unable to find the requested Boost libraries. Boost version: 0.0.0 Boost include path: /usr/include Detected version of Boost

但是,当我调用cmake时,会出现以下错误:

CMake Error at     
/usr/local/Cellar/cmake/3.3.2/share/cmake/Modules/FindBoost.cmake:1245 (message):
Unable to find the requested Boost libraries.
Boost version: 0.0.0
Boost include path: /usr/include
Detected version of Boost is too old.  Requested version was 1.36 (or newer).
Call Stack (most recent call first):
CMakeLists.txt:10 (FIND_PACKAGE)
我知道Boost include路径不匹配,但我不知道如何让它引用正确的路径。CMakeLists.txt文件调用FIND_包(需要Boost 1.36 COMPONENTS program_选项):我没有看到任何允许我指定路径的参数


谢谢,

您可以使用以下设置增压路径:

SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/.../boost")
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "/.../boost/lib")
确保将其放在CMakeLists.txt中的FIND_包调用之前。
()

这就成功了,谢谢!