Skip to content

Support multiple CMake targets as outputs #104

@baszalmstra

Description

@baszalmstra

A single cmake project can build a library, viewers, headers, examples, tests, etc. All of these are represented as different "targets".

When we build a project, the cmake build backend installs the default (ALL_BUILD) target, which installs all targets together. However, this might not be desired. Instead, it might be desirable to produce independent conda packages.

I propose that we provide some control to the user to allow mapping cmake targets to conda package outputs:

[[tool.pixi-build-cmake.outputs]]
# The name of the conda package
name = "library"             

# The CMake target name. We will invoke `install/<cmake_target_name>` to build the package. 
# Defaults to `name` if not specified
cmake_target_name = "my_library"

[[tool.pixi-build-cmake.outputs]]
# The name of the conda package
name = "viewer"             

# Record a dependency on another cmake target. This will be reflected as a conda dependency.
# Any name mentioned here must be another output.
dependencies = ["library"]

If the outputs array is empty the default target will be packaged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeRelated to the CMake build backend

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions