Mul*_*que 3 c++ linux ubuntu opencv
我正在做这个教程 http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation 但我感到困惑.我停止从源代码构建OpenCV.
我已经创建了一个名为Workspace的文件,我在其中创建了cmake_binary_dir(名为release).我下载了源文件(在我的主目录中并命名为:opencv-2.3.1),现在我想运行它
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
我在哪里使用:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/markus/opencv-2.3.1
Run Code Online (Sandbox Code Playgroud)
但终端一直告诉我,这个源目录不存在!?那么我做错了什么?
CMAKE_INSTALL_PREFIX定义了在编译和链接之后将二进制文件分发到的位置,它默认为好位置(/ usr/local /),因此避免定义它
你在cmake命令中省略了尾随..它告诉它在哪里获取源代码因此错误信息
以下是从源代码安装任何使用cmake的项目的典型步骤
如果你看到一个文件:
CMakeLists.txt
Run Code Online (Sandbox Code Playgroud)
在src目录中,这表明它希望您使用cmake
0 cd into dir where your expanded source code lives
1 mkdir build # make a build dir (initially empty)
2 cd build
3 cmake .. # NOTE those little .. which declares relative path to src dir
which says populate current dir (build) with compiled code
and get the source code and configs from parent directory (..)
4 examine the output, if it looks successful go to step 5
if it has errors you may need to install upstream dependent
libraries then try cmake again
5 make -j4 # compile source, -j speeds up by using multicore
6 sudo make install <-- only if above step 4 and 5 are OK
Run Code Online (Sandbox Code Playgroud)
您可以从命令行执行与cmake相关的所有操作,但其GUI可以非常方便,尤其是对于不熟悉的项目.在上面而不是输入:
cmake ..
Run Code Online (Sandbox Code Playgroud)
它的GUI版本是:
cmake-gui ..
Run Code Online (Sandbox Code Playgroud)
在GUI中,它易于切换开/关设置,如构建示例或不...右侧的值列是可编辑的
| 归档时间: |
|
| 查看次数: |
2926 次 |
| 最近记录: |