Archive:Getting Started/Build/Mac OS X

Revision as of 01:04, 21 August 2010 by Fulldecent (Talk | contribs)

Jump to: navigation, search
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo

If you're interested in just checking things out, binaries for kdelibs and parts of KDE in general are available at and are generated semi-regularly.
  • Note: You may wish to do all of this inside a directory name that ends in .noindex or .build to keep spotlight from indexing all of your temporary build-files as you build them.

mkdir ~/ cd ~/


Setting Up Your Build Environment

Variables must be set to build KDE successfully, and are noted below

  • Note: Replace /opt/kde4-deps with the location of your 3rd-party tools, and add your cmake location if you compiled from source

export PATH="/opt/qt4/bin:/opt/kde4/bin:/opt/kde4-deps/bin:~/.local/bin/:$PATH" export CMAKE_LIBRARY_PATH="/opt/kde4-deps/lib" export CMAKE_INCLUDE_PATH="/opt/kde4-deps/include" export PKG_CONFIG_PATH="/opt/qt4/lib/:/opt/kde4-deps/lib/pkgconfig/"

You might want to put those in your ~/.bash_profile

  • For Fink users: If your Distribution line in /sw/etc/fink.conf is 10.4-transitional, instead of 10.4, make sure you run sudo gcc_select 3.3 before proceeding with any compiling, or you will end up with binary-incompatible c++ code!
  • For others: run sudo gcc_select 4.0 if you want to be compatible with the pre-made installers.

Required Third Party Tools

The following third party tools are required for successfully building KDE on OSX. Also, here are some good tips for installing from source. I assume you have OS X 10.5 or 10.6 installed, otherwise you would have some more dependencies.

cd ~/ curl -O tar xfz libtool-2.2.tar.gz cd libtool-2.2 ls ./configure --prefix=/opt/kde4-deps make sudo make install

cd ~/ curl -O tar xfz libxml2-sources-*.tar.gz cd libxml2-2.7.7 ./configure --prefix=/opt/kde4-deps/ make sudo make install

cd ~/ curl -O tar xfz libxslt-*.tar.gz cd libxslt-1.1.26 ./configure --prefix=/opt/kde4-deps/ make sudo make install

Go to that link and download sh jhbuild bootstrap # THIS IS WHERE I GET STUCK (entriken, 2010-08-20) jhbuild build meta-gtk-osx-bootstrap jhbuild build

  • shared-mime-info
  • AGG
  • giflib or libungif
  • libart_lgpl
  • libidn
  • libjpeg
  • libmng
  • libpng
  • libusb
  • OpenEXR
  • PCRE
  • Strigi
  • pkgconfig
  • dbus

Qt/Mac Open Source Edition

Get the Qt/Mac source code from

The latest version has QtDBus and should work with KDE for Mac. Get it here:

(statement make by entriken and unverified 2010-08-20)


Get the latest CMake from and install:

cd ~/ curl -O tar xfz cmake-*.tar.gz cd cmake-* ./configure --prefix=/opt/kde4-deps make all sudo make install

Building kdelibs

kdelibs must be checked out of svn locally to be built: cd ~/ svn co svn:// And then compiled by performing the following: mkdir cd cmake ../kdelibs -DCMAKE_INSTALL_PREFIX=/opt/kde4 make all install


If kdelibs fails to compile successfully, check the build status for the latest Nightly Builds and Continuous Builds at

Information about getting and compiling the dependencies can be found at Getting_Started/Build/KDE4 and Getting_Started/Build/KDE4/Prerequisites (pages are Linux focused, but can be useful)

Further Reading

For more general information on using CMake, see the CMake Tutorial.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal