qmake Common ProjectsThis chapter describes how to set up qmake project files for three common types of project that are based on Qt. Although all kinds of project use many of the same variables, each of them use special variables to define Building an ApplicationThe app TemplateThe app template tells qmake to generate a Makefile that will build an application. With this template, the type of application can be specified by adding one of the following options to the CONFIG variable definition:
When using this template the following qmake system variables are recognized. You should use these in your .pro file to specify information about your application.
You only need to use the system variables that you have values for, for instance, if you don't have any extra INCLUDEPATHs then you don't need to specify any, qmake will add in the default ones needed. For instance, an example project file might look like this: TEMPLATE = app DESTDIR = c:\helloapp HEADERS += hello.h SOURCES += hello.cpp SOURCES += main.cpp DEFINES += QT_DLL CONFIG += qt warn_on release For items that are single valued, e.g. the template or the destination directory, we use "="; but for multi-valued items we use "+=" to add to the existing items of that type. Using "=" replaces the item's value with the new value, for example if we wrote DEFINES=QT_DLL, all other definitions would be deleted. Building a LibraryThe lib TemplateThe lib template tells qmake to generate a Makefile that will build a library. When using this template, in addition to the system variables mentioned above for the app template the VERSION variable is supported. You should use these in your .pro file to specify information about the library. When using the lib template, the following options determine the type of library that is built:
[Previous: qmake Tutorial] [Contents] |
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.0 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com