colcon / colcon-mixin

Extension for colcon to read CLI mixins from files
http://colcon.readthedocs.io
Apache License 2.0
2 stars 7 forks source link

Apply a mixin to a specific package #41

Closed allsey87 closed 7 months ago

allsey87 commented 2 years ago

Is it currently possible to apply something like cmake-args to a specific package? For example, something like the following mixin, but with the cmake-args only applied to package_to_apply_cmake_args (the mixin below does not achieve this, it applies cmake-args to all packages).

{
    "build": {
        "custom-mixin": {
            "packages-up-to": ["package_to_apply_cmake_args"],
            "cmake-args": [
                "-DBUILD_SHARED_LIBS=OFF"
            ]
        }
    }
}
christophebedard commented 2 years ago

I don't think so. For per-package options, you could use a colcon.pkg file or a .meta file, but it's not the same thing as using a mixin.

allsey87 commented 2 years ago

Thanks @christophebedard, I will take a different approach then but will leave this issue open to be marked as a potential enhancement.

By the way, I really liked your implementation/blog on rmw_email, it helped me a fair bit when I was working on ROS On Web.

christophebedard commented 2 years ago

By the way, I really liked your implementation/blog on rmw_email, it helped me a fair bit when I was working on ROS On Web.

Nice, good to hear it was useful!

cottsay commented 7 months ago

@christophebedard is right here - meta files are the recommended way to do something like adding cmake arguments for a specific package. There's no way to make a meta file apply to a set of packages though.

I think that either way, a PR to improve colcon-metadata would be the most likely path to landing a feature like this.