linking to kde4support (Re: KF5 Update Meeting Minutes 2013-w27)
Alexander Neundorf
neundorf at kde.org
Thu Jul 11 21:07:41 UTC 2013
Hi,
if you update plasma-frameworks, make sure you also update kdelibs.
To use the kde4support library now, do
find_package(KDE4Support NO_MODULE) # if outside kdelibs
...
target_link_libraries(hello ${KDE4Support_LIBRARIES} )
as for any other package.
One thing: befor find_package(KDE4Support), you have to do
find_package(KDELibs4). If you don't do that, you'll get a hopefully
descriptive error message at cmake time.
Details: I said this stuff will be a mess as long as we still have not cleaned
the dependencies inside kdelibs, and this is indeed so.
The kde4support library links e.g. against kdecore and kdeui.
Some other libraries in kdelibs, e.g. something in khtml, link against
kde4support.
So when trying to export the kde4support library target into a separate
KDE4SupportConfig.cmake (i.e. KDE4SupportTargets.cmake respectively) things
break. KDELibs4 can't be found successfully, since the required target
kde4support is missing, when searching KDE4Support first, this can't be found,
since several required targets from kdelibs are missing.
So, internally, the kde4support library is still exported as
"KDE4__kde4support" into the KDELibs4 export set.
But you can, and should, use find_package(KDE4Support) to find it, and this
will provide the expected ${KDE4Support_LIBRARIES} variable, which you can
use.
As said above, to satisfy the dependencies, KDELibs4 has to be searched (and
found) before.
Alex
More information about the Plasma-devel
mailing list