CMake的试图找到的刺激时,报告“Boost_DIR-NOT_FOUND” [英] CMake reports 'Boost_DIR-NOT_FOUND' when trying to find Boost
问题描述
我想建立一个我的机器上称为CSWNet库。 cmake的可以找到Boost_INCLUDE_DIR和Boost_LIB_DIR但它不能找到称为Boost_DIR一个选项,是包含用于升压一个CMake的配置文件的目录。它在哪里?请帮帮忙,谢谢提前。我得到的错误如下所示,我安装了从Ubuntu库升压和它安装在/ usr /本地。
在/usr/local/share/cmake-2.8/Modules/FindBoost.cmake:429(消息)CMake的错误:
当请求升压的特定版本,则必须至少提供
主要和次要版本号,例如,1.34
(第一最近一次调用)调用堆栈:
演示/的CMakeLists.txt:149(find_package)
看来你误会了意思 Boost_DIR
。
Boost_DIR
是用作提示通过CMake的寻找提升安装目录的环境变量。如果设置为 Boost_DIR-NOTFOUND
,做的不的意思是,它没有找到提振。 Boost_FOUND
用于指示搜索是否成功:
find_package(升压REQUIRED螺纹)
如果(Boost_FOUND)
消息(STATUS成功!)
万一()
在一个成功的搜索的情况下,CMake的也将在配置阶段它看起来像
打印诊断消息 加速版本:1.53.0
发现以下Boost库:
线
I want to build a library called CSWNet on my machine. Cmake can find Boost_INCLUDE_DIR and Boost_LIB_DIR but it cannot find an option called Boost_DIR which is a directory containing a CMake configuration file for Boost. Where is it? Please help, thanks ahead. The error I got is shown below and I installed boost from ubuntu repository and it's installed in /usr/local.
CMake Error at /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:429 (message):
When requesting a specific version of Boost, you must provide at least the
major and minor version numbers, e.g., 1.34
Call Stack (most recent call first):
demos/CMakeLists.txt:149 (find_package)
It seems you misunderstood the meaning of Boost_DIR
.
Boost_DIR
is an environment variable used as a hint by CMake to find the boost installation directory. If this is set to Boost_DIR-NOTFOUND
that does not mean that it did not find Boost. Boost_FOUND
is used to indicate whether the search was successful:
find_package(Boost REQUIRED thread)
if(Boost_FOUND)
message(STATUS "Success!")
endif()
In case of a successful search, CMake will also print a diagnostic message during the configure phase which looks something like
Boost version: 1.53.0
Found the following Boost libraries:
thread
这篇关于CMake的试图找到的刺激时,报告“Boost_DIR-NOT_FOUND”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!