KDE uses the variable KDEDIR much in the same way Qt uses the variable QTDIR. It should be set in the same way, with a /etc/profile.d/kde.sh file.
it's fixed in next rebuild kdelibs-3.1.94-0.4