编译opencv示例:未知的cmake命令ocv_check_dependencies [英] Compiling opencv samples: unknown cmake command ocv_check_dependencies
问题描述
我正在尝试构建与源代码包一起提供的OpenCV示例,并获得以下内容:
CMakeLists.txt:10(ocv_check_dependencies):
未知的CMake命令ocv_check_dependencies。
我使用
安装了OpenCV cmake。
make
sudo make install
我有一个教程片段工作我想它是作为一个库正确安装)。但是,编译示例不起作用。
我想我不得不以某种方式配置CMake有ocv_check_dependencies - 但如何?我失去了!
按顺序排列要构建样本,必须通过 -D
提供它来更改cmake的默认配置。我错误的是,我试图在 samples
目录中执行cmake。
正确的构建方式示例调用cmake像这样(从解压缩的归档的根目录下):
cmake -DBUILD_SAMPLES。
一个可以继续使用make,make install than。
另请参见常见问题
I am trying to build the OpenCV samples which come with the source package and I get the following:
CMake Error at CMakeLists.txt:10 (ocv_check_dependencies):
Unknown CMake command "ocv_check_dependencies".
I did install OpenCV using
cmake .
make
sudo make install
and I got a tutorial snippet working (thus I suppose it is installed correctly as a library). However, compiling the samples does not work.
I guess I have to somehow configure CMake to have "ocv_check_dependencies" - but how? I am lost!
I got it.
In order to build the samples one has to change the default configuration for cmake by providing it via -D
. What I did wrong was that I tried to execute cmake from within the samples
directory.
The proper way to build the samples is invoking cmake like so (from within the root directory of the unpacked archive):
cmake -DBUILD_SAMPLES .
which will turn samples ON. One can proceed using make, make install than. The samples can be found in bin
after building.
See also FAQ
这篇关于编译opencv示例:未知的cmake命令ocv_check_dependencies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!