Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmake error 'the source does not appear to contain CMakeLists.txt'

Tags:

python

opencv

I'm installing opencv in ubuntu 16.04. After installing the necessary prerequisites I used the following command:-

kvs@Hunter:~/opencv_contrib$ mkdir build kvs@Hunter:~/opencv_contrib$ cd build kvs@Hunter:~/opencv_contrib/build$  kvs@Hunter:~/opencv_contrib/build$ 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/modules -D BUILD_EXAMPLES=ON .. 

but it produced an error:-

CMake Error: The source directory "/home/kvs/opencv_contrib" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. 

I used the command provided in the folder 'module' documentation. How do I solve it? I tried the answers here at stack-overflow and a few other question but still can't figure it out.

Project Git repository here.

like image 632
KVS Avatar asked Sep 27 '17 13:09

KVS


1 Answers

You should do mkdir build and cd build while inside opencv folder, not the opencv-contrib folder. The CMakeLists.txt is there.

like image 155
Quang Hoang Avatar answered Sep 21 '22 18:09

Quang Hoang