[Kde-bindings] Conditionally include headers based on KDE version

Chris Burel chrisburel at gmail.com
Sat Dec 4 23:31:48 UTC 2010

Hey guys,
I'm having to build the Perl bindings against an older version of
Qt/KDE, specifically 4.4.3/4.1.3.  However, a lot of the kde smoke
modules don't build, because they include headers that didn't exist
when 4.1.3 was released.  So I've gone through and modified the
various module_includes.h files to conditionally include these files
based on the version of KDE being used.  So, something like
kdecore_includes.h would have this:

#if KDE_VERSION >= 0x040200
#include <sonnet/globals.h>

#if KDE_VERSION >= 0x040202
#include <kencodingprober.h>

#if KDE_VERSION >= 0x040400
#include <kauthaction.h>
#include <kauthactionreply.h>
#include <kauthactionwatcher.h>
#include <kauthhelpersupport.h>
#include <kauth.h>
#include <kcurrencycode.h>

One thing I did have to mess with a lot was plasma.  Apparently in 4.1
Plasma wasn't part of kdelibs, so there's a small modification to the
top-level CMakeLists.txt file to have a "find_package(Plasma)" if the
kde version is less than 4.2.0.

Does anyone have any problems with me committing these changes?


More information about the Kde-bindings mailing list