2011-09-10 63 views
2

我想用cmake建立opencv,並遇到問題。建立opencv與cmake錯誤

我已經將Windows opencv 2.3.1下載到C:/Users/chris/opencv。我打通CMake的GUI(2.8.5版本的CMake的),並把源代碼目錄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! 

什麼給?我應該怎麼做才能解決這個問題?

回答

6

除非最近發生了變化,源目錄應該是C:/Users/chris/opencv/ - 這將是最高級別目錄中有一個CMakeLists.txt文件。

0

CMakeLists.txt文件的內容是什麼?

避免警告,插入「cmake_minimum_required(2.8版)」到您的CMakeLists.txt的第一行

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

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