building kdepim

I’m trying to build kdepim from source to fix problems in kmail and kleopatra. I’m using this as my reference point:
KDE PIM - Getting Started

I can successfully check out kdepim from the subversion repository. I’m having difficulty compiling.

Source is in ./kdepim
I’ve made a separate build directory ./kdepim-build
From kdepim-build, I’m running

cmake ../kdepim

I’m getting the following error:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:57 (MESSAGE):
Could NOT find KdepimLibs (missing: KdepimLibs_CONFIG)
Call Stack (most recent call first):
/usr/share/kde4/apps/cmake/modules/FindKdepimLibs.cmake:76 (find_package_handle_standard_args)
CMakeLists.txt:39 (find_package)

My first thought was to make sure kdepimlibs-devel was installed. That hasn’t helped. Has anyone built this successfully?

I also saw this:
Bilbo-Blogger cmake error - openSUSE Forums

I tried setting the directory to /usr/lib64/cmake/KdepimLibs, but that also didn’t work.

kdepimlibs-devel doesn’t exist at all, try libkdepimlibs4-devel

None of kdepim4-devel, kdepim4-runtime-devel, libkdepim4-devel, or libkdepimlibs4-devel resolve the problem.

You will need the full KDE development pattern to be installed. Furthermore, even if it compiles AFAIK it won’t work this way since the kde4 prefix is missing.
In the downloaded source dir it should go like this

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=kde4-config --prefix
make install

But first make sure you have the development pattern installed.

What do you mean about the kde4 prefix missing?

I already had the following relevant patterns installed:
Base Development
KDE Development
C/C++ Development
Qt 4 Development

I’m worried that I need a newer version of kdepimlib, for which I would need a newer version of kdelib, for which I may well need to download the entirety of KDE just to compile kmail.

I may try to checkout an older version of kdepim (rather than trunk) that matches my devel version.