2016-02-27 89 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