User Tools

Site Tools


qt:pro_files

This is an old revision of the document!


*.pro files

Description

For every Qt project there is a {directory-name}.pro file that describes the project to qmake. To create a *.pro file in a project directory, run

qmake -project

in a terminal shell. If there are any files in the directory when the above is run, those files will be included in *.pro.

Typically a *.pro file is created once in a project's lifetime and then is updated to reflect the additional of code files, etc.

Synopsis

Syntax

# comment
= sets an option
+= adds an option
-+ removes an option
. the current directory

File creation

The virgin *.pro file in a virgin directory:

######################################################################
# Automatically generated by qmake (2.01a) Tue Dec 7 17:07:32 2010
######################################################################
 
TEMPLATE = subdirs
 
# Directories

The virgin *.pro file in a directory that has main.cpp in it (where main.cpp is a Qt application):

######################################################################
# Automatically generated by qmake (2.01a) Tue Dec 7 17:15:59 2010
######################################################################
 
TEMPLATE = app
TARGET = 
DEPENDPATH += .
INCLUDEPATH += .
 
# Input
SOURCES += main.cpp

Enabling debug/release builds

In Unix (including Linux and OS X) you can explicitly specify debug and release build options:

CONFIG += debug_and_release

debug only:

CONFIG += debug

or release only:

CONFIG += release

These options will cause additional Makefiles to be made. If you do not specify an option in Unix, you will get a debug build (assuming the debug versions of Qt libraries are installed).

I have not yet tested Windows, but the above config option is supposedly not needed and/or invalid in Windows.

Additions/tweaks

qt/pro_files.1291748349.txt.gz · Last modified: 2010/12/07 18:59 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki