Archive:Getting Started/Build/Mac OS X: Difference between revisions

From KDE TechBase
Line 54: Line 54:
And then compiled and installed:
And then compiled and installed:
<code>cd CMake
<code>cd CMake
./configure --prefix=/opt/cmake
./configure --prefix=/opt/kde4-deps
make all install</code>
make all install</code>
== Setting Up Your Build Environment ==
== Setting Up Your Build Environment ==
Variable must be set to build KDE successfully, and are noted below
Variable must be set to build KDE successfully, and are noted below

Revision as of 22:14, 25 November 2007

Tip
Note: This page is about KDE 4. It isn't applicable for KDE 3 development.
Warning
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


  • 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.

Required Third Party Tools

The following third party tools are required for successfully building KDE on OSX.

  • AGG
  • bzip2
  • giflib or libungif
  • libart_lgpl
  • libidn
  • libjpeg
  • libmng
  • libpng
  • libxml2
  • libxslt
  • libusb
  • OpenEXR
  • PCRE
  • Strigi
  • shared-mime-info
  • pkgconfig
  • subversion (to check out the kde sources)
  • dbus

Verify Compiler Version

  • Fink: 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!
  • Manual: run sudo gcc_select 4.0 if you want to be compatible with the pre-made installers.

Qt/Mac Open Source Edition

Download qt-mac-opensource from http://www.trolltech.com/download/qt/mac

Patches are required for a successful build. Download the qt-copy patches through KDE's svn: svn co svn://anonsvn.kde.org/home/kde/trunk/qt-copy/patches/ and apply the patches: cd qt-mac-opensource-4* for patch in /path/to/patches/*.diff; do patch -p0 < $patch; done Note: when applying patches you will get errors when processing x11 specific files (i.e. files that match the pattern *_x11.{h,cpp}), simply skip those patches.

And finally, compile qt-mac: ./configure -prefix /opt/qt4 -qt-gif make all install

Please note: The Qt/Mac binary edition available from ftp.trolltech.com will not work, because it does not contain the QtDBus module! (tested with 4.3.2)

CMake

CMake may be downloaded from CVS: cvs -d :pserver:[email protected]:/cvsroot/CMake login Note: password is "cmake" cvs -d :pserver:[email protected]:/cvsroot/CMake co CMake And then compiled and installed: cd CMake ./configure --prefix=/opt/kde4-deps make all install

Setting Up Your Build Environment

Variable 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:$PATH" export CMAKE_LIBRARY_PATH="/opt/kde4-deps/lib" export CMAKE_INCLUDE_PATH="/opt/kde4-deps/include" export PKG_CONFIG_PATH="/opt/qt4/lib/"

Building kdelibs

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

Troubleshooting

If kdelibs fails to compile successfully, check the build status for the latest Nightly Builds and Continuous Builds at http://public.kitware.com/dashboard.php?name=kde

Using Binaries

If you're interested in just checking things out, binaries for kdelibs and parts of KDE in general are available at http://ranger.users.finkproject.org/kde/ and are generated semi-regularly.

Further Reading

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