[CMake] Querying targets for Fortran module files & module file installation advice

Zaak Beekman zbeekman at gmail.com
Wed Apr 3 10:09:57 EDT 2019


Thanks so much Brad!

On Wed, Apr 3, 2019 at 9:35 AM Brad King <brad.king at kitware.com> wrote:

> The `install(DIRECTORY)` approach is the current recommendation.

OK

> Do those directories contain the `.mod` files or are they extra?
> In the latter case, use `install(DIRECTORY)`'s options for excluding
> content by pattern or regex.

They contain the mod files. I didn't ask for a $<config> directory to
be created for me within the CMAKE_Fortran_MODULE_DIRECTORY but it's
there, and all the .mod files are inside it, so `install(DIRECTORY
...)` is incapable (at least in my testing) of fetching them out of
the $<config> subdirectory.

> Set the per-target Fortran_MODULE_DIRECTORY property to keep private
> modules out of the installed directory.

That's the plan.

> We don't have that information at CMake time.  The set of files is
> not discovered until the build, and there is no one place that has
> the full set.

Hmmmm ok, thanks for the info. Fortran, always making tooling hard...

Well thank you SO MUCH once again for the response.

Best,
Zaak


More information about the CMake mailing list