CMake的错误:下列变量在这个项目中使用,但它们被设置为NOTFOUND(CMake Error:

2019-09-17 11:10发布

我想配置whalebot用tar文件履带whalebot-0.02.00.tar.gz 。 我曾与正确提取它:

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

从那以后,我想用它配置:

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

它给我的错误:

bash下的./configure:没有这样的文件或目录

还我已经运行以下命令:

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!

我该如何继续?

Answer 1:

看来,CMake的是无法找到htmlcxx库。

在whalebot文档 ,htmlcxx被列为依赖关系。


您需要下载htmlcxx ,解压缩,然后进行安装:

cd <path to unzipped htmlcxx>
./configure --enable-static=on --enable-shared=off
make
sudo make install

您可能需要添加#include <cstddef>到顶部html/tree.h得到它的成功打造。 它将安装到usr/local/在默认情况下。


您还需要ICU ,如果你不已经安装:

sudo apt-get install libicu-dev


最后,您现在可以编译和安装whalebot。 再次,让你有一个合理的了最新的提振安装可能会失败。

在第57行webspider/src/webspider_options.cpp ,则需要更换boost::filesystem::initial_path().native_directory_string()boost::filesystem::initial_path().string() 然后,你要善于构建和安装:

cd <path to unzipped whalebot>
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
sudo make install

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



文章来源: CMake Error: The following variables are used in this project, but they are set to NOTFOUND