[CMake] Why does INTERFACE type targets only support whitelisted properties?
Innokentiy Alaytsev
alaitsev at gmail.com
Sat Jun 23 12:52:16 EDT 2018
Yves Frederix wrote
> Hi all,
>
> Motivated by my own struggles with targets of type INTERFACE and a
> recent post on this list, I was wondering what is the rationale behind
> allowing only a whitelisted set of properties on targets of this type.
> I understand that one of the use cases for INTERFACE libraries is to
> have a way to work with header-only libraries in a more or less
> standard way. Yes, the current implementation is far from optimal on
> more than one aspect, but I never understood the reason for the
> whitelisting (also google didn't make me any wiser). What am I
> missing? Wouldn't INTERFACE targets be easier to use without these
> restrictions (or alternatively by switching to blacklisting of some
> properties to protect a user from having wrong expectations)?
>
> Thanks!
> Yves
Hello!
Sorry for necroposting.
I had a problem with the same limitations for the INTERFACE_LIBRARY targets'
properties. However, there is an interesting feature of this type of
targets: according to the documentation
<https://cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#interface-libraries>
, properties matching INTERFACE_* are allowed to be set. I don't know
whether it is a bug or a feature, but this works not only for standard CMake
target properties but for user-defined properties as well.
Best regards
Innokentiy Alaytsev
--
Sent from: http://cmake.3232098.n2.nabble.com/
More information about the CMake
mailing list