Automatically generating list of extracted modules

I am using Dune in a Coq project, which extracts OCaml code. Since I am using recursive extraction, the list of extracted modules is long and changes if I modify code (import new modules). I am looking for a way to automatically compute extracted_modules field in coq.extraction based on generated .mli files.

Something along the lines (extracted_modules (glob_files *.mli)). This gives “Error: Atom or quoted string expected” error. Even if it works, I will also need to strip .mli extension from file names in the list.

Is something like this possible?