PDA

View Full Version : Multiple Targets with QMAKE



nightghost
5th June 2009, 14:04
We've to use a small lib in our GUI written in C. I've integrated the lib with the following pro



DEPENDPATH += .
INCLUDEPATH += .

DEFINES += __i386__
unix:DEFINES += _LINUX
window:DEFINES += _WIN32

HEADERS += rttTmsCommLib.h
SOURCES += rttTmsCommLib.c

TARGET = rttTmsComm
unix:TEMPLATE = lib
windows:TEMPLATE =vclib
CONFIG += staticlib


asts-tms-tp-monitor {
TARGET = asts-tms-tp-monitor
unix:TEMPLATE = app
win32:TEMPLATE = vcapp
CONFIG -= staticlib
CONFIG += static
HEADERS += asts-tms-tp-monitor.h
SOURCES += asts-tms-tp-monitor.c
}

tmsdemoclient {
TARGET = tmsdemoclient
unix:TEMPLATE = app
win32:TEMPLATE = vcapp
CONFIG -= staticlib
CONFIG += static
SOURCES += tmsdemoclient.c
}


the file is invoced with SUBDIRS and works really nice under Windows and Linux. I can also use



qmake -config asts-tms-tp-monitor
qmake -config tmsdemoclient


to build the democlient and the monitor. But now I want that the 2 additional targets are also build when the lib is build (like make all -> rttTmsCommLib asts-tms-tp-monitor tmsdemoclient) and I don't know how to archieve this

wysota
7th June 2009, 09:11
The easiest way is to set things up as yet another SUBDIRS target. Note that the different .pro files don't have to be placed in separate directories.