SPM group targets in folder tree

Hi,

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:

RootFolder
-Product
--main.swift
-ProductLib
-CEgl
-CDrm
-CGles

My Package.swift contains a target section with

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

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

RootFolder
-Product
--main.swift
-ProductLib
-Native
--CEgl
--CDrm
--CGles

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?

Thanks,
Lorenzo

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:

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

Thank you very much, it works.