linux编译opencv代码时报错:
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.
-- Configuring incomplete, errors occurred!
需要在CMakelist.txt中添加
set(OpenCV_DIR ~/openCV/opencv-2.4.9/build)
~/openCV/opencv-2.4.9/build 目录是当初安装openCV时建的
ls ~/openCV/opencv-2.4.9/build
3rdparty CPackSourceConfig.cmake Makefile
apps cvconfig.h modules
bin data opencv2
CMakeCache.txt doc OpenCVConfig.cmake
CMakeFiles include OpenCVConfig-version.cmake
cmake_install.cmake install_manifest.txt OpenCVModules.cmake
cmake_uninstall.cmake junk unix-install
CPackConfig.cmake lib version_string.tmp