Cmake没有find提升1.51(Windows 8)

我正在编译mlpack( http://www.mlpack.org/ ),它需要提升。 首先,我安装了boostpro 1.51( http://www.boostpro.com/download/ ),boost已经安装在C:\ Program Files \ boost \ boost_1_51

然后我用cmake和mingw32-make编译并安装了armadillo(mlpack的另一个依赖)。 Boost也是犰狳的依赖。 遵循一些build议( Cmake没有findBoost ),我添加到CMakeLists文件中:

SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:\\Program Files\\boost\\boost_1_51") SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:\\Program Files\\boost\\boost_1_51\\lib") 

事情进展顺利。

现在我正在尝试运行mlpack上的CMake,但得到这个错误:

CMake错误在C:/ Program Files(x86)/ CMake 2.8 / share / cmake-2.8 / Modules / FindBoos t.cmake:1192(message):无法find请求的Boost库。

升压版本:1.51.0

提升包含path:C:/ Program Files / boost / boost_1_51

以下Boost库无法find:

  boost_program_options boost_unit_test_framework 

没有findBoost库。 您可能需要将BOOST_LIBRARYDIR设置为包含Boost库的目录,或者将BOOST_ROOT设置为Boost的位置。 调用堆栈(最近的调用优先):CMakeLists.txt:192(find_package)

我试图添加(至于犰狳),但没有改善:

 SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:\\Program Files\\boost\\boost_1_51") SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:\\Program Files\\boost\\boost_1_51\\lib") 

然后我试着补充一下:

 set(BOOST_ROOT "C:\\Program Files\\boost\\boost_1_51") set(BOOST_INCLUDEDIR "C:\\Program Files\\boost\\boost_1_51") set(BOOST_LIBRARYDIR "C:\\Program Files\\boost\\boost_1_51\\lib") 

对于BOOST_INCLUDEDIR,我真的不知道我应该指出哪个文件夹。 boost_1_51包含:bin,boost,dist,doc,lib,libs,more

我也试过这个( cmake使用错误的cboost库 ),没有成功。

我也有点困惑,因为犰狳似乎编译没有问题(或我错过了什么?)

非常感谢

注意:cmakelists文件的内容:

 #Unfortunately this configuration variable is necessary and will need to be #updated as time goes on and new versions are released. set(Boost_ADDITIONAL_VERSIONS "1.41" "1.41.0" "1.42" "1.42.0" "1.43" "1.43.0" "1.44" "1.44.0" "1.45.0" "1.46.0" "1.46.1" "1.47.0" "1.48.0" "1.49.0" "1.51.0") find_package(Boost COMPONENTS program_options unit_test_framework REQUIRED ) include_directories(${Boost_INCLUDE_DIRS}) 

我自己加了1.51.0。


从我从另一个post了解( CMake没有findBoost ),这可能与找不到正确名称的库有关。 在我的lib文件夹中我有(dll和lib文件):

 boost_program_options-vc80-mt-1_51.dll boost_program_options-vc80-mt-gd-1_51.dll boost_program_options-vc100-mt-1_51.dll boost_program_options-vc100-mt-gd-1_51.dll 

不知何故,我应该玩像命令一样

 set(Boost_USE_MULTITHREADED ON) 

所以它会寻找与预期的名称的lib