2018-04-09 05:46:01 +03:00
|
|
|
|
# 编译 on Linux {#guide_build_linux}
|
|
|
|
|
|
2018-04-23 18:11:11 +03:00
|
|
|
|
> Ubuntu 16.04, Ubuntu 14.04
|
|
|
|
|
|
2018-04-09 05:46:01 +03:00
|
|
|
|
## 获取代码
|
|
|
|
|
|
|
|
|
|
```bash
|
2018-04-15 17:43:24 +03:00
|
|
|
|
git clone https://github.com/slightech/MYNT-EYE-SDK-2.git
|
2018-04-09 05:46:01 +03:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 准备依赖
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cd mynt-eye-sdk-2/
|
|
|
|
|
make init
|
|
|
|
|
```
|
|
|
|
|
|
2018-05-03 09:45:33 +03:00
|
|
|
|
### [OpenCV](https://opencv.org/)
|
|
|
|
|
|
|
|
|
|
编译前,可在系统终端(Windows 命令提示符)里如下指定 OpenCV 路径,其为 `OpenCVConfig.cmake` 目录:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Linux, macOS
|
|
|
|
|
export OpenCV_DIR=~/opencv
|
|
|
|
|
|
|
|
|
|
# Windows
|
|
|
|
|
set OpenCV_DIR=C:\opencv
|
|
|
|
|
```
|
|
|
|
|
|
2018-04-09 05:46:01 +03:00
|
|
|
|
## 编译代码
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
make install
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
结果:
|
|
|
|
|
|
|
|
|
|
![make install](make_install.png)
|
|
|
|
|
|
|
|
|
|
\latexonly
|
|
|
|
|
\includegraphics[width=0.6\textwidth,keepaspectratio]{make_install.png}
|
|
|
|
|
\endlatexonly
|
|
|
|
|
|
|
|
|
|
> CMake 如何引入编译好的库,可参考 `samples/CMakeLists.txt` 里的配置。
|