我在Linux机器上独立安装了OpenCV,运行正常。我安装了ROS(随附OpenCV),今天我无法在任何OpenCV项目中运行我的CMakeLists.txt,收到错误:
CMake Error at CMakeLists.txt:20 (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.
我确定这发生了,因为一些环境变量发生了变化,但我不知道在哪里看。
有人能引导我解决这个问题吗?
答案 0 :(得分:0)
重新安装OpenCV解决了我的问题,因为它重新修改了环境变量。