使用Cmake构建Opencv时出现警告

时间:2016-05-19 06:26:33

标签: opencv cmake

我在使用Cmake构建Opencv时遇到警告。它建议"使用-Wno-dev来抑制它。"。但我不知道如何压制它。

当我做"生成"时出现警告。在ccmake GUI中。 警告是

 CMake Warning (dev) at apps/haartraining/CMakeLists.txt:34 (add_library):
   Policy CMP0038 is not set: Targets may not link directly to themselves.
   Run "cmake --help-policy CMP0038" for policy details.  Use the cmake_policy
   command to set the policy and suppress this warning.

   Target "opencv_haartraining_engine" links to itself.
 This warning is for project developers.  Use -Wno-dev to suppress it.


 CMake Warning (dev) at apps/haartraining/CMakeLists.txt:34 (add_library):
   Policy CMP0038 is not set: Targets may not link directly to themselves.
   Run "cmake --help-policy CMP0038" for policy details.  Use the cmake_policy
   command to set the policy and suppress this warning.

   Target "opencv_haartraining_engine" links to itself.
 This warning is for project developers.  Use -Wno-dev to suppress it.



Messages during last pass                                                       
                                                             CMake Version 3.2.2
Press [e] to exit help

如何删除此警告?这只是警告,但是当我按下“ccmake GUI”停止时,无法执行此步骤。因此ccmake不会生成任何东西并停止。 感谢

1 个答案:

答案 0 :(得分:1)

只需使用消息中给出的标志运行ccmake:

ccmake -Wno-dev [source path] [build path]