3.8 KiB
How to Build Sample Program
How to Install Tools and Libraries
-
Visual Studio 2015
In Visual Studio 2015, Visual C++ is not installed by default. When installing, be sure to choose Custom installation and then choose the C++ components you require.
Or, if Visual Studio is already installed, choose [File]>[New]>[Project]>[C++] and you will be prompted to install the necessary components. -
Kinect for Windows SDK v2.0
Please download installer, and install follow the instructions of installer. -
OpenCV 3.1.0
Please download pre-built package, and unzip the self-extracting file.
Then, Please placed OpenCV folder in any directory. ( e.g.C:\Program Files\opencv
) -
CMake 3.6.1
Please download installer, and install follow the instructions of installer. -
Speech Platform SDK 11 ( and Kinect for Windows SDK v2.0 Language Packs (en-US) )
Please download installer for target platform, and install follow the instructions of installer.
How to Generate Project of Samples using CMake
-
Run CMake GUI
-
Fill These Fields
-
Where is the source code
This area is directory containing CMakeLists.txt file.
If you want to build all samples, please fill path of sample directory. ( e.g.C:/Kinect2Sample/sample
)
If you want to build any one sample, please fill path of any one directory. ( e.g.C:/Kinect2Sample/sample/Color
) -
Where to build the binaries
This area is directory Visual Studio project files will be generated.
By convention, Fill the path that added the/build
to above path. ( e.g.C:/Kinect2Sample/sample/build
)
-
-
Click Configure Button
You will be prompted for compiler and target platform.
Please specify compiler and target platform to use. ( e.g.Visual Studio 14 2015 Win64
)
Then, click finish button. -
Fill Configuration Fields
It will be entered almost automatically.
Please check configuration settings.
Then, click configure button.- KINECTSDK_DIR ... The directory path of Kinect for Windows SDK v2.0 ( e.g.
C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409
) - OPENCV_DIR ... The directory path that to search CMake configuration file for OpenCV. ( e.g.
C:/Program Files/opencv/build
)
- KINECTSDK_DIR ... The directory path of Kinect for Windows SDK v2.0 ( e.g.
-
Click Generate Button
If there is no errors, the Visual Studio project files will be generated into the "Where to build the binaries" directory. -
Set Environment Variable
You might need to add OpenCV binary directory path to environment variable "PATH" to be able to run applications. (e.g.C:\Program Filesopencv\build\x64\vc14\bin
)
The path that have to be added to environment variable will be displayed in output area of CMake GUI.
This path is depend on Compiler, Target Platform and OpenCV Directory.
How to Build and Start Samples
-
Open Visual Studio Solution File ( e.g.
..\build\Sample.sln
) -
Set Solution Configurations
Select Release from the Solution Configuration drop-down list, which is on the Standard toolbar. ( e.g.Release
)
Release build will be enabled optimization by compiler. -
Build Solution ( or Project )
On the Build menu, Click "Build Solution".
Or, In Solution Explorer, select the desired build target project within your solution. Then Click "Build Project". -
Set Startup Project
In Solution Explorer, select the desired startup project within your solution.
On the Project menu, choose "Set as StartUp Project". -
Start Without Debugging
On the Debug menu, choose "Start Without Debugging".