SPM group targets in folder tree


I have a question using SPM to manage several native dependencies.
My project needs to be linked with EGL, DRM and OpenGL ES native linux libraries so i have created some targets, configued as systemLibrary, to include these dependencies.

My SPM project tree is similar to:


My Package.swift contains a target section with

targets: [
        .systemLibrary(name: "CDrm"),
        .systemLibrary(name: "CEgl"),
        .systemLibrary(name: "CGles"),
            name: "ProductLib",
            dependencies: ["CDrm", "CEgl", "CGles"]),
            name: "Product",
            dependencies: ["ProductLib"])

This works well but i would like to group system libraries in a separated folder, such as:


but using this structure and specifing name: "Native/CEgl", SPM doesn't works and doesn't recognise nested folders.
How can i manage this project structure?


The name argument defines what a client will use when it imports the module; it isn’t a path.

There is an optional path argument for when you want to put a target in a non‐standard location:

  name: "CDrm",
  path: "Native/CDrm" // Relative to package root.

Thank you very much, it works.