1

I'm trying to build OpenCV from source using CMake. Following the official OpenCV instructions, I've changing directories to my binary directory, then I'm entering the following:

michael@GNU:~/opencv-3.1.0/release$ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/home/michael/opencv-3.1.0

However, CMake keeps Showing me an error stating:

CMake Error: The source directory "/home/michael/opencv-3.1.0/release/CMAKE_INSTALL_PREFIX=/home/michael/opencv-3.1.0" does not exist.

What am I doing wrong? This is the documentation I'm following:

http://docs.opencv.org/3.1.0/d7/d9f/tutorial_linux_install.html#gsc.tab=0

1 Answer 1

2

Take a closer look at the cmake command in that tutorial. At the end is the path /usr/local (the directory to install the compiled program to), followed by a space and .. (which indicates the parent directory, presumably as the directory containing the source code).

So if you want to compile the program to your /home/michael/opencv-3.1.0/ directory, all you need to do is add a space and two dots to your original command. Like this:

cd ~/opencv-3.1.0/release

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/home/michael/opencv-3.1.0 ..

Please let me know if that helps, if you're still getting the same error, or if you have additional questions. Good luck!

--Nick

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .