-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add CMake macro for generating pybind11 bindings #215
Comments
While packaging new versions of ign-gazebo/ign-math I had the same thought. It would be great if we can de-duplicate the code and use a unify macro for it.
Currently |
I made the needed changes for pybind11 in gazebosim/gz-math#402 to fix the related issue. include(IgnPython)
search_pybind11_library() # does a find_package(Python3) twice, once without Development and once with (+ there are even more options like numpy/different developments) separate module: include(IgnPythonBindings) I don't know but might it be possible to do However, for similarity between different Python 'includes' I think it would make sense to have a common way on how to use/find Python3 - a single macro for each case of finding Python3, a macro with several arguments to specify the needs or separate and specific include modules. |
Desired behavior
Right now there is some code duplication in ign-gazebo and ign-math for finding pybind11. I assume the goal is to provide Python interfaces also for other packages in the future, thus it makes sense to have a common macro for it.
Implementation suggestion
Since
PythonLibs
is deprecated, the snippet should also use FindPython3 which will be provided with PR #213 .It might be useful to extend the new
IgnPython
to provide several arguments as input in order to reuse the existing code but this might require some additional effort than creating an independentIgnPythonBindings
macro.The text was updated successfully, but these errors were encountered: