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

Closed
wants to merge 9 commits into 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).

traversaro and others added 9 commits October 11, 2024 11:23
Use CMAKE_INSTALL_LIBDIR from GNUInstallDirs instead
of GZ_LIB_INSTALL_DIR, which won't be available if
only building python bindings.

Signed-off-by: Steve Peters <[email protected]>
Refer to https://brew.sh instead of duplicating the
brew installation command.

Signed-off-by: Steve Peters <[email protected]>
* Describe Pybind11 as a dependency
* Document how to build bindings separately from the
  main gz-math library

Signed-off-by: Steve Peters <[email protected]>
Moves find_package(pybind11) call to src/python_pybind11
folder. When invoked through the root CMakeLists.txt,
it treats pybind11 as an optional dependency, but when
invoked from that folder, it treats it as required by
setting CMAKE_REQUIRE_FIND_PACKAGE_pybind11 to TRUE.

Signed-off-by: Steve Peters <[email protected]>
Base automatically changed from scpeters/build_python_bindings_separately to gz-math8 October 28, 2024 20:50
@scpeters
Copy link
Member Author

scpeters commented Nov 9, 2024

superseded by #642

@scpeters scpeters closed this Nov 9, 2024
@scpeters scpeters deleted the scpeters/parse_version_from_package_xml branch November 9, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants