CMake Error: The source directory /home/pi/opencv-3.0.0/build/BUILD_EXAMPLES=ON does not exist

I ran the following lines

cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.0.0/modules \ -D BUILD_EXAMPLES=ON 

and got this error

CMake Error: The source directory /home/pi/opencv-3.0.0/build/BUILD_EXAMPLES=ON does not exist`

How could this be solved?

1 Answer

The last argument to the cmake command needs to be a directory containing a CMakeList.txt file.

Usually that's either the current directory . or the parent directory .. in the case of an out-of-source build where you are running the command from a separate build subdirectory:

cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.0.0/modules \ -D BUILD_EXAMPLES=ON ..

[I suspect you are following instructions that used .. and misinterpreted it as standing in for an arbitrary list of -D options rather than an actual directory argument]

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like