.pro
1、创建一个.pro文件
例如:在home文件夹下创建一个home.pro,然后用qtcreater打开
2、将level_1的工程文件目录转移到home文件目录下
3、在home.pro添加如下语句
工程管理界面变成如下所示
.pri
1、在level_1目录下添加level_2目录,并在level_2目录下创建level_2.pri文件
2、在level_1.pro添加如下语句
include($$PWD/level_2/level_2.pri) INCLUDEPATH += $$PWD/level_2
工程管理界面变成如下所示
3、最后在pri文件里面添加各种库、资源文件和配置了
# TODO: Define your C++ version. c++14, c++17, etc. # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 isEmpty(level_2_PARENTPATH) { message( 'level_2_PARENTPATH is empty. use default value.' ) level_2_PARENTPATH = $$PWD/../ message( 'level_2_PARENTPATH is not empty.' ) message( $${level_2_PARENTPATH} ) INCLUDEPATH += $${level_2_PARENTPATH} INCLUDEPATH += $${level_2_HEADERPATH} $${level_2_HEADERPATH}temp.h \ $${level_2_HEADERPATH}temp.cpp \ message("compiling for windows g++. mingw or msys or cygwin.") INCLUDEPATH += $${level_2_HEADERPATH}win32-gcc CONFIG(debug, debug|release) {
|