[cmake-developers] CMake usage requirements in KDE Frameworks

Alexander Neundorf neundorf at kde.org
Thu Mar 21 20:47:57 UTC 2013


On Thursday 21 March 2013, Brad King wrote:
> On 03/21/2013 02:47 PM, Alexander Neundorf wrote:
> > Still, is the "PUBLIC" part necessary ?
> > IMO PRIVATE and INTERFACE suffice, and for me it seems more
> > straighforward to separate only between these two.
> 
> PRIVATE and INTERFACE are sufficient but need to be duplicated
> to produce the equivalent of PUBLIC.  It is very common for an
> implementation dependency to also be a usage requirement, especially
> for include paths.

Yes, sounds ok.
Still I would prefer the interface to be minimal and orthogonal.

At least for me it is also easier to differentiate between "use this when 
building foo" and "use this when using foo" vs. the three options.

When using this in a project, I'd want to keep my interface include dirs 
clean, i.e. as small as possible. With PUBLIC, PRIVATE and INTERFACE, 
directories can be added to the wrong one (i.e. PUBLIC instead PRIVATE or 
INTERFACE) and it will still build, but the interface will be bigger than 
necessary. With only PRIVATE and INTERFACE this can't happen. If you add it to 
the wrong one, it doesn't build.
PUBLIC looks to me more like a convenience feature, but one which can be 
misused, and it's not strictly necessary.
It may become the default choice for many, since it will be the easiest way to 
make some project compile.

How about keeping PUBLIC out for 2.8.11 and adding it later on if it is really 
found to be missing ?
This way is possible, removing later on is not.

Alex


More information about the Kde-buildsystem mailing list