中间库都放在middlewares目录,include头文件相同,所以不需要特殊处理,只要特殊处理lib安装目录,
示例pro文件如下:
TEMPLATE = lib
TARGET = ime
VERSION = 1.0.0
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += staticlib
inc.files = \
xinputmethod.h
inc.files += $$HEADERS(引用变量的方法)
inc.path = ../includes
DEFINES += X86
contains( DEFINES, X86 ) {
message( "Configuring for X86 build..." )
target.path = ../x86libs
} else {
message( "Configuring for arm build..." )
target.path = ../libs
}
INSTALLS += inc target
pro文件中通过X86宏来控制链接库:
#DEFINES += X86
contains( DEFINES, X86 ) {
message( "Configuring for X86 build..." )
LIBS += -L /opt/qt-everywhere/marvell/APP/middlewares/x86libs/ -lime
} else {
message( "Configuring for arm build..." )
LIBS += -L /opt/qt-everywhere/marvell/APP/middlewares/libs/ -lime
}
INCLUDEPATH += /opt/qt-everywhere/marvell/APP/middlewares/includes
DEPENDPATH += /opt/qt-everywhere/marvell/APP/middlewares/includes
OTHER_FILES += \
ChangeLog.txt
mkdir my_shadow_build
cd my_shadow_build
qmake ../my_src_dir