【问题标题】:Building opencv with cmake error用cmake错误构建opencv
【发布时间】:2011-09-10 22:22:42
【问题描述】:

我正在尝试使用 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!

什么给了?我应该怎么做才能解决这个问题?

【问题讨论】:

    标签: opencv makefile cmake


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:
      This warning is for project developers.  Use -Wno-dev to suppress it.
      

      要打开-Wno-dev,您只需在CMake GUI 的菜单中选择Options -> Suppress dev Warnings (-Wno-dev)

      【讨论】:

        【解决方案3】:

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

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

        【讨论】:

          猜你喜欢
          • 2013-05-25
          • 2015-06-17
          • 2020-11-02
          • 1970-01-01
          • 2016-06-17
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多