1Building OpenCV from Source, using CMake and Command Line
2=========================================================
3
4Requirements
5============
6CMake 3.1.0 or higher
7Windows Phone/Store 8.1 Visual Studio 2013
8Windows Phone/Store 8.0 Visual Studio 2012
9
10For example, to be able to build all Windows Phone and Windows Store projects install the following:
11
12Install Visual Studio 2013 Community Edition
13    http://go.microsoft.com/?linkid=9863608
14
15Install Visual Studio Express 2012 for Windows Desktop
16    http://www.microsoft.com/en-us/download/details.aspx?id=34673
17
18
19
20To create and build all Windows Phone (8.0, 8.1) and Windows Store (8.0, 8.1) Visual Studio projects
21==========================================================================================
22cd opencv/platforms/winrt
23setup_winrt.bat "WP,WS" "8.0,8.1" "x86,ARM" -b
24
25If everything's fine, a few minutes later you will get the following output in the opencv/bin directory:
26
27bin
28    install
29        WP
30            8.0
31                ARM
32                x86
33            8.1
34                ARM
35                x86
36        WS
37            8.0
38                ARM
39                x86
40            8.1
41                ARM
42                x86
43    WP
44        8.0
45            ARM
46            x86
47        8.1
48            ARM
49            x86
50    WS
51        8.0
52            ARM
53            x86
54        8.1
55            ARM
56            x86
57
58"-b" flag in the command above builds each generated solutions in both "Debug" and "Release" configurations. It also builds the predefined "INSTALL" project within generated solutions. Building it creates a separate install location that accumulates binaries and includes for specified platforms. Default location is "<ocv-src>\bin\install\".
59
60WinRT samples reference 'install' binaries and include files via "OPENCV_WINRT_INSTALL_DIR" environment variable. Please declare it and point to "<ocv-src>\bin\install\" directory to resolve references within sample applications.
61
62If you don't want to build all configurations automatically, you can omit "-b" flag and build OpenCV.sln for the particular platform you are targeting manually. Due to the current limitations of CMake, separate x86/x64/ARM projects must be generated for each platform.
63
64You can also target a single specific configuration
65    setup_winrt.bat "WP" "8.1" "x86"
66
67Or a subset of configurations
68    setup_winrt.bat "WP,WS" "8.1" "x86"
69
70To display the command line options for setup_winrt.bat
71    setup_winrt.bat -h
72
73Note that x64 CMake generation support is as follows:
74------------------------------
75Platform\Version | 8.0 | 8.1 |
76-----------------|-----|-----|
77Windows Phone    | No  | No  |
78Windows Store    | Yes | Yes |
79
80Note: setup_winrt.bat calls the unsigned PowerShell script with the -ExecutionPolicy Unrestricted option.
81
82
83CMake command line options for Windows Phone and Store
84======================================================
85
86cmake [options] <path-to-source>
87
88Windows Phone 8.1 x86
89cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.1 <path-to-source>
90
91Windows Phone 8.1 ARM
92cmake -G "Visual Studio 12 2013 ARM" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.1 <path-to-source>
93
94Windows Store 8.1 x86
95cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=8.1 <path-to-source>
96
97Windows Store 8.1 ARM
98cmake -G "Visual Studio 12 2013 ARM" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=8.1 <path-to-source>
99
100Note: For Windows 8.0 Phone and Store you can specify either Visual Studio 11 2012 or Visual Studio 12 2013 as the generator
101
102Windows Phone 8.0 x86
103cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.0 <path-to-source>
104
105Windows Phone 8.0 ARM
106cmake -G "Visual Studio 12 2013 ARM" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.0 <path-to-source>
107
108Windows Store 8.0 x86
109cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=8.0 <path-to-source>
110
111Windows Store 8.0 ARM
112cmake -G "Visual Studio 12 2013 ARM" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=8.0 <path-to-source>
113
114Example
115======================================================
116
117To generate Windows Phone 8.1 x86 project files in the opencv/bin dir
118
119mkdir bin
120cd bin
121cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.1 ../
122