[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Reminder: use KF5::foo instead of ${foo_LIBRARIES} in CMakeLists
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2013-09-25 10:32:39
Message-ID: CACcA1RrVwQ_7ELLY3hDkcSPwuBDkaVn5FOHGS+6zUyYjcueKmw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Wed, Sep 25, 2013 at 11:22 AM, Sebastian K=C3=BCgler <sebas@kde.org> wro=
te:

> CMake-gods, can you confirm the below? (It's inconsistent with my
> understanding, and how we've done it in the past months, I'd like to have=
 a
> specialist opinion before going around and changing every single
> CMakeLists.txt in Plasma.)
>
> Thanks,
>
> -- sebas
>
>
> ----------  Forwarded Message  ----------
>
> Subject: Reminder: use KF5::foo instead of ${foo_LIBRARIES} in CMakeLists
> Date: Wednesday, September 25, 2013, 10:36:46
> From: Martin Gr=C3=A4=C3=9Flin <mgraesslin@kde.org>
> To: plasma-devel@kde.org
>
> Hi all,
>
> just a short reminder. When adjusting a CMakeLists.txt to Qt5 to enable
> e.g. a
> dataengine please use the new namespace syntax in target_link_libraries.
> E.g:
>
>  target_link_libraries(plasma_engine_notifications
>      Qt5::DBus
>     KF5::KI18n
>     KF5::KIconThemes
>     KF5::KIOCore
>     KF5::KNotifications
>     KF5::plasma
>     KF5::KService
>      ${KDE4_KNOTIFYCONFIG_LIBRARY}
>  )
>
> and not
>
>  target_link_libraries(plasma_engine_notifications
>      Qt5::DBus
>     ${Plasma_LIBRARIES}
>     ${KI18n_LIBRARIES}
>     ${KIconThemes_LIBRARIES}
>     ${KNotifications_LIBRARIES}
>     ${KService_LIBRARIES}
>     ${KDE4_KIO_LIBS}
>      ${KDE4_KNOTIFYCONFIG_LIBRARY}
>  )
>
> I just spent the last half our fixing linker errors as  ${KI18n_LIBRARIES=
}
> didn't exist any more.
>
> Thanks,
> Martin
> -----------------------------------------
> --
> sebas
>
> http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel@kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>

The *Config.cmake files should be defining both, if that's not the case
maybe we should be looking deeper at this issue.

Either way, what the definition is, it's (for example):
set(KCompletion_LIBRARIES KF5::KCompletion)

Personally, I prefer not using the variables, because a typo will make it
to run flawlessly but then not working without a warning (because a
nonexisting variable resolves to "").
Aleix

[Attachment #5 (text/html)]

<div dir="ltr">On Wed, Sep 25, 2013 at 11:22 AM, Sebastian Kügler <span \
dir="ltr">&lt;<a href="mailto:sebas@kde.org" \
target="_blank">sebas@kde.org</a>&gt;</span> wrote:<br><div class="gmail_extra"><div \
class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">CMake-gods, \
can you confirm the below? (It&#39;s inconsistent with my<br>


understanding, and how we&#39;ve done it in the past months, I&#39;d like to have \
a<br> specialist opinion before going around and changing every single<br>
CMakeLists.txt in Plasma.)<br>
<br>
Thanks,<br>
<br>
-- sebas<br>
<br>
<br>
----------   Forwarded Message   ----------<br>
<br>
Subject: Reminder: use KF5::foo instead of ${foo_LIBRARIES} in CMakeLists<br>
Date: Wednesday, September 25, 2013, 10:36:46<br>
From: Martin Gräßlin &lt;<a \
                href="mailto:mgraesslin@kde.org">mgraesslin@kde.org</a>&gt;<br>
To: <a href="mailto:plasma-devel@kde.org">plasma-devel@kde.org</a><br>
<div><div class="h5"><br>
Hi all,<br>
<br>
just a short reminder. When adjusting a CMakeLists.txt to Qt5 to enable e.g. a<br>
dataengine please use the new namespace syntax in target_link_libraries. E.g:<br>
<br>
  target_link_libraries(plasma_engine_notifications<br>
        Qt5::DBus<br>
      KF5::KI18n<br>
      KF5::KIconThemes<br>
      KF5::KIOCore<br>
      KF5::KNotifications<br>
      KF5::plasma<br>
      KF5::KService<br>
        ${KDE4_KNOTIFYCONFIG_LIBRARY}<br>
  )<br>
<br>
and not<br>
<br>
  target_link_libraries(plasma_engine_notifications<br>
        Qt5::DBus<br>
      ${Plasma_LIBRARIES}<br>
      ${KI18n_LIBRARIES}<br>
      ${KIconThemes_LIBRARIES}<br>
      ${KNotifications_LIBRARIES}<br>
      ${KService_LIBRARIES}<br>
      ${KDE4_KIO_LIBS}<br>
        ${KDE4_KNOTIFYCONFIG_LIBRARY}<br>
  )<br>
<br>
I just spent the last half our fixing linker errors as   ${KI18n_LIBRARIES}<br>
didn&#39;t exist any more.<br>
<br>
Thanks,<br>
Martin<br>
</div></div>-----------------------------------------<br>
<span class=""><font color="#888888">--<br>
sebas<br>
<br>
<a href="http://www.kde.org" target="_blank">http://www.kde.org</a> | <a \
href="http://vizZzion.org" target="_blank">http://vizZzion.org</a> | GPG Key ID: 9119 \
0EF9<br> _______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" \
target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br> \
</font></span></blockquote></div><br></div><div class="gmail_extra">The *Config.cmake \
files should be defining both, if that&#39;s not the case maybe we should be looking \
deeper at this issue.</div><div class="gmail_extra">

<br></div><div class="gmail_extra">Either way, what the definition is, it&#39;s (for \
example):</div><div class="gmail_extra"><div \
class="gmail_extra">set(KCompletion_LIBRARIES \
KF5::KCompletion)</div><div><br></div><div>Personally, I prefer not using the \
variables, because a typo will make it to run flawlessly but then not working without \
a warning (because a nonexisting variable resolves to &quot;&quot;).</div>

<div>Aleix</div></div></div>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic