Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Qt qmake

 

qmake helps to create makefiles for Qt Creator projects

 

 

 

 

 

Example

 

The example below shows how to build different versions (that is: debug and release) versions of a single version. Note: the code layout does matter.

 

#-------------------------------------------------
#
# Project created by QtCreator 2010-08-19T15:10:48
#
#-------------------------------------------------
# THIS WORK CORRECTLY ONLY UNDER UBUNTU!
QT       += core gui
CONFIG   += console
CONFIG   -= app_bundle
CONFIG(debug, debug|release) {
  TARGET = MyProjectDebug
  message(Building debug version)

} else {
  TARGET = MyProjectRelease
  DEFINES += NDEBUG
  message(Building release version)
}
LIBS += -L/usr/local/lib -lboost_regex
LIBS += -L/usr/local/lib -lcln
TEMPLATE = app
SOURCES += main.cpp \
    newicks.cpp
HEADERS += \
    newicks.h
FORMS += \
    dialogabout.ui
RESOURCES += \
    resources.qrc

 

I know it sounds stupid, but under Windows, when you want to build a release version, you must explictly add:

 

CONFIG   += debug

 

 

 

 

 

qmake variables

 

For an overview of all qmake variables, go to the page about qmake variables.

 

 

 

 

 

qmake arguments

 

To view where to put qmake arguments, go to the page about qmake arguments.

 

 

 

 

 

qmake mkspecs

 

For an overview of all qmake mkspecs, go to the page about qmake mkspecs.

 

 

 

 

 

qmake source code

 

The qmake source code can be downloaded from the Qt gitorous repository, in the folder '/qmake'.

 

 

 

 

 

External links

 

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict