Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use colcon for Windows building compilation #1481

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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<#>
```
Loading