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

[Feature request] Include CMake files in the wheel #2266

Closed
henryiii opened this issue Jun 26, 2020 · 1 comment · Fixed by #2433
Closed

[Feature request] Include CMake files in the wheel #2266

henryiii opened this issue Jun 26, 2020 · 1 comment · Fixed by #2433
Assignees

Comments

@henryiii
Copy link
Collaborator

henryiii commented Jun 26, 2020

The wheels are missing the CMake files in the data directory - the includes are there, but not the CMake Configure files. A very nice and natural use of PEP 518 builds would be to include "pybind11" in your pyproject.toml, then pybind11 is installed for the build process, but nothing else. This doesn't currently work if you want to also use the CMake config.

This would further simplify scikit-build/scikit-build-sample-projects#6

@ktbarrett
Copy link

I second this. I have a combo C++/Python project that could benefit.

The current alternatives are:

  1. FetchContent (which is only available to newer CMake and you have to manually bump versions)
  2. Keeping pybind11 as a submodule (requires manual version bump).

Setuptools allows you to specify sets of versions, which may automatically pull in the latest version. PEP518 and setuptools support for it allows for build isolation, something that neither of the previous solutions accomplish.

Distributing CMake project files with a Python package is not terribly radical. I have a project that demonstrates the distribution of a CMake project in a Python package; as well as an example C++ project that includes the CMake project, as installed in the package directory.

I think the only issue is deciding where in the package to install them. Considering the paths that find_library looks at, setting CMAKE_PREFIX_PATH to the Python package installation prefix and using find_package(pybind11) will search:

<prefix>/<name>*/(lib/<arch>|lib*|share)/cmake/<name>*/  
<prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/  
<prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/

Making the change in this project might also be motivation to update either scikit-build or scikit's cmake package to point to the Python package installation prefix by default, to better support this mode of distribution within a Python context.

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

Successfully merging a pull request may close this issue.

2 participants