gpt4 book ai didi

opencv - 使用Cmake构建Opencv时禁止警告

转载 作者:行者123 更新时间:2023-12-02 17:45:11 25 4
gpt4 key购买 nike

在使用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

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

最佳答案

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

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

关于opencv - 使用Cmake构建Opencv时禁止警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37315378/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com