[cmake] find_package(KDE4)

Michał Walenciak kicer86 at gmail.com
Sun Feb 12 12:37:26 UTC 2012


Dnia niedziela 12 lutego 2012 10:42:48 piszesz:
> On Sunday 12 February 2012, Michał Walenciak wrote:
> > Hi all
> > 
> > 
> > I've encountered problem with using kde stuff in my program.
> > When I simply added find_package(KDE4) it just stopped linking.
> > 
> > I think it's probably related to this post:
> > http://forum.kde.org/viewtopic.php?f=64&t=89265
> 
> This link doesn't work for me: "Internal Server Error".
> 
> What problem do you have ?

maybe some temporary malfunction.
Anyway problem is simple: i've a project which consist of two modules:
program and shared lib (plugin).

When find_package(KDE4) is added (nothing else is touched), many additional 
compilation flags are being added. In example my shared lib is compiled with -
fvisibility=hidden, so it cannot be linked with my program.
I know I can make my lib visible by using proper arguments in class 
declaration, but that's not the point. The problem is, that 
find_package(KDE4) enables some (in my case) unwanted flags.

IMHO compiler flags should not be affected (expect include dirs or additional 
libraries/path passed to linker, but only with cooperation with cmake's 
include_directories and target_link_libraries). Any other behaviour is 
undesired. 


> 
> > I've two questions:
> > 1. what find_package(KDE4) has changed, so program which was compiling and
> > linking successfully stopped linking?
> 
> This should not happen.
> If it does, it's a bug and we'll fix it.

it does :) I've sich problem, but also guy from forum to which link I've 
attached in original post.

> 
> > 2. why find_package(KDE4) is forcing it's own compiler flags (like
> > additional -Wxxx or -O2 in DEBUG build)? I can agree, that ${KDE_xxxx}
> > variables can be put around to influence on some compiler flags, but
> > simple "find_package" IMHO should not do such things.
> 
> That's simply how it is done with KDE4, this will probably change with KDE
> frameworks.
> 
> Alex

In my program I simply wanna use one single kde's widget ;) So I don't need 
whole kde build flow. I'd like only detect if kde devel package is present and 
then I'd like to include and link proper files. That's all I need.

regards

-- 
Michał Walenciak
gmail.com kicer86
http://kicer.sileman.net.pl
gg: 3729519



More information about the Kde-buildsystem mailing list