QT Creator's .pro file - where is the debug/release intelligence
-
I'm learning about qmake files now, and read the online docs. I assumed that when I create a new project in QT Creator that it would create all kinds of config debug/release logic in the pro file for me.
However, when I looked a pro file I created for a project, the .pro file has nothing like this (very simple). So where does QT Creator put all the settings to do with debug/release for my project?
On that note, if I wanted to compile from the command line, would I have to manually add some settings to my .pro file so it can handle debug/release?
-
Qt creator does create one .pro file used for release and debug configuration.
The switching between debug and release modes is done when qmake is called internally with command line parameters.Go to the left bar to the projects button. under tab "Build&Run" you can see the actual parameters used for the qmake run. You can change between release and debug modes there.
BTW: it is Qt. The two upper case letters (QT) stand for Quick Time at least in devnet
-
Although I am creating the app in Qt Creator, I will eventually have to compile from the command line on different OS's. Is there a standard way of adding debug/release or other platform info to a .pro file?
-
EDIT: I stand corrected by WoJo below
-
yes, there is. for example, different names for debug and releas build (appnameD.exe <-> appname.exe) modify the pro file like:
@debug: TARGET = appnameD
release: TARGET = appname@or:
@debug {
TARGET = appnameD
}
release {
TARGET = appname
}@To build from command line, just call:
Debug build:
@qmake
make debug@Release Build:
@qmake
make release@ -
Cool - I'll start with this and then add some other qmake config lines I found on stackoverflow... thanks
-
for more information read:
"qmake project files":http://qt-project.org/doc/qt-4.8/qmake-project-files.html
"qmake variable reference":http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html -
don't use
@debug: TARGET = appnameD@
The correct thing to do is
@CONFIG(debug, debug | release): TARGET = appnameD@
see http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html#config