This repository contains the scripts to generate the Windows binaries for the dependencies of the robotology-superbuild using vcpkg.
For each release, the scripts in this repo generate two binaries:
vcpkg-robotology.zip
: contains the pre-compiled vcpkg dependencies of the robotology-superbuild, except the Gazebo dependency required by the ROBOTOLOGY_USES_GAZEBO optionvcpkg-robotology-with-gazebo.zip
: contains the pre-compiled vcpkg dependencies of the robotology-superbuild, including the Gazebo dependency required by the ROBOTOLOGY_USES_GAZEBO option
The binaries are generated by installing vcpkg and any additional dependency in C:/robotology
, and compressing the C:/robotology
directory in a .zip
archive.
Check in the releases page to download the archive with the dependencies, and to check the exact port included in each release.
To install , you just need to download either vcpkg-robotology.zip
or vcpkg-robotology-with-gazebo.zip
and extract it in the C:/
directory.
The archive contains a robotology
directory, that will be available in your system as C:/robotology
.
To use then vcpkg libraries, you need to configure your CMake projects to use the vcpkg's
toolchain as CMAKE_TOOLCHAIN_FILE
, for example by configuring the projects as:
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/robotology/vcpkg/scripts/buildsystems/vcpkg.cmake ..
See vcpkg's documentation for more info on how to use vcpkg-installed libraries.
If you prefer to avoid the use of the CMAKE_TOOLCHAIN_FILE
, the archive also contains a few scripts that set in the enviroment
the necessary enviroment variables to make sure that vcpkg and Gazebo dependencies can be found and used:
C:/robotology/scripts/setup-deps.bat
: Batch script to set the enviroment variables in a Command Prompt terminal.C:/robotology/scripts/setup-deps.sh
: Bash script to set the enviroment variables in a Git for Windows bash terminal, can be included in the.bash_profile
.C:/robotology/scripts/addPathsToUserEnvVariables-deps.ps1
: Powershell scripts to permanently add or remove the enviroment
variables in the User Enviroment Variables. Use of this scripts permit to avoid executing thesetup-*
scripts whenever it is necessary to executecmake
or the program that use the binaries contained in the dependencies archive, but can conflict with other programs or libraries installed in your system.
This section contains some information specific to the vcpkg-robotology-with-gazebo
archive.
As this archive contains also the Gazebo simulator that is not installed via vcpkg, it is not possible to find the Gazebo dependency via
the vcpkg
's CMAKE_TOOLCHAIN_FILE
, and instead you need to use the scripts to setup the enviromental variables described in the previous section.
Differntly from the rest of the libraries installed by vcpkg
, the Gazebo binaries available via vcpkg-robotology-with-gazebo
only support to be compiled
against code compiled in Release
build, so if you want to enable the ROBOTOLOGY_USES_GAZEBO
of the robotology-superbuild then you must compiled the superbuild in Release
.
As Gazebo on Windows does not provide the single gazebo
executable available in Linux and macOS, you need to separately launch gzserver
(the command line executable that runs the actual physics simulation) and gzclient
(the graphical user interface to the simulator).
You can install or remove ports from the vcpkg installation in C:/robotology/vcpkg
as you do for any other vcpkg installation.
To reduce the size of the pre-compiled archives, the .pdb files (see https://stackoverflow.com/questions/3899573/what-is-a-pdb-file) that contain the debug symbols of the provided library are removed from both the Release and Debug version of the vcpkg-installed libraries. If you need to have the debug symbols of the vcpkg-installed libraries, it is suggested to install the vcpkg ports directly without relying on the pre-compiled archive provided by this repo.
To use the script in a GitHub Action script, you can use the following snippet:
- name: Dependencies [Windows]
if: matrix.os == 'windows-latest'
run: |
# To avoid spending a huge time compiling vcpkg dependencies, we download an archive
# that comes precompiled with all the ports that we need
choco install -y wget unzip
# To avoid problems with non-relocatable packages, we unzip the archive exactly in the same directory
# that has been used to create the pre-compiled archive
cd C:/
wget https://github.com/robotology/robotology-superbuild-dependencies-vcpkg/releases/download/<INSERT_HERE_THE_USED_VERSION>/vcpkg-robotology.zip
unzip vcpkg-robotology.zip -d C:/
rm vcpkg-robotology.zip
You can then specify the CMAKE_TOOLCHAIN_FILE
for the CMake projects that you want that use the installed dependencies, or execute the enviroment variables
setup scripts.