Skip to content

Understanding the option wheel.install-dir #1099

@TonyXiang8787

Description

@TonyXiang8787

Hi,

We have a C++/Python project and we are considering using scikit-build for its Python build backend. By default, scikit-build installs the cmake targets into the root of site-packages, which is usually not what we want. In all the official examples, it specifies DESTINATION in the cmake install targets to let cmake to install the files into some folders in the site-packages.

But we cannot do this intrusive approach because the CMakeLists.txt is supposed to be used by regular C/C++ user. We can try to add some if statement in the cmake to conditionally set DESTINATION in the cmake install targets. But then I see the option wheel.install-dir. If I understand correctly, I can set the following into pyproject.toml.

wheel.install-dir = "MY_PACKAGE_NAME/my_module_name"

The scikit-build will install all the targets in site-packages/MY_PACKAGE_NAME/my_module_name. In this way I can keep all the CMakeLists.txt unchanged as a regular C/C++ project. Is that the correct understanding?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions