fpm icon indicating copy to clipboard operation
fpm copied to clipboard

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

Open perazz opened this issue 2 years ago • 2 comments

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.

perazz avatar Feb 14 '24 18:02 perazz

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

MilanSkocic avatar Mar 05 '24 21:03 MilanSkocic

Installing header files would be very useful in the Assert repository, where I'm introducing the option to call a C-like assert procedure that via a macro in a .h header file. This facilitates completely eliminating the call for production builds.

rouson avatar Aug 07 '24 03:08 rouson