Point Cloud Library is available in Vcpkg

What is Package Management System?

“Package Management System” is management system such as install software and libraries, dependency resolution and etc..
Package Management System are widely used. For example, “APT” and “Yum” on Linux, “MacPorts” and “Homebrew” on Mac. Also, “NuGet” is used for managed languages such as C# on Windows.

What is Vcpkg?

Vcpkg is package management system based CMake that manages libraries for Visual C++. It is open source software developed in Microsoft repository of GitHub.
You can easily install various libraries by using Vcpkg. You can install and settings libraries using command based operations.

Vcpkg works with Visual C++ 2017 and Visual C++ 2015.
Vcpkg already support over 300 libraries such as Boost and OpenCV.
Please refer to ports directory or the vcpkg search command for all supported libraries.

Vcpkg Support PCL

Point Cloud Library (PCL) is open source library for point cloud processing.
It is very useful library, but it is difficult to install many dependencies that have PCL.

Therefore, Vcpkg supported PCL for anyone can be able to easily install PCL.
You can easily install PCL with dependencies using following command.

# x86 dynamic link library
vcpkg install pcl:x86-windows

# x64 dynamic link library
vcpkg install pcl:x64-windows

# x86 static link library
vcpkg install pcl:x86-windows-static

# x64 static link library
vcpkg install pcl:x64-windows-static
  • Update 2017/11/02
  • PCL port supported “Feature Packages” for specifying dependent libraries.
    Feature Packages will be able to specifying dependent libraries as vcpkg install <package>[features].
    It is able to enable build with OpenNI2, Qt and PCAP in PCL port.

        # Build PCL with OpenNI2, Qt and PCAP
        vcpkg install pcl[openni2,qt,pcap]:x64-windows --featurepackages
        

How to install Vcpkg

You can very easiy install Vcpkg to your system.

  1. Download and Unpack Vcpkg(e.g. C:vcpkg)
  2. Please download Vcpkg from following link. Then, unpacking it.

  3. Build Vcpkg
  4. It will be built automatically when you start the batch file (vcpkg/bootstrap-vcpkg.bat).
    If build completes successfully, vcpkg.exe is generated in current directory.

    It is useful to add Vcpkg path to environment variable "Path".

    Variable Value
    Path ;C:vcpkg
  5. Check Vcpkg
  6. Please open PowerShell, and enter following command.

        vcpkg
        

    It is displayed as follows.

Basic Commands

Basic commands frequently used in Vcpkg are as follows.

  • vcpkg install <pkg>:[triplet] / vcpkg remove <pkg>:[triplet]
  • Install or Uninstall package.
    At that time, the dependent libraries of package will also be installed or uninstalled.

    If you don't specify target (triplet), Vcpkg install dynamic link library for x86.
    If you want to use other target, You can specify triplet after package name.

    The packages will be installed in vcpkg/installed/<triplet>.

    	# x86 dynamic link library (default)
    	vcpkg install boost:x86-windows
    	
    	# x86 static link library
    	vcpkg install boost:x86-windows-static
    	
    	# x64 dynamic link library
    	vcpkg install boost:x64-windows
    	
    	# x64 static link library
    	vcpkg install boost:x64-windows-static
    	
    	# x86 dynamic link library (default)
    	vcpkg remove boost:x86-windows
    	
    	# x86 static link library
    	vcpkg remove boost:x86-windows-static
    	
    	# x64 dynamic link library
    	vcpkg remove boost:x64-windows
    		
    	# x64 static link library
    	vcpkg remove boost:x64-windows-static
    	
  • vcpkg search
  • Shows package list that currently supported.

    	# List Supported Packages
    	vcpkg search
    	
  • vcpkg list
  • Shows package list that currently installed.

    	# List Installed Packages
    	vcpkg list
    	
  • vcpkg integrate install / vcpkg integrate remove
  • Set to able to be use packages that installed by Vcpkg in all Visual C++ projects.
    You don’t need to settings project. You can develop program that use these libraries as it is.

    Setting is vcpkg integrate install, UnSetting is vcpkg integrate remove.

    	# Integrate
    	vcpkg integrate install
    	
    	# UnIntegrate
    	vcpkg integrate remove
    	

How to Generate Own Projects that use Installed Packages?

You can use the libraries that installed by Vcpkg in your own project using one of the following ways.

  • Use Vcpkg Integrate Command
  • You can develop program that use these libraries in all Visual C++ projects (all existing projects and all new projects) using after following command.

        # Integrate Vcpkg Settings to All Visual C++ Projects
        vcpkg integrate install
        
  • Use CMake
  • Just add the following line to CMakeLists.txt.
    find_package() will find the libraries that installed by Vcpkg.

        # Setting to use Vcpkg
        set( CMAKE_TOOLCHAIN_FILE "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" )
        
  • Use Manual Settings

Reference

Vcpkg documentation is following link.
If you found bug, Please report to issues of Vcpkg repository.
Also, If you have questions or requests, Please post to same place.


2 thoughts on “Point Cloud Library is available in Vcpkg”

  1. I downloaded the last version of vcpkg as the tutorial and got this error:

    CMake Error at ports/msmpi/portfile.cmake:56 (message):
      Could not find:
        C:\Program Files/Microsoft MPI/Bin/mpiexec.exe
      Please install the MSMPI redistributable package before trying to install this port.
      The appropriate installer has been downloaded to:
        C:/vcpkg/downloads/MSMpiSetup-8.1.exe
    
    Call Stack (most recent call first):
      scripts/ports.cmake:72 (include)
    
    
    Error: Building package msmpi:x64-windows-static failed with: BUILD_FAILED
    Please ensure you're using the latest portfiles with `.\vcpkg update`, then
    submit an issue at https://github.com/Microsoft/vcpkg/issues including:
      Package: msmpi:x64-windows-static
      Vcpkg version: 0.0.100-2017-12-06-29163e1566403c371a5af48c8dbf3d96da32b8d1
    
    Additionally, attach any relevant sections from the log files above.
    

    So i checked this issue: https://github.com/Microsoft/vcpkg/issues/1132 however, i already have the latest version.

    Fixed refering to this: https://github.com/Microsoft/vcpkg/issues/1375

    Where this PowerShell code:

    vcpkg install msmpi --debug
    

    Outputs the same message stated before…

    So the directory below is opened:
    -&gt; .\src\vcpkg\downloads
    
    Then the msmpi is installed manually, opening this two files:
    msmpisdk.msi
    MSMpiSetup.exe
    

    or

    type ...\vcpkg\ports\msmpi\portfile.cmake
    

Leave a Reply

Your email address will not be published. Required fields are marked *