CMake Error at G:\RMMMMM\ore\CMakeLists.txt:18 (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 di
时间: 2023-10-19 07:05:24 浏览: 192
d not find one.
The error message suggests that CMake was unable to locate the "OpenCV" package. This is likely because the "FindOpenCV.cmake" module was not found in the CMAKE_MODULE_PATH.
To resolve this issue, you can try the following steps:
1. Make sure that you have installed OpenCV on your system. You can download it from the official OpenCV website.
2. Check if the "FindOpenCV.cmake" module is present in your CMake installation. It is usually located in the "Modules" directory of your CMake installation.
3. If the module is not present, you can try downloading it from the CMake repository or searching for it online. Make sure to place it in a directory that is included in the CMAKE_MODULE_PATH.
4. Alternatively, you can manually set the OpenCV variables in your CMakeLists.txt file. You can use the following commands:
```
set(OpenCV_DIR <path/to/opencv>)
find_package(OpenCV REQUIRED)
```
Replace `<path/to/opencv>` with the actual path to your OpenCV installation directory.
5. After making the necessary changes, try running CMake again. If everything is set up correctly, the "OpenCV" package should be found without any errors.
I hope this helps! Let me know if you have any further questions.
阅读全文