Skip to content

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

Closed

Description

@henryiii

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

Activity

  1. ktbarrett commented on Jul 6, 2020

    @ktbarrett

    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.

  2. self-assigned this
    on Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions