簡體   English   中英

使用cmake錯誤構建opencv

[英]Building opencv with cmake error

我正在嘗試使用cmake構建opencv並遇到問題。

我已將Windows opencv 2.3.1下載到C:/Users/chris/opencv 我打開CMake GUI(2.8.5版本的CMake)並將源目錄放在C:/Users/chris/opencv/modulesC:/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!

是什么賦予了? 我該怎么做才能解決這個問題?

除非最近更改,否則源目錄應為C:/Users/chris/opencv/ - 它將是包含CMakeLists.txt文件的最高級目錄。

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

要打開-Wno-dev ,只需在CMake GUI菜單中選擇Options - > Suppress dev Warnings (-Wno-dev)

你的CMakeLists.txt文件的內容是什么?

為避免警告,請在CMakeLists.txt的第一行插入“cmake_minimum_required(VERSION 2.8)”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM