barryhf
13th February 2010, 00:24
Here's my project file:
TARGET = trialApp
TEMPLATE = app
win32 {
debug {
LIBS += -L../trialLibA/debug
PRE_TARGETDEPS += ../trialLibA/debug/libtrialLibA.a
}
release {
LIBS += -L../trialLibA/release
PRE_TARGETDEPS += ../trialLibA/release/libtrialLibA.a
}
}
INCLUDEPATH += ../trialLibA
LIBS += -ltrialLibA
SOURCES += main.cpp\
MainWindow.cpp
HEADERS += MainWindow.h
FORMS += MainWindow.ui
The problem is that both "debug" and "release" are defined when the makefile is generated. (I had started with debug {} else {} but debug was always defined).
In both Makefile.Debug and Makefile.Release, LIBS is defined to have both "-L../trialLibA/debug" and "-L../trialLibA/release".
So, of course, when I build the app, it takes the debug library (even when building release) because it's listed first in the LIBS path.
How is my understanding of the qmake process flawed here?
TARGET = trialApp
TEMPLATE = app
win32 {
debug {
LIBS += -L../trialLibA/debug
PRE_TARGETDEPS += ../trialLibA/debug/libtrialLibA.a
}
release {
LIBS += -L../trialLibA/release
PRE_TARGETDEPS += ../trialLibA/release/libtrialLibA.a
}
}
INCLUDEPATH += ../trialLibA
LIBS += -ltrialLibA
SOURCES += main.cpp\
MainWindow.cpp
HEADERS += MainWindow.h
FORMS += MainWindow.ui
The problem is that both "debug" and "release" are defined when the makefile is generated. (I had started with debug {} else {} but debug was always defined).
In both Makefile.Debug and Makefile.Release, LIBS is defined to have both "-L../trialLibA/debug" and "-L../trialLibA/release".
So, of course, when I build the app, it takes the debug library (even when building release) because it's listed first in the LIBS path.
How is my understanding of the qmake process flawed here?