PDA

View Full Version : qmake debug/release scope question



redoctober0
26th September 2008, 17:37
I have a question here. I use Qt4.4.1 in WindowsXP with VS2008. Now, i want to link different libraries for debug and release setups in VS project. I tried to play around with scopes in .pro file but i can't seem to get it right. For example, for Qwt i want to link qwtd5.lib for debug and qwt5.lib for release. This is what i have right now:




CONFIG += debug_and_release build_all
CONFIG(debug, debug|release) {
LIBS += C:\Qt\4.4.1\src\3rdparty\qwt-5.1.1\lib\qwtd5.lib
} else {
LIBS += C:\Qt\4.4.1\src\3rdparty\qwt-5.1.1\lib\qwt5.lib
}


However, when i create a project with qmake i get qwtd5.lib in both debug and release. Of course if i change CONFIG to

CONFIG += release

then i get qwt5.lib everywhere. But i wonder if it's possible to put the right libraries in debug/release with a single pass of qmake.

Thanks.

fullmetalcoder
30th September 2008, 21:41
:confused:

Sorry but I'm not sure I understand your problem : your project looks fine to me and it is definitely the only way to get proper linking if you want to build your project in both debug and release mode.

Are you saying that despite setting up your porject like that you get binaries that always link against the same version of Qwt, regardless of the build?

If so I only have two suggestions :


specify proper TARGET and/or DESTDIR for the targets depending on the build mode (i.e inside the CONFIG() blocks)
replace
CONFIG(debug,debug|release) { with
CONFIG(debug,release|debug) {. I really don't think it *should* change anything but that's what I'm using in my own projects and things work as expected