Component build backend configuration options

Contents

Component build backend configuration options#

The py_build_cmake.build_component build backend allows building packages containing additional binaries that are not included with the main distribution.

A possible use case is distributing debug symbols: these files can be large, and most users don’t need them, so distributing them in a separate package makes sense.

See examples/minimal-debug-component for more information.

The most important option is main_project, which is a relative path that points to the directory containing thepyproject.toml of the main package (where all CMake options are defined). Next, the options in the component section define which CMake projects and components should be installed in this component package.

component#

Options for a separately packaged component.

Option

Description

Type

Default

build_presets

CMake presets to use for building. Passed as --preset <?> during the build phase, once for each preset.

list

none

build_args

Extra arguments passed to the build step.
For example: build_args = ["-j", "--target", "foo"]

list+

none

build_tool_args

Extra arguments passed to the build tool in the build step (e.g. to Make or Ninja).
For example: build_tool_args = ["--verbose", "-d", "explain"]

list+

none

install_only

Do not build the project, only install it.
For example: install_only = true

bool

false

install_args

Extra arguments passed to the install step.
For example: install_args = ["--strip"]

list+

none

install_components

List of components to install, the install step is executed once for each component, with the option --component <?>.

list

required