我对qmake的发布和调试输出有疑问。
我的* .pro文件中有此代码(仅一部分)。
QT += xml TARGET = targetName TEMPLATE = app OBJECTS_DIR = objects MOC_DIR = mocs CONFIG(debug) { DESTDIR = ../debug message(Building debug.) } else { DESTDIR = ../release message(Building release.) }
然后我生成一个供调试用的Makefile
/opt/toolchain/arm/bin/qmake -spec /opt/toolchain/arm/mkspecs/qws/linux-gnueabi-arm-g++ -o Makefile *.pro
并发布
/opt/toolchain/arm/bin/qmake -spec /opt/toolchain/arm/mkspecs/qws/linux-gnueabi-arm-g++ -o Makefile *.pro "CONFIG=release"
我得到两个不同的Makefile。到目前为止一切顺利。
但是我不能编译发行版本,因为“ DEFINES”和“ INCPATH”是错误的。 这里是调试Makefile(仅一部分):
DEFINES = -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) INCPATH = -I/opt/toolchain/arm/mkspecs/qws/linux-gnueabi-arm-g++ -I. -I/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/include/qtopia/QtCore -I/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/include/qtopia/QtNetwork -I/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/include/qtopia/QtGui -I/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/include/qtopia/QtXml -I/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/include/qtopia -Imocs -I/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/include LIBS = $(SUBLIBS) -L/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/lib -lQtXmlE -lQtGuiE -lQtNetworkE -lQtCoreE -lpthread
发布部分:
DEFINES = CFLAGS = -pipe -O2 $(DEFINES) CXXFLAGS = -pipe -O2 $(DEFINES) INCPATH = -I/opt/toolchain/arm/mkspecs/qws/linux-gnueabi-arm-g++ -I. -I/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/include LIBS = $(SUBLIBS) -L/opt/toolchain/arm/arm-toolchain-linux-gnueabi/usr/lib
为什么会这样?