`PUBLIC_HEADER` is forced to be installed
Let's say you are installing a target in multiple locations which has defined a PUBLIC_HEADER
properties. Currently cmake forces you to install the header file as well.
A use-case where you can see this setup is when you are developing a main C++ library and you are offering some Python language bindings and so on. The main library you might want it installed in /usr/lib/foo.so
, and the python module will try to pick up on the system installed library (maybe you have options enabled/disabled on system), and if it fails it will use the bundled library /usr/lib64/python3.xx/site-packages/foo/foo.so
. But in order to install only the shared library there, we should disable, or add an option to do so, for PUBLIC_HEADER
. All other components can be omitted and it will simply ignore them.