Fwd: Reminder: use KF5::foo instead of ${foo_LIBRARIES} in CMakeLists

Alexander Neundorf neundorf at kde.org
Wed Sep 25 17:13:00 UTC 2013


On Wednesday 25 September 2013, Aurélien Gâteau wrote:
...
> Unfortunately, ALIAS is a new feature of the add_library command, which is
> only available in cmake git for now and will be in 2.8.12. Therefore we
> cannot use this solution right now. This means we can't have standalone
> builds of tier2 and tier3 frameworks. tier1 frameworks are OK since by
> definition they do not depend on other frameworks.
> 
> The alternative syntax: ${KConfigCore_LIBRARIES} would work in both cases,
> but it is more error prone: any typo in the variable name causes the
> variable to be expanded to an empty string, making it more difficult to
> debug, whereas using target names provide more explicit error messages.

I said it before, this "alternative syntax" has the advantage that it has been 
working in cmake forever, and all developers using cmake know this syntax. 
Calling being able to make typos in variable names a disadvantage seems weird 
to me. This applies to all variables you'll ever use in cmake, everywhere.

Alex


More information about the Kde-frameworks-devel mailing list