Skip to content

Commit c856827

Browse files
authored
[Doc] Add tutorial for using VCPKG on Windows (#4814)
* Added VCPKG tutorial * Rewording * Remove specific note about 11(.1)
1 parent 4f5dedb commit c856827

File tree

4 files changed

+158
-0
lines changed

4 files changed

+158
-0
lines changed
Loading
Loading

doc/tutorials/content/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ Basic Usage
9797
.. |mi_3| image:: images/pcl_ccmake.png
9898
:height: 100px
9999

100+
* :ref:`pcl_vcpkg_windows`
101+
102+
====== ======
103+
|mi_4| Title: **Install PCL using VCPKG**
104+
105+
Author: *Lars Glud*
106+
107+
Compatibility: PCL version available on VCPKG and Master, unless VCPKG updates a dependency before PCL is ready for it.
108+
109+
In this tutorial,it is explained how to install PCL or PCL dependencies.
110+
====== ======
111+
112+
.. |mi_4| image:: images/windows_logo.png
113+
:height: 100px
114+
100115
* :ref:`compiling_pcl_dependencies_windows`
101116

102117
====== ======
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
.. _pcl_vcpkg_windows:
2+
3+
Using PCL on windows with VCPKG and CMake
4+
-----------------------------------------
5+
6+
This tutorial explains how to acquire Point Cloud Library on
7+
Microsoft Windows platforms using `VCPKG <https://github.com/microsoft/vcpkg>`_.
8+
9+
For additional information how to use VCPKG, please see their `documentation <https://github.com/microsoft/vcpkg/blob/master/docs/README.md>`_.
10+
11+
Last updated: 22. December 2021
12+
13+
.. image:: images/windows_logo.png
14+
:alt: Microsoft Windows logo
15+
:align: right
16+
17+
.. contents::
18+
19+
20+
Requirements
21+
==================
22+
23+
Download VCPKG sources to eg. *c:\\vcpkg* preferably by cloning their repository.
24+
25+
Navigate to *c:\\vcpkg* in **powershell** and run
26+
27+
.\\bootstrap-vcpkg.bat
28+
29+
This will download vcpkg.exe.
30+
31+
32+
PCL's dependencies
33+
==================
34+
35+
PCL's required dependencies available on VCPKG are:
36+
37+
* Boost
38+
* FLANN
39+
* Eigen3
40+
41+
PCL's optional dependencies available on VCPKG are:
42+
43+
* VTK - for visualization module
44+
45+
* Feature OpenGL - required
46+
* Feature Qt - optional for QVTK, used in apps
47+
48+
* GLEW - for simulation module
49+
* Qhull - for convex/concave in surface module
50+
* Qt - for apps that use Qt for GUI
51+
* Google Test - for unit tests
52+
* Google Benchmark - for benchmarks
53+
* OpenNI2
54+
* Realsense2
55+
* PNG - for a single openni app
56+
* Pcap - for Velodyne HDL driver
57+
58+
PCL's optional dependencies not on VCPKG
59+
60+
* CUDA - only a port that verify its installed (version 10.1).
61+
* GLUT
62+
* OpenNI
63+
* Ensenso
64+
* davidSDK
65+
* DSSDK
66+
* RSSDK
67+
68+
69+
Install PCL for usage
70+
=====================
71+
72+
Running the following command in powershell in the VCPKG directory,
73+
will install PCL with default options as well as default triplet type (ie. x86).
74+
75+
./vcpkg install pcl
76+
77+
78+
.. note::
79+
80+
If there are new features or bugfixes that are not yet part of a release,
81+
you can try to use --head, which downloads the master of PCL.
82+
83+
You can see the available PCL version and options in VCPKG `here <https://github.com/microsoft/vcpkg/blob/master/ports/pcl/vcpkg.json>`_.
84+
85+
To enable specific features, you need to write:
86+
87+
./vcpkg install pcl[qt,vtk]
88+
89+
And all features:
90+
91+
./vcpkg install pcl[*]
92+
93+
If you want to install with a different triplet type, the easiest way is:
94+
95+
./vcpkg install pcl --triplet triplet_type
96+
97+
ie.
98+
99+
./vcpkg install pcl --triplet x64-windows
100+
101+
This will acquire all the dependencies, build them and place the binaries
102+
in vcpkg/installed/triplet_type/bin for release and vcpkg/installed/triplet_type/debug/bin for debug.
103+
104+
105+
Using dependencies installed with VCPKG in CMake projects
106+
=========================================================
107+
108+
Use `CMake <https://cmake.org/download>`_ to configure projects and remember to pass **vcpkg\\scripts\\buildsystems\\vcpkg.cmake** as toolchain file
109+
to enable CMake to find all the dependencies installed with VCPKG.
110+
111+
See example below using the cmake window:
112+
113+
.. list-table::
114+
115+
* - .. figure:: images/vcpkg/cmake_configure_1.png
116+
117+
Fig 1. Cmake configuration
118+
119+
- .. figure:: images/vcpkg/cmake_configure_2.png
120+
121+
Fig 2. Cmake configuration with vcpkg tool chain
122+
123+
124+
Find PCL using CMake
125+
====================
126+
127+
To use PCL in CMake project, take a look at Kunal Tyagi's minimal example `in this repository <https://github.com/kunaltyagi/pcl-cmake-minimum>`_
128+
129+
130+
Install PCL dependencies for contributions
131+
==========================================
132+
133+
If you want to contribute to PCL, the easiest way to get dependencies
134+
using vcpkg is to run the install command from our `docker file <https://github.com/PointCloudLibrary/pcl/blob/master/.dev/docker/windows/Dockerfile>`_
135+
136+
./vcpkg install dependencies_here --triplet triplet_type
137+
138+
Remember to omit the *--clean-after-build*, as this removes the source code of the dependencies and limit debugging capabilities for those.
139+
140+
To build PCL, you would have to get the `source <https://github.com/PointCloudLibrary/pcl>`_, preferably clone it using git.
141+
142+
Use `CMake <https://cmake.org/download>`_ to configure PCL.
143+

0 commit comments

Comments
 (0)