The CMake situation in frameworks

Ingo Klöcker kloecker at kde.org
Mon Nov 28 22:23:39 UTC 2011


On Saturday 26 November 2011, Stephen Kelly wrote:
> > 
> > target_link_libraries(foo
> > 
> >    LINK_PUBLIC
> >    ${QT_QTCORE_LIBRARIES}
> >    LINK_PRIVATE
> >    ${QT_QTSCRIPT_LIBRARIES}
> > 
> > )
> 
> Only this or
> 
> target_link_libraries(foo
>    LINK_PRIVATE
>    ${QT_QTSCRIPT_LIBRARIES}
>    LINK_PUBLIC
>    ${QT_QTCORE_LIBRARIES}
> )
> 
> would work. I don't remember why. It might make sense to allow
> specifying only one of them, so that the below would be equivalent
> to the above.
> 
> target_link_libraries(foo
>    ${QT_QTSCRIPT_LIBRARIES}
>    LINK_PUBLIC
>    ${QT_QTCORE_LIBRARIES}
> )
> 
> target_link_libraries(foo
>    ${QT_QTCORE_LIBRARIES}
>    LINK_PRIVATE
>    ${QT_QTSCRIPT_LIBRARIES}
> )
> 
> But I guess the cmake devs would have to agree to it.

If anything then target_link_libraries() should have one well-defined 
default and everything else should have to be specified explicitly. 
Everything else is just confusing and error-prone. In C++ it was done 
right for classes (and structs): A well-defined default combined with an 
easy to understand way to change it explicitly.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20111128/ad81430e/attachment.sig>


More information about the Kde-buildsystem mailing list