Jump to: navigation, search

KDE4 trunk tips:

WARNING! I'm not a shell scripting master nor have a degree in English Language: all corrections, additions, etc. are very welcome!


If you have some spare computers and want to save time compiling here it is how to compile KDE4 with distcc:

  1. install distcc.
  2. read the manpage.
  3. edit your ~/.distcc/hosts.
  4. set up distccd on other computers, if not accessing by ssh.
  5. add this to your ~/.bashrc: export CC='distcc gcc' export CXX='distcc g++' and edit cmakekde function raising make's -j parameter. example: nice make -j6 VERBOSE=1 && \
  6. you must remove CMakeCache.txt file from the build directory of any previously compiled module, else it won't use distcc, even if you manually set CC and CXX variables to make, to CMakeCache.txt or rerun cmake. The reason is that cmake can't switch compilers after the first run, see This means you have to recompile all the module again, but will be faster than ever!


Using Xephyr to try KDE4 is great, but it's always complaining about DISPLAYs. Add this function to your ~/.bashrc and forget those DISPLAY headaches: function startxephyr { export OLDDISPLAY=$DISPLAY

if test -n "$1"; then

               Xephyr $* &
               # This assumes the display to use is the first argument

export DISPLAY=$1 else Xephyr :2 -fullscreen & export DISPLAY=:2



export DISPLAY=$OLDDISPLAY } This is very similar to the method described in


Sometimes a module doesn't compile because of an application or maybe you want to tweak the compilation options to suit your needs. You can do this by setting some CMake variables. The easiest way to do it is CCMake, a NCurses frontend to CMake. Hmmm, but cmakekde was sooo handy, i can't stop using it... let's ccmake it!

  1. Change this in your .bashrc: function cmakekde { to function _cmakekde { and cmake $srcFolder -DCMAKE_INSTALL_PREFIX=$KDEDIR \ to $cmakecommand $srcFolder -DCMAKE_INSTALL_PREFIX=$KDEDIR \
  2. add this to your ~/.bashrc: function cmakekde { export cmakecommand=cmake; _cmakekde $*; } function ccmakekde { export cmakecommand=ccmake; _cmakekde $*; }

Now you can easily tweak your compilations with ccmakekde!

That's all for now folks!

This page was last modified on 18 September 2007, at 00:33. Content is available under Creative Commons License SA 4.0 unless otherwise noted.