Ask Your Question

Build fails with CMake on OSX El Capitan

asked 2016-02-18 11:37:05 -0500

rookie gravatar image

I upgraded my OpenCV from 2.4.9 to 3.1.0 . I was able to succesfully install it on my machine. But when I try to run a simple sample code, I get this weird error I have no clue to tackle. I have built OpenCV fro source using these CMake configs:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/Applications/opencv-3.1.0/build -D PYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/bin -D PYTHON2_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Headers -D PYTHON2_PACKAGES_PATH=/usr/local/lib/python2.7/site-packages -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON - D OPENCV_EXTRA_MODULES_PATH=/Applications/opencv-3.1.0/opencv_contrib-master/modules ..

The error I get on running a sample program is the following:

cmake . -- OpenCV ARCH: -- OpenCV RUNTIME: -- OpenCV STATIC: ON CMake Warning at /Applications/opencv-3.1.0/cmake/OpenCVConfig.cmake:166 (message): Found OpenCV Windows Pack but it has no binaries compatible with your configuration.

You should manually point CMake variable OpenCV_DIR to your build of OpenCV library. Call Stack (most recent call first):
CMakeLists.txt:10 (find_package)

CMake Error at CMakeLists.txt:10 (find_package): Found package configuration file:


but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be

-- Configuring incomplete, errors occurred!

I have no clue why it says windows binary, when i built it from source for OSX. I somehow suspect that the cmake config file it should be looking at is supposed to the one in the build folder, but I dont know how to fix that. I have tried a clean build multiple times and also tried moving down to 3.0.0 , but in vain. Any help in fixing this is highly appreciated!

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2016-08-27 23:40:15 -0500

just type// sudo cmake . and then sudo make and voila it fix the problem

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-02-18 11:37:05 -0500

Seen: 460 times

Last updated: Feb 18 '16