QT 的多项目管理文件结构

   qt creator编写动态库进行测试,各个库有依赖的情况下希望实现完成按顺序自动编译.

目录结构如下

QT 的多项目管理文件结构_第1张图片

 Mutlpro.pro文件内容如下:

TEMPLATE = subdirs

SUBDIRS +=\
    hhFTP\
    testFtp

CONFIG += ordered

 打开Mutlpro.pro文件后,进行编译则会按照SUBDIRS的顺序进行编译程序

库文件pro


QT       -= gui
QT       += core  network


TARGET = hhFTP
TEMPLATE = lib

CONFIG += plugin
CONFIG += c++11

DEFINES += SLEBASE_LIBRARY SLENET_LIBRARY


include($$PWD/qtFtp/qtFtp.pri)


QMAKE_CXXFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-sign-compare -Wno-type-limits

DESTDIR+= $$PWD/../bin

unix {
    target.path = /usr/lib
    INSTALLS += target
}

HEADERS += \
    ../header/netFtpMgr.h\
    ../header/lwlglogout.h

SOURCES += \
    netFtpMgr.cpp

测试文件的pro内容

QT       += core gui network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = testDll
TEMPLATE = app

INCLUDEPATH += $$PWD/../header
DESTDIR+= $$PWD/../bin
LIBS     += -L$$PWD/../bin

SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h \
    netFtpMgr.h

FORMS    += mainwindow.ui

LIBS     += -lhhFTP

 

你可能感兴趣的:(QT)