Skip to content

Conversation

@scpeters
Copy link
Contributor

Currently the package version is set in both package.xml and the CMakeLists.txt file and it's easy for them to get out of sync. This updates the cmake code to extract the version string from the package.xml file using a regular expression and passing it to the cmake project() call. This approach implements the suggestion by @clalancette in #233 (review).

Alternative to #233 and #232.

cc @saikishor, @traversaro

Use regex to match version string.
Based on suggestion from Chris Lalancette.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

I've left one minor thing that we should consider fixing, otherwise this looks good to me.

Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters force-pushed the scpeters/cmake_version_from_package_xml_no_python branch from d73d82d to 3c14334 Compare December 17, 2025 04:47
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

This looks good to me! Thanks for taking this one @scpeters

@scpeters scpeters merged commit 9626d2a into rolling Dec 17, 2025
9 checks passed
@scpeters scpeters deleted the scpeters/cmake_version_from_package_xml_no_python branch December 17, 2025 22:23
scpeters added a commit to ros/urdfdom_headers that referenced this pull request Dec 17, 2025
Use regex to match version string.
Copied from ros/urdfdom#236.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
ahcorde pushed a commit to ros/urdfdom_headers that referenced this pull request Dec 18, 2025
Use regex to match version string.
Copied from ros/urdfdom#236.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants