fortran-lang / fpm

Fortran Package Manager (fpm)
https://fpm.fortran-lang.org
MIT License
845 stars 95 forks source link

`fpm install` does not copy c/c++ headers to the installation folder #996

Open perazz opened 4 months ago

perazz commented 4 months ago

Description

If I build a Fortran library that has an ISO C binding, and I provide C/C++ headers as a companion then I would like them to be shipped with the static library, so whoever wants to use said library have the whole solution. Currently, only Fortran module (.mod) files are shipped in library.include-dir.

Possible Solution

As a first step, let's address C/C++ headers from library.src-dir only. This way, there is no need to handle nested folders the headers may need. fpm should just parse them, include them in the list of installed files and copy them to library.include-dir.

Additional Information

An example can be seen running fpm install with fitpack.

MilanSkocic commented 4 months ago

It would be convenient if fpm could install the C headers along the Fortran headers. Currently, I use a workaround with a makefile.