【问题标题】:cmake-Unable to find the requested Boost librariescmake - 找不到请求的 Boost 库
【发布时间】:2017-09-22 10:10:26
【问题描述】:

我想使用 CGAL 库,我正在使用: CGAL 4.10 ,Microsoft Visual Studio 2013 , CMake 3.9.3 , boost 1.65, QT creator 4.3.1

使用 Cmake 配置 CGAL 时,显示以下错误:

Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE  
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1902 (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):
cmake/modules/CGAL_SetupBoost.cmake:21 (find_package)
cmake/modules/CGAL_SetupDependencies.cmake:85 (include)
CMakeLists.txt:681 (include)


Boost include:     Boost_INCLUDE_DIR-NOTFOUND
Boost libraries:   
Boost definitions: 
USING BOOST_VERSION = '..'
== Detect external libraries (DONE) ==

== Write compiler_config.h ==
Performing Test CGAL_CFG_DENORMALS_COMPILE_BUG - Success
Performing Test CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG - Success
Performing Test CGAL_CFG_IEEE_754_BUG - Success
Performing Test CGAL_CFG_ISTREAM_INT_BUG - Success
Performing Test CGAL_CFG_MATCHING_BUG_5 - Success
Performing Test CGAL_CFG_MATCHING_BUG_6 - Failed
Performing Test CGAL_CFG_MATCHING_BUG_7 - Failed
Performing Test CGAL_CFG_MATCHING_BUG_8 - Success
Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Failed
Performing Test CGAL_CFG_NO_LIMITS - Success
Performing Test CGAL_CFG_NO_NEXTAFTER - Failed
Performing Test CGAL_CFG_NO_STL - Success
Performing Test CGAL_CFG_NUMERIC_LIMITS_BUG - Success
Performing Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG - Success
Performing Test CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG - Success
Performing Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG - Success
Performing Test CGAL_CFG_USING_BASE_MEMBER_BUG_2 - Success
== Write compiler_config.h (DONE) ==


CMake Error: The following variables are used in this project, but they     are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the  CMake files:
Boost_INCLUDE_DIR (ADVANCED)
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL_Core
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL_Core
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL_ImageIO
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL_ImageIO

我将 Boost_INCLUDE_DIR,BOOST_ROOT 手动添加到环境变量中

Boost_INCLUDE_DIR=C:\dev\boost_1_65_0;BOOST_ROOT=C:\dev\boost_1_65_0

我用visual sutudio 2015、2013尝试了许多版本的boost、cmake和cgal,但都没有工作

感谢您的帮助。谢谢

【问题讨论】:

  • 错误信息告诉你设置BOOST_INCLUDEDIR,而不是Boost_INCLUDE_DIR
  • 我尝试了您的解决方案,它显示相同的错误:无法找到 Boost 头文件。请将 BOOST_ROOT 设置为包含 Boost 的根目录或 BOOST_INCLUDEDIR 设置为包含 Boost 标头的目录。
  • C:\dev\boost_1_65_0的内容是什么?
  • Boost 包(boost、doc、libs、status、tools、更多)文件夹
  • 我建议你安装 boost 这样你就只有<prefix>/include<prefix>/lib。这样CMake更容易找到它,然后只需要设置BOOST_ROOT即可。

标签: visual-studio qt cmake cgal cmake-gui


【解决方案1】:

如果你使用的是 Cygwin,你可以使用 cmake-gui 并使用界面来填充你的路径,这限制了拼写错误的风险,并且更容易找到丢失的字段。 另一种选择是在构建目录中编辑 hte CMakeCache.txt 以提供路径,因此您不必将变量声明为环境变量。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-21
    • 2019-02-06
    • 2018-08-20
    • 1970-01-01
    • 2011-12-26
    • 1970-01-01
    相关资源
    最近更新 更多