Cmake找不到Boost文件夹

时间:2012-10-14 22:36:38

标签: c++ visual-c++ boost cmake

我正在使用Windows 7 - 64位,我正在尝试构建一个项目。当我使用cmake时,我得到了错误

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoos
t.cmake:1191 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  src/CMakeLists.txt:310 (find_package)


CMake Error at src/CMakeLists.txt:312 (message):
  Boost C++ libraries not found.  Please install or try setting BOOST_ROOT

我已将变量设置为BOOST_ROOT到D:\ MyProject \ boost_1_43_0 \ boost \ 但我仍然得到这个。我该如何解决这个问题。

1 个答案:

答案 0 :(得分:1)

在项目的子文件夹中放置boost不是用于定位提升的标准CMake练习。我已经在程序文件中安装了x64 - MSVC 2010,CMake会自动找到它。

Boost_DIR : C:/Program Files/Boost/share/cmake/boost
Boost_INCLUDE_DIR : C:/Program Files/Boost/include

您也可以尝试在系统环境变量级别设置Boost_DIR。