欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > linux >内容正文

linux

linux cmake变量,linux – CMake错误:此项目中使用了以下变量,但它们设置为NOTFOUND...

发布时间:2025/3/11 linux 111 豆豆
生活随笔 收集整理的这篇文章主要介绍了 linux cmake变量,linux – CMake错误:此项目中使用了以下变量,但它们设置为NOTFOUND... 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

我正在尝试使用tar文件whalebot-0.02.00.tar.gz配置whalebot爬虫.我已正确提取它:

root@Admin1:~/dls# tar xvzf whalebot-0.02.00.tar.gz

之后我想配置它:

root@Admin1:~/dls/whalebot# ./configure

它给了我错误:

bash: ./configure: No such file or directory

我也运行了命令:

root@Admin1:~/dls/whalebot# cmake ./

它给了我以下结果:

root@Admin1:~/dls/whalebot# cmake ./

-- The C compiler identification is GNU

-- The CXX compiler identification is GNU

-- Check for working C compiler: /usr/bin/gcc

-- Check for working C compiler: /usr/bin/gcc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Boost version: 1.44.0

-- Found the following Boost libraries:

-- filesystem

-- system

-- thread

-- program_options

-- date_time

CMake Warning (dev) at webspider/CMakeLists.txt:25 (link_directories):

This command specifies the relative path

../statsem_string/bin

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the

source dir. Run "cmake --help-policy CMP0015" for policy details. Use the

cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at webspider/CMakeLists.txt:25 (link_directories):

This command specifies the relative path

../3dparty/google-url

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the

source dir. Run "cmake --help-policy CMP0015" for policy details. Use the

cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

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:

HTMLCXX_LIBRARY

linked by target "whalebot" in directory /root/dls/whalebot/webspider

-- Configuring incomplete, errors occurred!

我该怎么办?

解决方法:

看来CMake无法找到htmlcxx库.

cd

./configure --enable-static=on --enable-shared=off

make

sudo make install

您可能需要添加#include< cstddef>到html / tree.h的顶部,让它成功构建.它将默认安装到usr / local /.

如果您还没有安装icu,还需要安装icu:

sudo apt-get install libicu-dev

最后,您现在可以构建和安装whalebot.同样,如果您有合理的最新boost安装,则可能会失败.

在webspider / src / webspider_options.cpp的第57行中,您需要使用boost :: filesystem :: initial_path().string()替换boost :: filesystem :: initial_path().native_directory_string().然后你应该很好地构建和安装:

cd

mkdir build

cd build

cmake .. -DCMAKE_BUILD_TYPE=Release

make

sudo make install

这也将默认安装到usr / local /.

标签:linux,cmake,configure

来源: https://codeday.me/bug/20190626/1290362.html

总结

以上是生活随笔为你收集整理的linux cmake变量,linux – CMake错误:此项目中使用了以下变量,但它们设置为NOTFOUND...的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。