Qt Extended Home · Build System Home · Reference · User Guide · Internals codeless banner

Project Files

Introduction

This overview will primarily focus on applications. If you want to create a project file for a library the Libraries page contains more relevant information.

The canonical definition of a project file is the example application.

    # This is an application
    TEMPLATE=app

    # The binary name
    TARGET=example

    # This app uses Qtopia
    CONFIG+=qtopia

    # Build this app as a quicklauncher plugin
    # You need to be using the QTOPIA_ADD_APPLICATION/QTOPIA_MAIN macros or this will not work!
    #CONFIG+=quicklaunch

    # Build this project into the singleexec binary
    #CONFIG+=singleexec

    # Specify the languages that make lupdate should produce .ts files for
    STRING_LANGUAGE=en_US
    LANGUAGES=en_US de

    # Package information (used for qbuild packages)
    pkg [
        name=example
        desc="Example Application"
        license=Commercial
        version=1.0.0-1
        maintainer="Qt Extended <info@qtextended.org>"
    ]

    # These are the source files that get built to create the application
    FORMS=\
        examplebase.ui

    HEADERS=\
        example.h

    SOURCES=\
        main.cpp\
        example.cpp

    # SXE information
    target [
        hint=sxe
        domain=untrusted
    ]

    # Install the launcher item. The metadata comes from the .desktop file
    # and the path here.
    desktop [
        hint=desktop nct
        files=example.desktop
        path=/apps/Applications
        trtarget=example-nct
    ]

    # Install some pictures.
    pics [
        hint=pics
        files=pics/*
        path=/pics/example
    ]

    # Install help files
    help [
        hint=help
        source=help
        files=example.html
    ]

The following sections describe the parts of the project file.

TEMPLATE

To be useful, a project must set the TEMPLATE to either app, lib or plugin.

TARGET

The TARGET is the name of the binary. In Qt Extended applications must have unique names as several resources types are located using the application name.

Application configuration

A project must declare if it depends on Qt (CONFIG+=qt). Likewise, a project must declare if it should be built for the target or the host (CONFIG+=embedded). Depending on Qt Extended (CONFIG+=qtopia) means your project will only be built for the target.

Qt Extended applications can be built in several ways. There are flags that you should set to indicate how your app can be built. See Applications for a discussion on this.

Internationalization

You can specify what translations exist for your application. See Internationalization for more information.

Package meta-data

There's some meta-data attached to a package. You can read about this in Packages (overview).

Source files

You specify your input files using FORMS, HEADERS and SOURCES.

Desktop file

Applications require a .desktop file which specifies the launcher meta-data for the application.

Pictures

Applications will require at least an image for the launcher icon. Other images and icon can be installed too. It's best to put all images into a subdirectory so that installpic will install them correctly.

Help files

You should install at least 1 help file for your application. You can install additional help files for context-sensitive help. Online help looks at TARGET-<objname>.html for context-sensitive help. The object name of the toplevel window is used.

See also Overviews, Create a new project file, Libraries, and Applications.


Copyright © 2009 Trolltech
Qt Extended - Build System Documentation