Windows SDK Source Installation¶
Windows does not provide Visual Studio
*.sln file directly and requires CMake to build. Firstly, CMake can be used across multiple platforms, it is easy to configure and can be maintained in a sustainable way. Secondly, the third-party codes (Glog, OpenCV) are built using CMake.
There is currently no binary installer available, which requires you to compile from source. It is also the process of configuring the development environment.
CMake (provide build）¶
CMake，used to build and compile (necessary).
Git， used to get code (optional).
Doxygen， used to generate documents (optional).
After you install the above tools, confirm that you can run this command in CMD (Command Prompt):
>cmake --version cmake version 3.10.1 >git --version git version 2.11.1.windows.1 >doxygen --version 1.8.13
Visual Studio (provide compilation)¶
After installing Visual Studio, confirm that the following command can run in the Visual Studio Command Prompt:
>cl Microsoft (R) C/C++ Optimizing Compiler Version 19.14.26429.4 for x86 >msbuild Microsoft (R) 生成引擎版本 18.104.22.16872
Visual Studio Command Prompt can be opened from the Start menu,
You can also open it from the Visual Studio Tools menu.
However, if you do not have the Visual Studio 2015 Tools menu, you can add one yourself.
Open Tools’s External Tools… and Add the following:
Visual Studio Command Prompt
In Visual Studio command Prompt, you can use the compile command
msbuild, etc.(need finish
MSYS2``and ``Getting Source Code steps first)
MSYS2 (provide Linux command)¶
After installation, verify that the following path has been added to the system environment variable PATH:
Then, open MSYS2 MSYS, perform the update and install
$ pacman -Syu $ pacman -S make
Finally, the CMD (Command Prompt) can run the following command:
>make --version GNU Make 4.2.1
Getting Source Code¶
git clone https://github.com/slightech/MYNT-EYE-S-SDK.git
>cd <sdk> >make init Make init Init deps Install cmd: pacman -S Install deps: git clang-format pacman -S clang-format (not exists) error: target not found: clang-format pip install --upgrade autopep8 cpplint pylint requests ... Init git hooks ERROR: clang-format-diff is not installed! Expect cmake version >= 3.0 cmake version 3.10.1
The official OpenCV provides the
exe for installation. If you want to compile from the source code, see the Official document Installation in Windows . or refer to the following command:
>git clone https://github.com/opencv/opencv.git >cd opencv >git checkout tags/3.4.1 >cd opencv >mkdir _build >cd _build >cmake ^ -D CMAKE_BUILD_TYPE=RELEASE ^ -D CMAKE_INSTALL_PREFIX=C:/opencv ^ -D WITH_CUDA=OFF ^ -D BUILD_DOCS=OFF ^ -D BUILD_EXAMPLES=OFF ^ -D BUILD_TESTS=OFF ^ -D BUILD_PERF_TESTS=OFF ^ -G "Visual Studio 15 2017 Win64" ^ .. >msbuild ALL_BUILD.vcxproj /property:Configuration=Release >msbuild INSTALL.vcxproj /property:Configuration=Release
If OpenCV is installed in a custom directory or wants to specify a version, you can set the path as follows before compiling:
# OpenCV_DIR is hte path where OpenCVConfig.cmake in set OpenCV_DIR=C:\opencv
Otherwise, CMake will prompt that OpenCV could not be found. If you don’t want to rely on OpenCV, read OpenCV independency .
Build and install:
cd <sdk> make install
Finally, the SDK will install in
<sdk>/_install by default.
cd <sdk> make samples
All compiled sample programs
exe will have a corresponding
bat will temporarily set system environment variables and then run
exe. So it is recommended to run
If you run``exe`` directly, it may prompt that cannot find
dll. Then you should add
PATH in system environment variable.
How to set the environment variable for OpenCV, refer to the official document Set the OpenCV environment variable and add it to the systems path .
cd <sdk> make tools
The usage of tools and scripts will be introduced later.
The script is based on Python. You need to install Python and its package management tool pip first, and then install the dependencies as follows:
cd <sdk>\tools pip install -r requirements.txt
Note: Python is also in MSYS2, but fail install Matplotlib in test.
If your project will use SDK, you can refer to the settings in
samples/CMakeLists.txt for CMake. Or just import the head file and dynamic library in the installation directory.