[CMake] Fortran 90 module output directories, dependency analysis
Jed Brown
jed at 59A2.org
Tue Jun 1 14:00:26 EDT 2010
On Tue, 01 Jun 2010 13:48:21 -0400, Brad King <brad.king at kitware.com> wrote:
> You can delete the object file the provides the module.
That doesn't seem to be enough if there is another target that depends
on the module. E.g. if I delete petscmat.mod and
CMakeFiles/.../petscmatmod.F.o, then run 'make all', I get an error
because the module file in the solver package includes it. If I 'make
petscmat' first, the module file is rebuilt, and then 'make all' can
handle the rest.
> The problem is that the build system doesn't actually point directly
> at the .mod files so it doesn't know when they are missing. I don't
> remember all details off the top of my head, but there are very good
> reasons that the build system doesn't see .mod files directly.
>
> Fixing this would require some kind of side-effect map. At the start
> of each build the object file providing a missing module would need
> to be deleted. We already have something similar for custom commands
> with multiple outputs, but a major distinction is that CMake knows
> what files are paired together at generation time. Object->module
> mapping is not known until build time (during dependency scanning).
Yes, sure would be nice if the language designers thought about such
things...
> I have no time to look at this, but I can get you started if you want
> to try it yourself.
I probably don't have time for it either, but it always helps to have a
bug report with a "how to fix" description around.
Thanks,
Jed
More information about the CMake
mailing list