avi@avi-VPCEB46FG:~$ cd ~/opencv
avi@avi-VPCEB46FG:~/opencv$ cd build
avi@avi-VPCEB46FG:~/opencv/build$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
OpenCV 安装过程中出现错误:
CMake Error: The source directory "/home/avi/opencv" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
后ls /home/avi/opencv
:
avi@avi-VPCEB46FG:~$ cd ~/opencv
avi@avi-VPCEB46FG:~/opencv$ ls
build opencv opencv_contrib
之后ls /home/avi/opencv/opencv
:
avi@avi-VPCEB46FG:~/opencv$ cd opencv
avi@avi-VPCEB46FG:~/opencv/opencv$ ls
3rdparty cmake CONTRIBUTING.md doc LICENSE platforms samples
apps CMakeLists.txt data include modules README.md
avi@avi-VPCEB46FG:~/opencv/opencv$
我该如何解决这个问题?
答案1
该CMakeLists.txt
文件位于文件夹中/home/avi/opencv/opencv
。因此,要构建/home/avi/opencv/build
(别名~/opencv/build
),您应该使用:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ../opencv