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

FindIgnURDFDOM cmake module #193

Merged
merged 8 commits into from
Nov 30, 2021
Merged

Conversation

koonpeng
Copy link

@koonpeng koonpeng commented Nov 10, 2021

🎉 New feature

Summary

Adds a minimal FindURDF.cmake module, this will help migrate sdformat to ign-cmake gazebosim/sdformat#181.

Test it

cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
find_package(ignition-cmake2 REQUIRED)
ign_find_package(URDF REQUIRED)

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

Signed-off-by: Teo Koon Peng <[email protected]>
@github-actions github-actions bot added Gazebo 1️1️ Dependency of Gazebo classic version 11 🌱 garden Ignition Garden 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress 🏰 citadel Ignition Citadel 🔮 dome Ignition Dome labels Nov 10, 2021
@traversaro
Copy link
Contributor

Could it make sense to call it FindIgnURDFDOM? In the past we had problems with collision between ign-cmake provided Find<pkg>.cmake and similarly named files distributed by other projects (see for example #40). Naming (at least new) all Find**.cmake scripts as FindIgn***.cmake should avoid these kind of problems. Furthermore, the library that this scripts finds is called urdfdom (see https://github.com/ros/urdfdom and https://repology.org/project/urdfdom/versions), so using urdfdom also in the Find script may avoid confusion.

@scpeters
Copy link
Member

Could it make sense to call it FindIgnURDFDOM? In the past we had problems with collision between ign-cmake provided Find<pkg>.cmake and similarly named files distributed by other projects (see for example #40). Naming (at least new) all Find**.cmake scripts as FindIgn***.cmake should avoid these kind of problems. Furthermore, the library that this scripts finds is called urdfdom (see https://github.com/ros/urdfdom and https://repology.org/project/urdfdom/versions), so using urdfdom also in the Find script may avoid confusion.

I agree; please rename to FindIgnURDFDOM

Signed-off-by: Teo Koon Peng <[email protected]>
Copy link
Contributor

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid that the current implementation is not valid for Windows/MSVC builds.

Is there any particular reason not to use the urdfdom CMake modules instead of using pkg-config? I think that we could support Windows and other system well by using CMake if possible.

@scpeters scpeters changed the title module: add find urdf FindIgnURDFDOM cmake module Nov 11, 2021
@scpeters
Copy link
Member

I'm afraid that the current implementation is not valid for Windows/MSVC builds.

Is there any particular reason not to use the urdfdom CMake modules instead of using pkg-config? I think that we could support Windows and other system well by using CMake if possible.

the SDFormat search logic has a fall-back to find_package if pkg_check_modules does not find it:

it looks like DART now uses only find_package:

@koonpeng
Copy link
Author

I'm afraid that the current implementation is not valid for Windows/MSVC builds.

Is there any particular reason not to use the urdfdom CMake modules instead of using pkg-config? I think that we could support Windows and other system well by using CMake if possible.

I missed that urdfdom supports cmake. But sdformat prefers the pkgconfig and fallbacks to cmake, should we change it to prefer cmake first? One downside with the cmake config is that it does not support version checking.

Signed-off-by: Teo Koon Peng <[email protected]>
@j-rivero
Copy link
Contributor

I missed that urdfdom supports cmake. But sdformat prefers the pkgconfig and fallbacks to cmake, should we change it to prefer cmake first? One downside with the cmake config is that it does not support version checking.

It is my impression that we should prioritize CMake over pkg-config as much as we can. The problem with no version checking with urdfdom CMake is unfortunate and seems a big thing to me. In this case we can document that we try pkg-config first for that reason.

@j-rivero
Copy link
Contributor

It is my impression that we should prioritize CMake over pkg-config as much as we can. The problem with no version checking with urdfdom CMake is unfortunate and seems a big thing to me. In this case we can document that we try pkg-config first for that reason.

I've implemented the suggestion on d46f7cc branch jrivero/add-find-urdf . Let me know if that works for you Koon.

Signed-off-by: Teo Koon Peng <[email protected]>
@koonpeng
Copy link
Author

I've implemented the suggestion on d46f7cc branch jrivero/add-find-urdf . Let me know if that works for you Koon.

Thanks, I just merged that commit in.

@ahcorde
Copy link
Contributor

ahcorde commented Nov 30, 2021

@osrf-jenkins retest this please

@j-rivero j-rivero merged commit 10b4165 into gazebosim:ign-cmake2 Nov 30, 2021
@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-01-10/1228/1

srmainwaring pushed a commit to srmainwaring/gz-cmake that referenced this pull request Mar 1, 2022
* Add find FindIgnURDFDOM module.

Prefer pkg-config since the CMake module at urdfdom lacks the capabilities of version checking.

Signed-off-by: Teo Koon Peng <[email protected]>
Co-authored-by: Jose Luis Rivero <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel 🔮 dome Ignition Dome 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress 🌱 garden Ignition Garden Gazebo 1️1️ Dependency of Gazebo classic version 11
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants