What is the correct way to install header only targets? Currently I’m doing something like this;
install(
DIRECTORY include/my_header_interface
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
Trying to do install(TARGETS my_header_interface)
simply fails. Why is that?
Setting target properties PUBLIC_HEADER
and installing that seems very clumsy.
I would also like to install my target only, e.g. ninja my_header_interface/install
, but INTERFACE
targets are not seen in ninja.