Currently, I am playing nowadays with OpenCV for visual computing using C++ on Mac OS platform.
I installed openCV and by default, it get installed in "/opt/local". I wrote a test program in c++ using opencv library and tried to build it using cmake. But, I found following errors while running cmake.
I installed openCV and by default, it get installed in "/opt/local". I wrote a test program in c++ using opencv library and tried to build it using cmake. But, I found following errors while running cmake.
CMake Error at CMakeLists.txt:3 (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.
-- Configuring incomplete, errors occurred!
This means that you have to provide opencv directory information so that the opencv libs get available during making of the opencv project.
Here are the solution:
Quick solution: "Export the OpenCV_DIR into the current terminal"
export OpenCV_DIR=/opt/local/lib/cmake/
If it works then,
Permanent Solution: "Save it into .profile of MacOS"
Permanent Solution: "Save it into .profile of MacOS"
$ vim ~/.profileAnd it will there as far as your MacOS survives. ;-)