Find the `.cmt` built by `dune @check` from the original file name


I want, from the name of a source file, to get the corresponding .cmt built by dune @check. Is there any convenient way to do it? I tried to use dune rules without success and doing it by hand seems messy.

Thanks in advance for your time!

In upcoming dune 2.0 there is a feature to do this, see . However it only supports cmo, cmi, cmx, cma, cmxa right now. It would not be very hard to add cmt I think.