Skip to content

Commit

Permalink
Use colcon for Windows building compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Sep 13, 2024
1 parent c2c4f91 commit 938f4c9
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ sudo apt-get update
sudo apt install libsdformat<#>-dev libsdformat<#>
```

Be sure to replace `<#>` with a number value, such as 2 or 3, depending on
Be sure to replace `<#>` with a number value, such as 14 or 15, depending on
which version you need, or leave it empty for version 1.

### macOS
Expand All @@ -82,7 +82,7 @@ Install sdformat:
brew install sdformat<#>
```

Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
Be sure to replace `<#>` with a number value, such as 14 or 15, depending on
which version you need.

### Windows
Expand Down Expand Up @@ -126,7 +126,7 @@ Clone the repository
```sh
git clone https://github.com/gazebosim/sdformat -b sdf<#>
```
Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
Be sure to replace `<#>` with a number value, such as 14 or 15, depending on
which version you need.

### Build from Source
Expand Down Expand Up @@ -168,7 +168,7 @@ Clone the repository
```sh
git clone https://github.com/gazebosim/sdformat -b sdf<#>
```
Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
Be sure to replace `<#>` with a number value, such as 14 or 15, depending on
which version you need.

Install dependencies
Expand Down Expand Up @@ -213,34 +213,37 @@ conda activate gz-ws

Install prerequisites:
```
conda install tinyxml2 urdfdom --channel conda-forge
conda install cmake git vcstool colcon-common-extensions ^
tinyxml2 urdfdom pybind11 -channel conda-forge
```

Install Gazebo dependencies:
### Getting the sources and building from Source

You can view lists of dependencies:
```
conda search libsdformat --channel conda-forge --info
```
Be sure to replace `<#>` with a number value, such as 14 or 15, depending on
which version you need.

1. Getting the sources

Install dependencies, replacing `<#>` with the desired versions:
```
conda install libgz-cmake<#> libgz-math<#> libgz-tools<#> libgz-utils<#> --channel conda-forge
mkdir ws\src
cd ws
vcs import src --input https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/sdformat<#>.yaml
```

### Build from Source
2. Build from source

This assumes you have created and activated a Conda environment while installing the Prerequisites.
Note: the Gazebo library dependencies are going to be compiled from source
with sdformat although it should be possible to install them from
conda-forge on stable Gazebo releases using the standard conda install
command.

1. Configure and build
```
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\install
cmake --build . --config Release
```
Build the gazebo libraries needed as dependencies (skip testing to speed up the compilation)
using the [colcon](https://colcon.readthedocs.io/en/released/) tool:
```
colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-skip sdformat<#>
```

2. Install
```
cmake --install . --config Release
```
Build sdformat with its test suite:
```
colcon build --cmake-args -DBUILD_TESTING=ON --merge-install --packages-select sdformat<#>
```

0 comments on commit 938f4c9

Please sign in to comment.