# Advanced Build Management

## Multiple Build Configurations

(... to be written ...)

## Cross-Compiling

When you have suitable cross compilers available, you can cross compile your programs for processors and operating systems different from the system where &kdevelop; and the compiler is running. The &GNU; compiler collection &gcc; can be configured and compiled as a cross compiler if you compile it yourself. Consult the GCC info pages for more information. Some &Linux; distributions also provide binary packages.

An automake based package can easily be cross-compiled by specifying the `--host` option to the configure script and setting the `CC` and `CXX` environment variables to the respective cross compiler binaries. Often you want to switch between a the cross-compiled version of your application and one compiled for your development system. For this, it is advantageous to use &kdevelop; capability of creating multiple build configurations, as explained in buildconfigurations. Once you have created a new build configuration for cross-compiling in the Project Project Options... dialog, add the option

    --host=platform

to the configure options. The `platform` name is a tuple of the form

    cpu-vendor-os

or

    cpu-vendor-kernel-os

For many combinations, you can use a short form, for instance i386-linux or arm-elf.

## Qt/Embedded

&qte; is a version of the &Qt; library that does not use the X window system, but draws directly to the framebuffer on &Linux; systems. It is therefore interesting for embedded systems which have tight restrictions on the memory usage of the whole system. Its &API; is fully compatible with the one of the X11 version.

Developing an application for &qte; with &kdevelop; is not very different from developing a program for the X11 version of &Qt;. In fact, you can use the same codebase for both versions. If you use the autoproject project management, you switch to the embedded version by passing the argument `--enable-embedded` to the configure script. You can set this in the Project Project Options... dialog under Configure Options. With the option `--with-qt-dir=DIR` you set the directory in which &qte; is installed.

After configuring and compiling your application with these options, it will link with the `libqpe.so` library. This version of your application will not normally run when you use X11. In order to test it, run it under the control of the program qvfb (&Qt; Virtual Frame Buffer). This is done by starting qvfb and then starting your application with

    app -qws -display QVFb:0

Naturally, when you have a working version of your application, you will want to use it on the target processor. For this, it will probably be convenient to create multiple build configurations, as explained above, so that you can quickly switch between the version running on your development system and the version running on the target system.

Applications for &qte; normally run as single applications on the device they are designed for. Trolltech also supports Qtopia, which is a collection of applications for PIM, web browsing and various other areas that work together in a consistent manner. It is the standard environment for instance on the Sharp Zaurus. You can write applications that integrate into this environment by using the Qtopia SDK. This implies making your application class a subclass of `QPEApplication` and linking to the library `libqpe.so`. If you develop your application with the autoproject project management, you have to add `--enable-qtopia` to the configure options.