2017-11-07 10:33:42 +08:00
|
|
|
|
#here is all your app common defination and configration
|
|
|
|
|
#you can modify this pri to link qqt_library
|
2017-11-27 17:34:07 +08:00
|
|
|
|
#only link QQt, this pri file.
|
2017-11-07 10:33:42 +08:00
|
|
|
|
|
2017-11-26 09:47:57 +08:00
|
|
|
|
#this link need Qt Creator set default build directory, replace
|
|
|
|
|
#%{JS: Util.asciify("/your/local/path/to/build/root/%{CurrentProject:Name}/%{Qt:Version}/%{CurrentKit:FileSystemName}/%{CurrentBuild:Name}")}
|
|
|
|
|
|
2017-11-26 16:34:59 +08:00
|
|
|
|
#auto link QQt when build source
|
|
|
|
|
#auto copy QQt when deploy app
|
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------
|
2017-11-27 14:07:17 +08:00
|
|
|
|
#user computer path settings
|
2017-11-26 16:34:59 +08:00
|
|
|
|
#-------------------------------------------------------------
|
2017-12-01 18:16:15 +08:00
|
|
|
|
#same app project, same relative path.
|
2017-11-27 17:34:07 +08:00
|
|
|
|
#qqt source root, QQt's root pro path. subdir and
|
2017-11-07 10:33:42 +08:00
|
|
|
|
equals(QMAKE_HOST.os, Darwin) {
|
2017-11-27 14:07:17 +08:00
|
|
|
|
QQT_SOURCE_ROOT = $$PWD/../..
|
2017-11-07 10:33:42 +08:00
|
|
|
|
} else: equals(QMAKE_HOST.os, Linux) {
|
2017-11-27 14:07:17 +08:00
|
|
|
|
QQT_SOURCE_ROOT = $$PWD/../..
|
2017-11-07 10:33:42 +08:00
|
|
|
|
} else: equals(QMAKE_HOST.os, Windows) {
|
2017-11-27 14:07:17 +08:00
|
|
|
|
QQT_SOURCE_ROOT = $$PWD/../..
|
2017-11-07 10:33:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-27 14:07:17 +08:00
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
#include qqt's pri
|
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
#qqt qkit
|
2017-11-27 17:34:07 +08:00
|
|
|
|
#all cross platform setting is from here.
|
2017-11-27 14:07:17 +08:00
|
|
|
|
include($${QQT_SOURCE_ROOT}/src/qqt_qkit.pri)
|
|
|
|
|
|
2017-12-01 15:59:20 +08:00
|
|
|
|
#qqt function
|
|
|
|
|
include($${QQT_SOURCE_ROOT}/src/qqt_function.pri)
|
|
|
|
|
|
2017-11-27 14:07:17 +08:00
|
|
|
|
#qqt version
|
|
|
|
|
include($${QQT_SOURCE_ROOT}/src/qqt_version.pri)
|
|
|
|
|
|
|
|
|
|
#qqt header
|
|
|
|
|
include($${QQT_SOURCE_ROOT}/src/qqt_header.pri)
|
|
|
|
|
|
2017-12-01 18:16:15 +08:00
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
#link path init
|
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
isEmpty(QKIT_PRIVATE) {
|
|
|
|
|
message(env variable QKIT is required!)
|
|
|
|
|
message(pleace check qqt_qkit.pri)
|
|
|
|
|
error( error occured!)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
#link path init
|
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
#qqt build root, build station root
|
|
|
|
|
#link_from_build will need this path.
|
|
|
|
|
|
|
|
|
|
#default sdk root is qqt-source/..
|
|
|
|
|
#user can modify this path
|
|
|
|
|
#create_qqt_sdk and link_from_sdk will need this.
|
|
|
|
|
|
|
|
|
|
CONFIG += TDR
|
|
|
|
|
contains(CONFIG, TDR) {
|
|
|
|
|
equals(QMAKE_HOST.os, Darwin) {
|
|
|
|
|
QQT_BUILD_ROOT = /Users/abel/Develop/c0-buildstation
|
|
|
|
|
} else: equals(QMAKE_HOST.os, Linux) {
|
|
|
|
|
QQT_BUILD_ROOT = /home/abel/Develop/c0-buildstation
|
|
|
|
|
} else: equals(QMAKE_HOST.os, Windows) {
|
|
|
|
|
QQT_BUILD_ROOT = C:/Users/Administrator/Develop/c0-build
|
|
|
|
|
}
|
|
|
|
|
equals(QMAKE_HOST.os, Darwin) {
|
|
|
|
|
QQT_SDK_ROOT = $${QQT_SOURCE_ROOT}/..
|
|
|
|
|
} else: equals(QMAKE_HOST.os, Linux) {
|
|
|
|
|
QQT_SDK_ROOT = $${QQT_SOURCE_ROOT}/..
|
|
|
|
|
} else: equals(QMAKE_HOST.os, Windows) {
|
|
|
|
|
QQT_SDK_ROOT = $${QQT_SOURCE_ROOT}/..
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-27 14:07:17 +08:00
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
#link qqt settings: use source or link library?
|
|
|
|
|
#-------------------------------------------------------------
|
2017-11-27 19:52:13 +08:00
|
|
|
|
#if you dont modify Qt Creator default build directory, you may need mod this path variable.
|
|
|
|
|
#link operation all will need this variable
|
|
|
|
|
QQT_STD_DIR = QQt/$${QT_VERSION}/$${SYSNAME}/$${BUILD}
|
2017-11-28 09:01:03 +08:00
|
|
|
|
#link from build need this, if you havent mod QQt.pro, this can only be two value, qqt's: [src]/$DESTDIR
|
2017-11-27 19:52:13 +08:00
|
|
|
|
QQT_DST_DIR = src/bin
|
|
|
|
|
|
2017-11-27 14:07:17 +08:00
|
|
|
|
#if you want to build qqt source open this annotation
|
2017-12-01 18:16:15 +08:00
|
|
|
|
#CONFIG += QQT_SOURCE_BUILDIN
|
|
|
|
|
contains (CONFIG, QQT_SOURCE_BUILDIN) {
|
2017-11-26 16:34:59 +08:00
|
|
|
|
#if you want to build src but not link QQt lib in your project
|
2017-11-26 09:47:57 +08:00
|
|
|
|
#if you don't want to modify Qt Creator's default build directory, this maybe a choice.
|
2017-11-07 10:33:42 +08:00
|
|
|
|
include($${QQT_SOURCE_ROOT}/src/qqt_source.pri)
|
|
|
|
|
} else {
|
2017-11-26 16:34:59 +08:00
|
|
|
|
#if you want to link QQt library
|
2017-11-27 14:07:17 +08:00
|
|
|
|
#qqt will install sdk to sdk path you set, then link it, or link from build station
|
|
|
|
|
#qqt also can install sdk to qt library path, then to do that.
|
2017-11-26 16:34:59 +08:00
|
|
|
|
#need QQT_BUILD_ROOT
|
2017-11-27 14:07:17 +08:00
|
|
|
|
#need QKIT_PRIVATE from qqt_qkit.pri
|
2017-12-01 18:16:15 +08:00
|
|
|
|
!exists(.config.ini) {
|
|
|
|
|
$$system(echo [ROOT] > .config.ini)
|
|
|
|
|
$$system(echo QQT_BUILD_ROOT = >> .config.ini)
|
|
|
|
|
$$system(echo QQT_SDK_ROOT = >> .config.ini)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isEmpty(QQT_BUILD_ROOT): QQT_BUILD_ROOT = $$read_ini("$${PWD}/.config.ini", "ROOT", "QQT_BUILD_ROOT")
|
|
|
|
|
isEmpty(QQT_SDK_ROOT): QQT_SDK_ROOT = $$read_ini($${PWD}/.config.ini, ROOT, QQT_SDK_ROOT)
|
|
|
|
|
message(QQt build root: $$QQT_BUILD_ROOT)
|
|
|
|
|
message(QQt sdk root: $$QQT_SDK_ROOT)
|
|
|
|
|
isEmpty(QQT_BUILD_ROOT):error(QQT_BUILD_ROOT required please check .config.ini at $$PWD)
|
|
|
|
|
isEmpty(QQT_SDK_ROOT):error(QQT_SDK_ROOT required please check .config.ini at $$PWD)
|
2017-11-27 17:34:07 +08:00
|
|
|
|
|
2017-12-01 18:16:15 +08:00
|
|
|
|
#you can open one or more macro to make sdk or link from build.
|
2017-11-26 21:58:59 +08:00
|
|
|
|
#link from sdk is default setting
|
2017-11-27 14:07:17 +08:00
|
|
|
|
CONFIG += link_from_sdk
|
|
|
|
|
#CONFIG += link_from_build
|
2017-11-27 17:34:07 +08:00
|
|
|
|
#CONFIG += link_from_qt_lib_path
|
|
|
|
|
|
2017-11-26 16:34:59 +08:00
|
|
|
|
#especially some occations need some sure macro.
|
|
|
|
|
contains(QKIT_PRIVATE, iOS|iOSSimulator) {
|
2017-11-13 10:00:48 +08:00
|
|
|
|
#mac ios .framework .a 里面的快捷方式必须使用里面的相对路径,不能使用绝对路径
|
|
|
|
|
#但是qtcreator生成framework的时候用了绝对路径,所以导致拷贝后链接失败,库不可用。
|
|
|
|
|
#qqt_install.pri 里面解决了framework的拷贝问题,但是对于ios里.a的没做,而.a被拷贝了竟然也不能用!
|
|
|
|
|
#在build的地方link就可以了
|
2017-11-13 09:47:37 +08:00
|
|
|
|
CONFIG += link_from_build
|
|
|
|
|
}
|
2017-11-27 17:34:07 +08:00
|
|
|
|
contains(CONFIG, link_from_build) {
|
|
|
|
|
#include from source header, default is this, and set in header pri
|
|
|
|
|
#...
|
|
|
|
|
}
|
2017-11-07 10:33:42 +08:00
|
|
|
|
|
2017-11-28 12:15:56 +08:00
|
|
|
|
################################################
|
|
|
|
|
##include qqt_install.pri using these function to install qqt
|
|
|
|
|
##install to Qt library
|
|
|
|
|
##install to SDK path
|
|
|
|
|
##in this section, I use QMAKE_PRE_LINK QMAKE_POST_LINK, it won't work until project source changed
|
|
|
|
|
##on windows, I use touch.exe, you need download it and put it in system dir.
|
|
|
|
|
################################################
|
|
|
|
|
#QMAKE_POST_LINK won't work until source changed
|
|
|
|
|
#qmake pro pri prf change won't effect to QMAKE_POST_LINK
|
|
|
|
|
#but I need it before I complete this pri.
|
|
|
|
|
#debug.
|
|
|
|
|
system("touch $${QQT_SOURCE_ROOT}/src/frame/qqtapplication.cpp")
|
|
|
|
|
include ($${QQT_SOURCE_ROOT}/src/qqt_install.pri)
|
|
|
|
|
#QQT_SDK_ROOT QQT_SDK_PWD QQT_LIB_PWD
|
2017-11-29 15:54:15 +08:00
|
|
|
|
#need qqt_install.pri
|
2017-11-07 10:33:42 +08:00
|
|
|
|
include($${QQT_SOURCE_ROOT}/src/qqt_library.pri)
|
|
|
|
|
}
|