Problems with adding header sources for an INTERFACE library
Currently, it is not possible to add header sources for an INTERFACE library that is being installed. Using add_sources(target INTERFACE ...)
will result with the following error:
Target "units" INTERFACE_SOURCES property contains path:
"/mnt/c/repos/units/src/include/units/dimension.h"
which is prefixed in the source directory.
for every header file.
There are 2 reasons I would like to add those files to a CMake target:
- Some IDE's complain that they cannot run static analysis on such header files as they are not the part of the CMake project.
- Generators (i.e. VS) currently generates a nearly empty entry for the INTERFACE target:
and it would be great if the user of an INTERFACE library could actually see its interface in attached header files.