CMake错误位于C:\ Users \ ... \ Desktop \ imgwarp-opencv \ imgwarp-opencv \ src \ CMakeLists.txt:2(FIND_PACKAGE)

时间:2019-03-27 22:54:34

标签: c++ opencv image-processing visual-c++ cmake

我正在使用Windows 10,Visual Studio2017。已经正确安装了OpenCV,并且可以运行一些C ++ OpenCV的基本项目,这些项目可以在Internet上找到。 我还遵循了this video,其中显示了如何使用CMake和Visual Studio构建开源项目

但是,我无法在计算机上运行this project。我尝试 File-> Open-> CMake 打开 CMakeLists.txt ,该文件可在下载的存储库中找到,但出现此错误:

CMake Error

CMake Error at C:\Users\Majid\Desktop\imgwarp-opencv\imgwarp-opencv\src\CMakeLists.txt:2 (FIND_PACKAGE):
  By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OpenCV", but
  CMake did not find one.

  Could not find a package configuration file provided by "OpenCV" with any
  of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake

  Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
  "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
  provides a separate development package or SDK, be sure it has been
  installed.

我认为我必须将下载的 opencv-4.0.1-vc14_vc15.exe 文件解压缩到项目文件夹中的某个位置,并链接 CMakeLists.txt 文件(哪个文件? )到提取的opencv中的 OpenCVConfig.cmake 。也许不是。

我也有 CMake gui ,如果我应该以这种方式运行它,我将感谢您以这种方式进行解释,而不是使用Visual Studio File-> Open-> CMake >。无论如何,欢迎任何可以帮助我运行此项目的方式。请分步说明。

一行(忘记上述所有内容):我应该怎么做才能正确运行this project

0 个答案:

没有答案