Review Request: Add a STATIC_LIBRARY build option to kdewin, akonadi, kdelibs and kdepimlibs

Gregory Schlomoff gregory.schlomoff at
Tue Oct 5 06:08:57 BST 2010

This is an automatically generated e-mail. To reply, visit:

Review request for kde-windows, kdelibs and KDE PIM.


This patch adds a new CMake build option, STATIC_LIBRARY (defaults to FALSE), that enables static linking of the library. It applies to kdewin, akonadi, kdelibs, and kdepimlibs.

The ability to build those libraries statically already exists, however, it is tied to WinCE. With this patch, it becomes a build option, and building on WinCE automatically sets this option.

=== Notes ===

1. Naming

kdepim already has a similar option, and it's called KDEPIM_BUILD_STATIC. However, looking at a few other packages required to build KDE (namely, cyrus-sasl and sqlite), this option is called STATIC_LIBRARY in those places, so I'm assuming this is more standard. If you guys agree on this name, we could change KDEPIM_BUILD_STATIC to adopt the same convention. If you think however that this option should be named following the same pattern as kdepim, I'll update the patch accordingly.

2. C++ preprocessor definitions

Setting the STATIC_LIBRARY option to TRUE automatically adds the C++ preprocessor flag LIBRARYNAME_STATIC_LIBS, which is needed by the libraryname_export.h file to correctly import/export the symbols for static linking. However, it does not automatically assumes that dependencies of this library are also built statically, so one must manually sets the corresponding preprocessor flags for the dependencies of this library that have been built statically.


  /trunk/KDE/kdelibs/CMakeLists.txt 1182389 
  /trunk/KDE/kdepimlibs/CMakeLists.txt 1180605 
  /trunk/kdesupport/akonadi/CMakeLists.txt 1180610 
  /trunk/kdesupport/kdewin/CMakeLists.txt 1180610 



All testing done on Windows with MSVC. Works well here.



KDE PIM mailing list kde-pim at
KDE PIM home page at

More information about the kde-core-devel mailing list