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

Prototype: parse version number from package.xml #639

Open
wants to merge 1 commit into
base: scpeters/build_python_bindings_separately
Choose a base branch
from

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Oct 20, 2024

not for merging: part of #636

This uses a short python script to parse the version number from the package.xml file. It does minimal validation:

  • ensuring that the root element is <package>
  • takes the first child '' element
  • validate the text of the <version> element using the regex from catkin_pkg

In order to run this script from cmake, we need to find Python3 before the project() statement. It also splits the version number and uses the major version in the project name.

If we like this approach, we can consider adding the script and a helper cmake function/macro to gz-cmake, so that the block of cmake code before the project() statement could be replaced by find_package(gz-cmakeX) and then the helper cmake call. Note that we can't wrap the project() call (from cmake docs):

The top-level CMakeLists.txt file for a project must contain a literal, direct call to the project() command; loading one through the include() command is not sufficient. If no such call exists, CMake will issue a warning and pretend there is a project(Project) at the top to enable the default languages (C and CXX).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

1 participant