1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
/**
\page tutorial-install-win10-msvc14-uwp Tutorial: Cross-compilation for UWP from Windows host with Visual C++ 2015 (vc14)
\tableofcontents
In this tutorial you will learn how to build ViSP framework for Universal Windows Platform (UWP) to include ViSP functionalities in apps developments that target a wide range of devices including PC, mobile, Xbox, HoloLens, IoT, and Surface Hub.
This tutorial has been tested on Windows 10 (64 bit), with CMake 3.13.1 and Visual Studio 2015.
\note Concerning ViSP installation, we provide also other \ref tutorial.
\section tutorial_install_msvc14_uwp_required Install prerequisites
\subsection install_msvc14_uwp_msvc Visual Studio
Install Visual Studio 2015. Make sure that the Universal Windows App Development Tools are selected from the optional features list. Without these tools, you won't be able to create your universal apps. After the installation, start Visual Studio and create an empty C++ project to install the common tools for Visual C++ 2015.
\note If you have already Visual Studio 2015 installed and don't know if the Universal Windows App Development Tools are enabled see \ref install_msvc14_uwp_tips_msvc.
After installing Visual Studio software, you need to <a href="https://msdn.microsoft.com/windows/uwp/get-started/enable-your-device-for-development">enable your Windows 10 device</a> for development.
\subsection install_msvc14_uwp_3rd_cmake CMake
CMake could be download from http://www.cmake.org. Download the latest release for Windows win64-x64 platform (at the time this tuto was written it was the file `cmake-3.13.1-win64-x64.msi`). To install just double click on the msi file.
\subsection install_msvc14_uwp_3rd_git Git
Install Git for Windows from https://git-for-windows.github.io/. This installation allows then to use git in a `cmd` Command Prompt.
\section install_msvc14_uwp_ws Create a workspace
If not already done, create a workspace that will contain all ViSP source, build, data set and optional 3rd parties. This workspace is here set to `C:\visp-ws` folder, but it could be set to any other location.
To create the workspace, open a `cmd` Command Prompt (a fast way to launch this window is to press the Win + R keys on your keyboard. Then, type `cmd` or `cmd.exe` and press Enter or click/tap OK) and run the following to create a workspace environment var named `VISP_WS`:
\verbatim
C:\> setx VISP_WS "C:\visp-ws"
C:\> exit
\endverbatim
Open a new `cmd` Command Prompt and create the corresponding folder
\verbatim
C:\> mkdir %VISP_WS%
C:\> exit
\endverbatim
\section install_msvc14_uwp_get_visp_source Get ViSP source code
There are different ways to get ViSP source code.
- You can download the <a href="https://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once `visp-x.y.z.tar.gz` or `visp-x.y.z.zip` is downloaded, uncompress the file in `%%VISP_WS%\visp\visp-x.y.z` using for example <a href="http://www.win-rar.com">WinRAR</a>.
- You can also download a <a href="https://visp.inria.fr/download#snapshot">daily snapshot</a>. Once visp-snapshot-yyyy-mm-dd.tar.gz is downloaded, uncompress the file in `%%VISP_WS%\visp\visp-x.y.z` using for example <a href="http://www.win-rar.com">WinRAR</a>.
- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the `git` command line tool:
\verbatim
C:\> cd %VISP_WS%
C:\> git clone https://github.com/lagadic/visp.git
\endverbatim
We suppose now that ViSP source is in `%%VISP_WS%\visp`.
\section install_msvc14_uwp_build_without_opencv Build ViSP
\subsection install_msvc14_uwp_build_ws_10 Build for Windows Store 10.0
\subsubsection install_msvc14_uwp_build_ws_10_x86 Targeting a x86 platform
With CMake configure ViSP specifying options for cross compiling for `"Windows Store"` operating system in version `"10"` targeting a `"x86"` platform, by opening a `cmd` Command Prompt and running:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-ws-10-x86
C:\> cd visp-build-vc14-uwp-ws-10-x86
C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-10-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-ws-10-install` folder. Libraries are located in `x86/vc14/bin` subfolder and headers in `include` subfolder.
\subsubsection install_msvc14_uwp_build_ws_10_x64 Targeting a x64 platform
The same process could be applied except that during cmake configuration you have to use `"Visual Studio 14 2015 Win64"` generator. Installation folder is the same to ensure a unique installation folder for all the targeted platforms:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-ws-10-x64
C:\> cd visp-build-vc14-uwp-ws-10-x64
C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-10-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-ws-10-install` folder. Libraries are located in `x64/vc14/bin` subfolder and headers in `include` subfolder.
\subsubsection install_msvc14_uwp_build_ws_10_arm Targeting an ARM platform
The same process could be applied except that during cmake configuration you have to use `"Visual Studio 14 2015 ARM"` generator. Installation folder is the same to ensure a unique installation folder for all the targeted platforms:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-ws-10-arm
C:\> cd visp-build-vc14-uwp-ws-10-arm
C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-ws-10-install` folder. Libraries are located in `ARM/vc14/bin` subfolder and headers in `include` subfolder.
\subsection install_msvc14_uwp_build_ws_8_1 Build for Windows Store 8.1
\subsubsection install_msvc14_uwp_build_ws_8_1_x86 Targeting a x86 platform
With CMake configure ViSP specifying options for cross compiling for `"Windows Store"` operating system in version `"8.1"` targeting a `"x86"` platform, by opening a `cmd` Command Prompt and running:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-ws-8.1-x86
C:\> cd visp-build-vc14-uwp-ws-8.1-x86
C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-ws-8.1-install` folder. Libraries are located in `x86/vc14/bin` subfolder and headers in `include` subfolder.
\subsubsection install_msvc14_uwp_build_ws_8_1_x64 Targeting a x64 platform
With CMake configure ViSP specifying options for cross compiling for `"Windows Store"` operating system in version `"8.1"` targeting a `"x64"` platform, by opening a `cmd` Command Prompt and running:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-ws-8.1-x64
C:\> cd visp-build-vc14-uwp-ws-8.1-x64
C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-ws-8.1-install` folder. Libraries are located in `x64/vc14/bin` subfolder and headers in `include` subfolder.
\subsubsection install_msvc14_uwp_build_ws_8_1_arm Targeting an ARM platform
With CMake configure ViSP specifying options for cross compiling for `"Windows Store"` operating system in version `"8.1"` targeting a `"ARM"` platform, by opening a `cmd` Command Prompt and running:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-ws-8.1-arm
C:\> cd visp-build-vc14-uwp-ws-8.1-arm
C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-ws-8.1-install` folder. Libraries are located in `ARM/vc14/bin` subfolder and headers in `include` subfolder.
\subsection install_msvc14_uwp_build_wp_8_1 Build for Windows Phone 8.1
\subsubsection install_msvc14_uwp_build_wp_8_1_x86 Targeting a x86 platform
With CMake configure ViSP specifying options for cross compiling for `"Windows Phone"` operating system in version `"8.1"` targeting a `"x86"` platform, by opening a `cmd` Command Prompt and running:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-wp-8.1-x86
C:\> cd visp-build-vc14-uwp-wp-8.1-x86
C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsPhone" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-wp-8.1-install` folder. Libraries are located in `x86/vc14/bin` subfolder and headers in `include` subfolder.
\subsubsection install_msvc14_uwp_build_wp_8_1_x64 Targeting a x64 platform
With CMake configure ViSP specifying options for cross compiling for `"Windows Phone"` operating system in version `"8.1"` targeting a `"x64"` platform, by opening a `cmd` Command Prompt and running:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-wp-8.1-x64
C:\> cd visp-build-vc14-uwp-wp-8.1-x64
C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsPhone" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-wp-8.1-install` folder. Libraries are located in `x64/vc14/bin` subfolder and headers in `include` subfolder.
\subsubsection install_msvc14_uwp_build_wp_8_1_arm Targeting an ARM platform
With CMake configure ViSP specifying options for cross compiling for `"Windows Phone"` operating system in version `"8.1"` targeting a `"ARM"` platform, by opening a `cmd` Command Prompt and running:
\verbatim
C:\> cd %VISP_WS%
C:\> mkdir visp-build-vc14-uwp-wp-8.1-arm
C:\> cd visp-build-vc14-uwp-wp-8.1-arm
C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsPhone" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp
C:\> cmake --build . --config Release --target install
\endverbatim
If everything goes right you will find ViSP libraries and headers in `%%VISP_WS%/visp-build-vc14-uwp-wp-8.1-install` folder. Libraries are located in `ARM/vc14/bin` subfolder and headers in `include` subfolder.
\section install_msvc14_uwp_tips Tips and tricks
\subsection install_msvc14_uwp_tips_msvc How to add Universal Windows App Development Tools support
In case you're trying to build Windows Store and Windows Phone 10.0 projects having only default Visual Studio 2015 installation you'll likely get the following error during \c cmake run:
\verbatim
A Windows Store component with CMake requires both the Windows Desktop SDK
as well as the Windows Store '10.0' SDK. Please make sure that you have
both installed
\endverbatim
Resolution consists in:
- On the Start menu select Settings
- Select System > Apps & features.
- Select Microsoft Visual Studio 2015 program, and right click to modify installation
\image html img-uwp-msvc-modify.png
- Select Modify
\image html img-uwp-msvc-modify2.png
- Enable "Universal Windows App Development Tools" and "Windows 8.1 and Windows Phone 8.0/8.1 Tools"
\image html img-uwp-msvc-modify3.png
- Select Update button
*/
|