Skip to content

multiple separate applications in module build #4

@celinakalus

Description

@celinakalus

First off: Don't worry about answering this before or during the holidays.

I am currently trying to implement a module build where the top level is a Zephyr module, and there are multiple UFW/Zephyr applications in different subfolders which act as samples or tests for the module. Defining it in module.yaml seems to be possible by doing:

targets:
  - application: application1/
    # ...
  - application: application2/
    # ...

When I do this, the concerning directory needs to also be included in CMake, because the module build will be started from the parent directory of the module.yaml:

add_subdirectory(application1)
add_subdirectory(application1)

This, however, leads to a problem, because each of these applications has a target app, and they will all try to put their sources into the same build output.

Instead I could do this:

if(DEFINED UFW_ZEPHYR_APPLICATION)
        message("Building application ${UFW_ZEPHYR_APPLICATION}")
        add_subdirectory(${UFW_ZEPHYR_APPLICATION})
endif()

This works as long as this is built as a toplevel module build (so mmh in that folder), but as soon as I try to add this repository as a dependency to other system.yaml or module.yaml, it obviously breaks, because suddenly, UFW_ZEPHYR_APPLICATION is out of tree.

Not entirely sure what the best strategy for this use case would be. Maybe module builds should be able to specify other base directories for CMake, so CMake can be started from the application directly? Or there should be some way for the CMake infrastructure to tell which application should be built, if any? Maybe you disagree and module builds should not support any of this? Maybe there already is a way, in which case I would be very happy about a hint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions