构建opencv时出现cmake错误

发布于 2024-12-04 03:09:42 字数 967 浏览 0 评论 0原文

我正在尝试使用 cmake 构建 opencv,但遇到了问题。

我已将Windows opencv 2.3.1下载到C:/Users/chris/opencv。我打开 CMake GUI(CMake 2.8.5 版本)并将源目录放置为 C:/Users/chris/opencv/modules 并将“在何处构建二进制文件”放置在 C:/temp/opencv_binaries

我点击 Configure 并选择 Visual Studio 2010。然后我再次点击 Configure 并得到以下错误输出:

CMake Error at calib3d/CMakeLists.txt:1 (define_opencv_module):
  Unknown CMake command "define_opencv_module".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring incomplete, errors occurred!

是什么原因?我应该怎么做才能解决这个问题?

I am trying to build opencv with cmake and am running into issues.

I have downloaded the Windows opencv 2.3.1 to C:/Users/chris/opencv. I open up the CMake GUI (2.8.5 version of CMake) and put the source directory as C:/Users/chris/opencv/modules and the "Where to build the binaries" at C:/temp/opencv_binaries

I hit Configure and chose Visual Studio 2010. I then hit Configure again and get the following error output:

CMake Error at calib3d/CMakeLists.txt:1 (define_opencv_module):
  Unknown CMake command "define_opencv_module".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring incomplete, errors occurred!

What gives? What should I do to fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

楠木可依 2024-12-11 03:09:42

除非最近发生更改,否则源目录应为 C:/Users/chris/opencv/ - 它将是包含 CMakeLists.txt 文件的最高级别目录。

Unless it has changed recently, the source directory should be C:/Users/chris/opencv/ - it will be the highest-level directory with a CMakeLists.txt file in it.

彼岸花ソ最美的依靠 2024-12-11 03:09:42
This warning is for project developers.  Use -Wno-dev to suppress it.

要打开 -Wno-dev,您只需选择 Options -> CMake GUI 菜单中的抑制开发警告 (-Wno-dev)

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

To turn -Wno-dev on you just need to select Options -> Suppress dev Warnings (-Wno-dev) in the menu of CMake GUI.

热风软妹 2024-12-11 03:09:42

您的 CMakeLists.txt 文件的内容是什么?

为了避免出现警告,请将“cmake_minimum_required(VERSION 2.8)”插入 CMakeLists.txt 的第一行

what is the content of your CMakeLists.txt file?

for avoiding the warning, insert "cmake_minimum_required(VERSION 2.8)" into the first line of your CMakeLists.txt

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文