2016-02-27 94 views
1

我遇到了安装C++库的问题。该CMake命令是成功的,产生的Makefile,但它给出了一个警告:在的CMakeLists.txt“没有规则使目标'安装'”...但是Makefile存在

CMake Warning (dev) at CMakeLists.txt:27 (LINK_DIRECTORIES): 
This command specifies the relative path 

../usr/local/lib 

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. 

第27行是

Boost_LIBRARY_DIR_DEBUG:PATH=/usr/local/lib 

我不明白为什么这样的警告会引起我的任何问题。但是当我运行make install时,出现错误:

make: *** No rule to make target `install'. Stop. 

任何想法?

+1

您是否知道生成的makefile实际上包含'install'目标? –

+1

两条建议:首先,用相应的错误消息搜索网页。其次,提取一个最小的例子。就目前而言,您的问题不在话下,请参阅发布指南。 –

回答

6

你能提供一个完整的makefile吗? 但现在我可以告诉 - 你应该检查“安装”目标已经存在。因此,检查Makefile是否包含一个

install: (anything there) 

line。如果没有,那么就没有这样的目标,所以make有权利。可能你应该使用“make”命令来编译,然后按原样使用它,或者手动安装。

安装不是任何make的标准,它只是一个共同的目标,可能存在,但不是必要的。

+2

经验不足的提示:使用'cat Makefile | grep install:'执行此检查 – XavierStuvw

0

我也遇到了同样的错误。这里是修复: 如果您正在使用的cmake 的GUI

  1. 清洁在C进行加载库的高速缓存。
  2. 配置库。
  3. 生成Unix文件。

如果你错过了第3步:将出现

*** No rule to make target `install'. Stop.

错误。

0

我收到了同样的错误信息,我的问题是运行命令make install时我没有在正确的目录中。当我改变到有我的生成文件它的工作目录。

所以可能你不在正确的目录中。