2016-02-27 59 views
0

我想安装一个具有Boost依赖关系的特定C++库。我安装了Boost没有问题,包含路径在/ usr/local/include /下。CMake错误:无法找到请求的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包括路径不匹配,但我不知道怎么把它引用正确的路径。 CMakeLists.txt文件调用FIND_PACKAGE(Boost 1.36 COMPONENTS program_options REQUIRED):我没有看到任何允许我指定路径的参数。

感谢,

+0

这样做的伎俩,谢谢! – Sean

回答

0

您可以设置升压路径:

SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/.../boost") 
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "/.../boost/lib") 

确保在的CMakeLists.txt的FIND_PACKAGE调用之前放置此。 (Cmake doesn't find Boost