1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
This commit is contained in:
tianduanrui 2018-06-05 20:35:38 +08:00
parent e678418712
commit a562057230
38 changed files with 0 additions and 4980 deletions

View File

@ -1,5 +0,0 @@
Lua
<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Windows<EFBFBD>ϱ<EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܡ<EFBFBD>QtLua<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><EFBFBD>ϡ<EFBFBD>
LevelDB
Windows<EFBFBD>±<EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>

View File

@ -1 +0,0 @@
Duilib

View File

@ -1,43 +0,0 @@
#----------------------------------------------------------------
#add_custom_manager.pri
#这个文件用于给用户自定义管理内容随意添加自己所需要的library、defines、config等等。
#拷贝到用户app工程目录里使用用
#建议拷贝走使用。
#----------------------------------------------------------------
################################################################
##基础使用方法
################################################################
#添加app版本
#add_version (1,0,0,0)
#添加依赖library
#add_library(xx)
#add_include(xx)
#add_defines(xx)
#先发布App
#app从build到deploy
#add_deploy()
#后发布依赖
#lib从sdk到build和deploy
#add_deploy_library(xx)
################################################################
##高级使用方法
################################################################
ADD_CUSTOM_MANAGER_PRI_PWD = $${PWD}
defineTest(add_custom_dependent_manager){
libname = $$1
isEmpty(libname):return(0)
!equals(TARGET_NAME, $${libname}):
exists($${ADD_CUSTOM_MANAGER_PRI_PWD}/add_library_$${libname}.pri){
include ($${ADD_CUSTOM_MANAGER_PRI_PWD}/add_library_$${libname}.pri)
contains(TEMPLATE, app):add_dependent_library_$${libname}()
else:contains(TEMPLATE, lib):add_link_library_$${libname}()
else:add_link_library_$${libname}()
}
return (1)
}

View File

@ -1,97 +0,0 @@
#----------------------------------------------------------------
#add_library_FFmpeg4.0.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#4.0
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_FFmpeg4.0){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_FFmpeg4.0(path) requires one arguments.")
command =
#basic
command += $${path}
command += $${path}/..
command += $${path}/libavcodec
command += $${path}/libavdevice
command += $${path}/libavfilter
command += $${path}/libavformat
command += $${path}/libavutil
command += $${path}/libpostproc
command += $${path}/libswresample
command += $${path}/libswscale
return ($$command)
}
defineTest(add_include_FFmpeg4.0){
#包含FFmpeg4.0头文件的过程
header_path = $$get_add_include(FFmpeg4.0)
INCLUDEPATH += $$get_add_include_FFmpeg4.0($$header_path)
export(INCLUDEPATH)
return (1)
}
defineTest(add_library_FFmpeg4.0) {
#链接Library
add_library(FFmpeg4.0, avcodec.58)
add_library(FFmpeg4.0, avdevice.58)
add_library(FFmpeg4.0, avfilter.7)
add_library(FFmpeg4.0, avformat.58)
add_library(FFmpeg4.0, avutil.56)
add_library(FFmpeg4.0, postproc.55)
add_library(FFmpeg4.0, swresample.3)
add_library(FFmpeg4.0, swscale.5)
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接FFmpeg4.0的WorkFlow
defineTest(add_link_library_FFmpeg4.0) {
#链接Library
add_library_FFmpeg4.0()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_FFmpeg4.0()
#这样包含也很好,简洁明了
#add_include(FFmpeg4.0, FFmpeg4.0QtCore)
#add_include(FFmpeg4.0, FFmpeg4.0QtWidgets)
#...
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library的函数
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_FFmpeg4.0) {
add_deploy_library(FFmpeg4.0, avcodec.58)
add_deploy_library(FFmpeg4.0, avdevice.58)
add_deploy_library(FFmpeg4.0, avfilter.7)
add_deploy_library(FFmpeg4.0, avformat.58)
add_deploy_library(FFmpeg4.0, avutil.56)
add_deploy_library(FFmpeg4.0, postproc.55)
add_deploy_library(FFmpeg4.0, swresample.3)
add_deploy_library(FFmpeg4.0, swscale.5)
return (1)
}
defineTest(add_dependent_library_FFmpeg4.0) {
add_link_library_FFmpeg4.0()
add_deploy_library_FFmpeg4.0()
return (1)
}

View File

@ -1,79 +0,0 @@
#----------------------------------------------------------------
#add_library_FMOD.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#1.10.05
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_FMOD){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_FMOD(path) requires one arguments.")
command =
#basic
command += $${path}
#这里添加$${path}下的子文件夹
return ($$command)
}
defineTest(add_include_FMOD){
#包含FMOD头文件的过程
header_path = $$get_add_include(FMOD)
INCLUDEPATH += $$get_add_include_FMOD($$header_path)
export(INCLUDEPATH)
#不用上边这种,这样包含也很好,简洁明了
#add_include(FMOD)
#add_include(FMOD, FMOD)
#add_include(FMOD, FMOD/core)
#...
return (1)
}
#这个地方add_library_no_bundle代表包括macOS下都不使用bundle只是动态库或者静态库。
defineTest(add_library_FMOD){
#链接Library
add_library(FMOD, fmod$${LIBRARYVER})
add_library(FMOD, fmodL$${LIBRARYVER})
#添加这个SDK下的其他的library
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接FMOD的WorkFlow
defineTest(add_link_library_FMOD){
#链接Library
add_library_FMOD()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_FMOD()
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_FMOD) {
add_deploy_library(FMOD, fmod$${LIBRARYVER})
add_deploy_library(FMOD, fmodL$${LIBRARYVER})
return (1)
}
defineTest(add_dependent_library_FMOD) {
add_link_library_FMOD()
add_deploy_library_FMOD()
return (1)
}

View File

@ -1,91 +0,0 @@
#----------------------------------------------------------------
#add_library_GoogleTest.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#1.0.0
LIBRARYVER =
DEBUG =
contains(BUILD, Release) {
DEBUG=
}
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_GoogleTest){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_GoogleTest(path) requires one arguments.")
command =
#basic
command += $${path}
#这里添加$${path}下的子文件夹
command += $${path}/gtest
command += $${path}/gtest/internal
command += $${path}/gtest/internal/custom
command += $${path}/gmock
command += $${path}/gmock/internal
command += $${path}/gmock/internal/custom
return ($$command)
}
defineTest(add_include_GoogleTest){
#包含GoogleTest头文件的过程
header_path = $$get_add_include(GoogleTest)
INCLUDEPATH += $$get_add_include_GoogleTest($$header_path)
export(INCLUDEPATH)
#不用上边这种,这样包含也很好,简洁明了
#add_include(GoogleTest)
#add_include(GoogleTest, GoogleTest)
#add_include(GoogleTest, GoogleTest/core)
#...
return (1)
}
defineTest(add_library_GoogleTest){
#链接Library
add_library(GoogleTest, gtest$${LIBRARYVER}$${DEBUG})
#添加这个SDK下的其他的library
add_library(GoogleTest, gtest_main$${LIBRARYVER}$${DEBUG})
add_library(GoogleTest, gmock$${LIBRARYVER}$${DEBUG})
add_library(GoogleTest, gmock_main$${LIBRARYVER}$${DEBUG})
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接GoogleTest的WorkFlow
defineTest(add_link_library_GoogleTest){
#链接Library
add_library_GoogleTest()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_GoogleTest()
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_GoogleTest) {
add_deploy_library_Qt(GoogleTest, GoogleTest$${LIBRARYVER}$${DEBUG})
return (1)
}
defineTest(add_dependent_library_GoogleTest) {
add_link_library_GoogleTest()
add_deploy_library_GoogleTest()
return (1)
}

View File

@ -1,108 +0,0 @@
#----------------------------------------------------------------
#add_library_OpenCV.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
LIBRARYVER = 231
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_OpenCV){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_OpenCV(path) requires one arguments.")
command =
#basic
command += $${path}
command += $${path}/opencv
command += $${path}/opencv2
command += $${path}/opencv2/calib3d
command += $${path}/opencv2/contrib
command += $${path}/opencv2/core
command += $${path}/opencv2/features2d
command += $${path}/opencv2/flann
command += $${path}/opencv2/gpu
command += $${path}/opencv2/highgui
command += $${path}/opencv2/imgproc
command += $${path}/opencv2/legacy
command += $${path}/opencv2/ml
command += $${path}/opencv2/objdetect
command += $${path}/opencv2/video
return ($$command)
}
defineTest(add_include_OpenCV){
#包含OpenCV头文件的过程
header_path = $$get_add_include(OpenCV)
INCLUDEPATH += $$get_add_include_OpenCV($$header_path)
export(INCLUDEPATH)
return (1)
}
defineTest(add_library_OpenCV){
#链接Library
add_library(OpenCV, opencv_calib3d$${LIBRARYVER})
add_library(OpenCV, opencv_contrib$${LIBRARYVER})
add_library(OpenCV, opencv_core$${LIBRARYVER})
add_library(OpenCV, opencv_features2d$${LIBRARYVER})
add_library(OpenCV, opencv_flann$${LIBRARYVER})
add_library(OpenCV, opencv_gpu$${LIBRARYVER})
add_library(OpenCV, opencv_highgui$${LIBRARYVER})
add_library(OpenCV, opencv_imgproc$${LIBRARYVER})
add_library(OpenCV, opencv_legacy$${LIBRARYVER})
add_library(OpenCV, opencv_ml$${LIBRARYVER})
add_library(OpenCV, opencv_objdetect$${LIBRARYVER})
add_library(OpenCV, opencv_video$${LIBRARYVER})
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接OpenCV的WorkFlow
defineTest(add_link_library_OpenCV){
#链接Library
add_library_OpenCV()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_OpenCV()
#这样包含也很好,简洁明了
#add_include(OpenCV, opencv)
#add_include(OpenCV, opencv2)
#add_include(OpenCV, opencv2/core)
#...
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_OpenCV) {
add_deploy_library(OpenCV, libopencv_calib3d$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_contrib$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_core$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_features2d$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_flann$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_gpu$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_highgui$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_imgproc$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_legacy$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_ml$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_objdetect$${LIBRARYVER})
add_deploy_library(OpenCV, libopencv_video$${LIBRARYVER})
return (1)
}
defineTest(add_dependent_library_OpenCV) {
add_link_library_OpenCV()
add_deploy_library_OpenCV()
return (1)
}

View File

@ -1,109 +0,0 @@
#----------------------------------------------------------------
#add_library_OpenSceneGraph.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#3.4
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_OpenSceneGraph){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_OpenSceneGraph(path) requires one arguments.")
command =
#basic
command += $${path}
command += $${path}/OpenThreads
command += $${path}/osg
command += $${path}/osgAnimation
command += $${path}/osgDB
command += $${path}/osgFX
command += $${path}/osgGA
command += $${path}/osgManipulator
command += $${path}/osgParticle
command += $${path}/osgPresentation
command += $${path}/osgQt
command += $${path}/osgShadow
command += $${path}/osgSim
command += $${path}/osgTerrain
command += $${path}/osgText
command += $${path}/osgUI
command += $${path}/osgUtil
command += $${path}/osgViewer
command += $${path}/osgVolume
command += $${path}/osgWidget
return ($$command)
}
defineTest(add_include_OpenSceneGraph){
#包含OpenSceneGraph头文件的过程
header_path = $$get_add_include(OpenSceneGraph)
INCLUDEPATH += $$get_add_include_OpenSceneGraph($$header_path)
export(INCLUDEPATH)
return (1)
}
defineTest(add_library_OpenSceneGraph) {
#链接Library
add_library(OpenSceneGraph, OpenThreads$${LIBRARYVER})
add_library(OpenSceneGraph, osg$${LIBRARYVER})
add_library(OpenSceneGraph, osgAnimation$${LIBRARYVER})
add_library(OpenSceneGraph, osgDB$${LIBRARYVER})
add_library(OpenSceneGraph, osgFX$${LIBRARYVER})
add_library(OpenSceneGraph, osgGA$${LIBRARYVER})
add_library(OpenSceneGraph, osgManipulator$${LIBRARYVER})
add_library(OpenSceneGraph, osgParticle$${LIBRARYVER})
add_library(OpenSceneGraph, osgPresentation$${LIBRARYVER})
add_library(OpenSceneGraph, osgQt$${LIBRARYVER})
add_library(OpenSceneGraph, osgShadow$${LIBRARYVER})
add_library(OpenSceneGraph, osgSim$${LIBRARYVER})
add_library(OpenSceneGraph, osgTerrain$${LIBRARYVER})
add_library(OpenSceneGraph, osgText$${LIBRARYVER})
add_library(OpenSceneGraph, osgUI$${LIBRARYVER})
add_library(OpenSceneGraph, osgUtil$${LIBRARYVER})
add_library(OpenSceneGraph, osgViewer$${LIBRARYVER})
add_library(OpenSceneGraph, osgVolume$${LIBRARYVER})
add_library(OpenSceneGraph, osgWidget$${LIBRARYVER})
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接OpenSceneGraph的WorkFlow
defineTest(add_link_library_OpenSceneGraph) {
#链接Library
add_library_OpenSceneGraph()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_OpenSceneGraph()
#这样包含也很好,简洁明了
#add_include(OpenSceneGraph, OpenSceneGraphQtCore)
#add_include(OpenSceneGraph, OpenSceneGraphQtWidgets)
#...
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library的函数
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_OpenSceneGraph) {
add_deploy_libraryes(OpenSceneGraph)
return (1)
}
defineTest(add_dependent_library_OpenSceneGraph) {
add_link_library_OpenSceneGraph()
add_deploy_library_OpenSceneGraph()
return (1)
}

View File

@ -1,538 +0,0 @@
################################################################
##add_library_QQt.pri
##link QQt
################################################################
#简介
#add link library 链接过程 用于源代码编写的时候。包括头文件和添加库
#add deploy library 编译过程 用于源代码编译的时候。发布库
#add dependent library 包括以上两个过程
#一般app才会使用add dependent library, lib使用add link library。
#到这里用户必须明白链接概念到不了applib里才有链接概念。
#依赖概念才会在app里出现。
#这是重点。
#######################################################################################
#初始化设置
#######################################################################################
#2.4
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
##################################################################
##defines and configures
##################################################################
defineTest(add_defines_QQt){
##Qt version
QT += core sql network gui xml
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
# release open debug output
CONFIG(debug, debug|release) {
} else {
DEFINES -= QT_NO_DEBUG_OUTPUT
}
#compatible old version QQt (deperated)
greaterThan(QT_MAJOR_VERSION, 4): DEFINES += __QT5__
#defined in qqtcore.h
#lessThan(QT_MAJOR_VERSION, 5):DEFINES += nullptr=0
#mingw要加速编译make -j20-j参数是最好的解决办法。
#close win32 no using fopen_s warning
win32:DEFINES += _CRT_SECURE_NO_WARNINGS #fopen fopen_s
#msvc支持设置
msvc {
MSVC_CCFLAGS =
#this three pragma cause mingw errors
msvc:MSVC_CCFLAGS += /wd"4819" /wd"4244" /wd"4100"
#UTF8编码
DEFINES += __MSVC_UTF8_SUPPORT__
msvc:MSVC_CCFLAGS += /execution-charset:utf-8
msvc:MSVC_CCFLAGS += /source-charset:utf-8
#msvc:MSVC_CCFLAGS += /utf-8 #这一个是快捷方式,顶上边两个。
#指定/mp编译选项编译器将使用并行编译同时起多个编译进程并行编译不同的cpp
msvc:MSVC_CCFLAGS += /MP
#指出这个FLAG只能用于MSVC
msvc:QMAKE_CFLAGS += $${MSVC_CCFLAGS}
msvc:QMAKE_CXXFLAGS += $${MSVC_CCFLAGS}
#指定stable.h这个头文件作为编译预处理文件MFC里这个文件一般叫stdafx.h 然后在 stable.h里 包含你所用到的所有 Qt 头文件
#在.pro 文件中加入一行, 加在这里,加速编译。
#msvc:PRECOMPILED_HEADER = $${PWD}/qqt-qt.h
#指出precompiler header只能用于MSVC
#这个功能可用,可是编译问题比较多,不方便,所以默认不开开。
}
#################################################################
##build qqt or link qqt
#################################################################
##different target:
##-----------------------------------------------
##win platform:
##build qqt dll + QQT_LIBRARY
##build qqt lib + QQT_STATIC_LIBRARY
##link qqt lib + QQT_STATIC_LIBRARY
##link qqt dll + ~~
##- - - - - - - - - - - - - - - - - - - - -
##*nix platform:
##build and link qqt dll or lib + ~~
##-----------------------------------------------
#link QQt static library in some occation on windows
#when link QQt static library, if no this macro, headers can't be linked on windows.
#Qt is static by mingw32 building ?
ios{
#on my computer, Qt library are all static library?
DEFINES += QQT_STATIC_LIBRARY
message(Build $${TARGET} QQT_STATIC_LIBRARY is defined. build and link)
}
#link and build all need this macro
contains(DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QCUSTOMPLOT_STATIC_LIBRARY
DEFINES += QZXING_STATIC_LIBRARY
DEFINES += QT_QTSOAP_STATIC_LIBRARY
DEFINES += BUILD_QDEVICEWATCHER_STATIC
DEFINES += QT_QTMMLWIDGET_STATIC_LIBRARY
DEFINES += QT_GUMBO_STATIC_LIBRARY
}
################################################################
##QQt Functions Macro
################################################################
#You need switch these more macro according to your needs when you build this library
#You can tailor QQt with these macro.
#Default: macroes is configed, some open, some close, compatibled to special accotation.
##App希望裁剪LibQQt开关这个文件里的组件宏用户有必要读懂这个头文件。up to so.
##################C++11 Module###############################
#if you use C++11, open this annotation. suggest: ignore
#DEFINES += __CPP11__
contains (DEFINES, __CPP11__) {
#macOS gcc Qt4.8.7
#qobject.h fatal error: 'initializer_list' file not found,
#Qt4.8.7 can't support c++11 features
#QMAKE_CXXFLAGS += "-std=c++11"
#QMAKE_CXXFLAGS += "-std=c++0x"
#below: gcc version > 4.6.3
#Open this Config, Why in Qt4 works? see qmake config auto ignored this feature.
#In Qt5? don't need open this config, qmake auto add c++11 support on linux plat.
#on windows mingw32? need test
#CONFIG += c++11
#compile period
#LibQQt need c++11 support. Please ensure your compiler version.
#LibQQt used override identifier
#lambda also need c++11
}
##################MultiMedia Module###############################
DEFINES += __MULTIMEDIA__
#on mac qt4 has no multimedia
contains(QSYS_PRIVATE, macOS) {
lessThan(QT_MAJOR_VERSION, 5):DEFINES-=__MULTIMEDIA__
}
contains (DEFINES, __MULTIMEDIA__) {
QT += multimedia
}
##################PluginSupport Module###############################
#used in windows linux e-linux android, mac ios not support exactly
#plugin notifer, and plugin device managament.
#if you use DeviceWatcher , open this annotation
DEFINES += __PLUGINSUPPORT__
contains(QSYS_PRIVATE, iOS||iOSSimulator||macOS) {
DEFINES -= __PLUGINSUPPORT__
}
##################PrintSupport Module###############################
#if you use printsupport , open this annotation
DEFINES += __PRINTSUPPORT__
#Qt 5.9.1, ios and android can't support this feature, because Qt 5.9.1, broken
equals(QT_VERSION, 5.9.1) {
contains(QSYS_PRIVATE, iOS||iOSSimulator||Android||AndroidX86) {
DEFINES -= __PRINTSUPPORT__
}
}
#Qt 5.9.2, android support this feature
#Qt 5.9.2, ios can't use printsupport
contains(QSYS_PRIVATE, iOS||iOSSimulator) {
DEFINES -= __PRINTSUPPORT__
}
contains (DEFINES, __PRINTSUPPORT__) {
#qtHaveModule(printsupport) : message(qqt use module printsupport)
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
}
##################Charts Module###############################
#if you use QQtCharts, open this annotation
DEFINES += __QQTCHARTS__
lessThan(QT_MAJOR_VERSION, 5):DEFINES-=__QQTCHARTS__
contains(QSYS_PRIVATE, Arm32||Mips32||Embedded):DEFINES-=__QQTCHARTS__
#based on QtCharts, need charts module
contains(DEFINES, __QQTCHARTS__) {
QT += charts
#if you use qcustomplot, open this annotation
#qcustomplot use QPrinter to export pdf file, QChart haven't use it, I fix it, now compiler ok.
#in ios qcustomplot can't call savePdf now, no result but a log no printer error.
DEFINES += __CUSTOMPLOT__
}
##################QQtLogSystem Module###############################
DEFINES += __QQTLOGSYSTEMSUPPORT__
###########################################################################
###QQtSocketClient多组功能组件。
############
##################QQt Network Module##################################
#包括SerialPort Bluetooth TcpUdp
#包括HttpFtp 多路的HttpFtpQQtAccessManager WebService WebSocket Gumbo
#包括WebKit WebEngine
DEFINES += __NETWORKSUPPORT__
contains (DEFINES, __NETWORKSUPPORT__) {
##################SerialPort Module##################################
#if you use qextserialport, open the annotation
#suggest: Qt5 use factory-packed, Qt4 use forming Qt5, extra use this.
#DEFINES += __QEXTSERIALPORT__
#if compiler QtSerialPort module manual, note this line is a good idea. default: qt4 qextserialport
lessThan(QT_MAJOR_VERSION, 5): DEFINES += __QEXTSERIALPORT__
#to ios, use qextserialport
#android qt5 support serialport default?
contains (DEFINES, __IOS__): DEFINES += __QEXTSERIALPORT__
contains (DEFINES, __QEXTSERIALPORT__) {
CONFIG += thread
unix:DEFINES += _TTY_POSIX_
win32:DEFINES += _TTY_WIN_
#Qt4 is not a very good Cross Qt version, Qt5 suggest.
win32:LIBS += -lsetupapi -ladvapi32
#message ( __QEXTSERIALPORT__ Defined in $${TARGET})
} else {
#message ( __QSERIALPORT__ Defined in $${TARGET})
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
lessThan(QT_MAJOR_VERSION, 5): CONFIG += serialport
unix {
DEFINES += _TTY_POSIX_
} else {
DEFINES += _TTY_WIN_
}
}
##################Bluetooth Module###############################
#if you use qtbluetooth, open this annotation
DEFINES += __BLUETOOTH__
#if you compiler QtBluetooth module manual, note this line is a good idea. default qt4 doesn't use bluetooth
lessThan(QT_MAJOR_VERSION, 5): DEFINES -= __BLUETOOTH__
#condation
contains (DEFINES, __BLUETOOTH__) {
greaterThan(QT_MAJOR_VERSION, 4): QT += bluetooth
lessThan(QT_MAJOR_VERSION, 5): CONFIG += bluetooth
}
##################Nfc Module###############################
#if you use QtNfc, open this annotation
DEFINES += __NFC__
#if you compiler QtNfc module manual, note this line is a good idea. default <qt5.2 doesn't use bluetooth
lessThan(QT_VERSION, 5.2): DEFINES -= __NFC__
DEFINES -= __NFC__
#condation
contains (DEFINES, __NFC__) {
QT += nfc
}
##################RawSocket Module###############################
#raw socket, 这个是常用的不要关dont close。...
DEFINES += __TCPUDPSOCKET__
##################WebService Module###############################
#if you use Qt Service Support ( QtSoap ), open this annotation
DEFINES += __WEBSERVICESUPPORT__
#One Ftp Http 单工...
#Multi 半双工(客户端并发,服务器序列) QNetworkAccessManager
#QNetworkAccessManager 提供多路并发 HTTP session。
#if you use QNetworkAccessManagerSupport , open this annotation
DEFINES += __WEBACCESSSUPPORT__
lessThan(QT_MAJOR_VERSION, 5): DEFINES -= __WEBACCESSSUPPORT__
contains(QSYS_PRIVATE, Arm32||Mips32||Embedded):DEFINES -= __WEBACCESSSUPPORT__
contains (DEFINES, __WEBACCESSSUPPORT__) {
#QSslError not found, you need recompiler Qt4
}
DEFINES += __WEBKITSUPPORT__
contains (DEFINES, __WEBKITSUPPORT__) {
#TODO: QT += webkit
}
DEFINES += __WEBENGINESUPPORT__
contains (DEFINES, __WEBENGINESUPPORT__) {
}
##################WebSocket Module###############################
#Multi New Protocol 全双工 QWebSocket
#if you use QWebSocketSupport , open this annotation
DEFINES += __WEBSOCKETSUPPORT__
#equals(QSYS_PRIVATE, macOS):DEFINES += __WEBSOCKETSUPPORT__
lessThan(QT_MAJOR_VERSION, 5): DEFINES -= __WEBSOCKETSUPPORT__
contains (DEFINES, __WEBSOCKETSUPPORT__) {
QT += websockets
#Qt4 QSslError not found, you need recompiler Qt4
#TODO: QT += webkit
}
#c++ html parser query
#if you use Gumbo parser query, open this annotation
#这个组件用于解析网页,获得网页数据。
#gumbo属于网络模块中高级工具经常用于写爬虫。
DEFINES += __GUMBOSUPPORT__
contains (DEFINES, __GUMBOSUPPORT__) {
#Gumbo need std support, c99...
QMAKE_CFLAGS += -std=c99
}
}
##################Exquisite Widgets Module###############################
#if you use Exquisite widgets, open this annotation
#精美模块,包含不少的精美组件,这个模块可以集中开关。
#依赖基础控件
DEFINES += __EXQUISITE__
contains (DEFINES, __EXQUISITE__) {
#if you use QR encode, open this annotation
DEFINES += __QRENCODE__
#if you use QR decode, open this annotation
#QZXing isnan_z function error. fixed
#QZxing delegating constructors used. need c++11,but qt4.8.7 dont support c++11,compiler gcc 5.4.0 20160609 support....
#DEFINES += __QRDECODE__
contains(DEFINES, __QRDECODE__) {
#lessThan(QT_MAJOR_VERSION, 5): QT += declarative
greaterThan(QT_MAJOR_VERSION, 4): QT += quick
}
#if you use gif widgets, open this annotation
DEFINES += __GIFWIDGETS__
#if you use Svg widgets, open this annotation
DEFINES += __SVGWIDGETS__
contains(QSYS_PRIVATE, macOS) {
lessThan(QT_MAJOR_VERSION, 5):DEFINES-=__SVGWIDGETS__
}
contains (DEFINES, __SVGWIDGETS__) {
QT += svg
}
##################Mathes Module###############################
DEFINES += __MATHWIDGETSUPPORT__
#LOGIC CAMERA PREVIEW
#depend on dmmu
DEFINES += __LOGICCAMERAMODULE__
#opengl module
DEFINES += __OPENGLWIDGETS__
contains(QSYS_PRIVATE, Mips32||Arm32||Embedded):DEFINES-=__OPENGLWIDGETS__
contains (DEFINES, __OPENGLWIDGETS__) {
QT += opengl
}
#single color only widget
DEFINES += __COLORWIDGETS__
#click widgets
DEFINES += __CLICKWIDGETS__
#click sound widgets
DEFINES += __CLICKSOUNDWIDGETS__
}
########################################################################
###这个模块名为高级模块。
###如果初中级工程师能使用这个模块完成App那么必定是高分实现力学员。
###建议中级以上工程师尝试。2018年4月22日 星期天 11点08分
############
##################HighGrade Module###############################
#if you use HighGrade module, open this annotation
#高级模块,包含不少的高级功能组件,这个模块可以集中开关。
DEFINES += __HIGHGRADE__
#依赖网络模块
!contains (DEFINES, __NETWORKSUPPORT__): DEFINES -= __HIGHGRADE__
contains (DEFINES, __HIGHGRADE__) {
}
#################################################################
##library
##################################################################
equals (QSYS_PRIVATE, iOSSimulator):{
#error need
#QMAKE_CXXFLAGS +=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
}
win32 {
LIBS += -luser32
contains (DEFINES, __OPENGLWIDGETS__) {
LIBS += -lopengl32 -lglu32
}
}else: unix {
equals(QSYS_PRIVATE, macOS) {
#min macosx target
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
#deperated
#QMAKE_MAC_SDK=macosx10.12
#MACOSXSDK = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$${QMAKE_MACOSX_DEPLOYMENT_TARGET}.sdk
#QMAKE_LIBDIR = $${MACOSXSDK}
#LIBS += -F$${MACOSXSDK}/System/Library/Frameworks
#LIBS += -L$${MACOSXSDK}/usr/lib
LIBS += -framework DiskArbitration -framework Cocoa -framework IOKit
export(QMAKE_MACOSX_DEPLOYMENT_TARGET)
export(LIBS)
}else:contains(QSYS_PRIVATE, iOS|iOSSimulator){
QMAKE_LFLAGS += -ObjC -lsqlite3 -lz
QMAKE_IOS_DEPLOYMENT_TARGET = 8
export(QMAKE_LFLAGS)
export(QMAKE_IOS_DEPLOYMENT_TARGET)
}
}
export(QMAKE_CFLAGS)
export(QMAKE_CXXFLAGS)
export(CONFIG)
export(DEFINES)
export(LIBS)
export(QT)
return (1)
}
##################################################################
##include directories
##################################################################
defineReplace(get_add_include_QQt){
path = $$1
!isEmpty(2) : error("get_add_include_QQt(path) requires one arguments.")
isEmpty(1) : error("get_add_include_QQt(path) requires one arguments.")
#basic
command += $${path}
command += $${path}/core
command += $${path}/gui
command += $${path}/widgets
command += $${path}/multimedia
command += $${path}/sql
command += $${path}/frame
command += $${path}/printsupport
#charts
command += $${path}/charts
command += $${path}/charts/qcustomplot
#network
command += $${path}/network
command += $${path}/network/qextserialport
##soap (web service)
command += $${path}/network/soap
##gumbo library
command += $${path}/network/gumbo/query/src
command += $${path}/network/gumbo/parser/src
win32{
command += $${path}/network/gumbo/parser/visualc/include
}
#plugin support
command += $${path}/pluginsupport
command += $${path}/pluginsupport/devicewatcher
#exquisite widgets
command += $${path}/exquisite
command += $${path}/exquisite/clicksoundwidgets
command += $${path}/exquisite/clickwidgets
command += $${path}/exquisite/svgwidgets
command += $${path}/exquisite/gifwidgets
command += $${path}/exquisite/openglwidgets
command += $${path}/exquisite/colorwidgets
command += $${path}/exquisite/mathml
command += $${path}/exquisite/dmmu
##qr code library
command += $${path}/exquisite/qrcode/qrencode
command += $${path}/exquisite/qrcode/qrdecode
command += $${path}/exquisite/qrcode/qrdecode/zxing
win32-g++{
command += $${path}/exquisite/qrcode/qrdecode/zxing/win32/zxing
}
win32-msvc*{
command += $${path}/exquisite/qrcode/qrdecode/zxing/win32/zxing \
$${path}/exquisite/qrcode/qrdecode/zxing/win32/zxing/msvc
}
#highgrade module
command += $${path}/highgrade
return ($$command)
}
#把QQt SDK头文件路径加入进来 为搜索头文件而添加
#其实过去做的自动添加QQt头文件就是这个功能
#用户包含QQt头文件就不必加相对路径了方便了很多
defineTest(add_include_QQt){
#包含QQt头文件的过程
header_path = $$get_add_include_bundle(QQt)
INCLUDEPATH += $$get_add_include_QQt($$header_path)
export(INCLUDEPATH)
return (1)
}
defineTest(add_library_QQt){
#链接QQt
add_library_bundle(QQt)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接QQt
#用户只需要调用这个函数一个就能开启链接QQt 包含QQt 跟随App发布QQt三个步骤的App生产线工位。
defineTest(add_link_library_QQt){
#细心的用户会发现QQt的头文件包含了两次一个在源代码目录里一个在SDK目录里两个并不冲突。系统只要搜索到一个目录里的就可以使用了。
#当然我们确信SDK目录里的头文件服从于源代码目录里的头文件。
#包含QQt的头文件
add_include_QQt()
#包含QQt的宏定义
add_defines_QQt()
#链接lib)
add_library_QQt()
return (1)
}
#以上代码只完成了链接libQQt 包含libQQt头文件 包含libQQt宏文件(在宏文件控制下Library的头文件才有精确的意义)
#没有发布libQQt
#App在开发中调用发布App以后 必然需要调用add_deploy_library(QQt)发布QQt到运行时。强大的从sdk发布到build和deploy位置。
#调试,正常;发布运行,正常。
#:) 方便函数
defineTest(add_deploy_library_QQt){
add_deploy_library_bundle(QQt)
return (1)
}
defineTest(add_dependent_library_QQt){
add_link_library_QQt()
add_deploy_library_QQt()
return (1)
}

View File

@ -1,73 +0,0 @@
#----------------------------------------------------------------
#add_library_Qwt.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#6.1.3
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_Qwt){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_Qwt(path) requires one arguments.")
command =
#basic
command += $${path}
return ($$command)
}
defineTest(add_include_Qwt){
#包含Qwt头文件的过程
header_path = $$get_add_include(Qwt)
INCLUDEPATH += $$get_add_include_Qwt($$header_path)
export(INCLUDEPATH)
return (1)
}
defineTest(add_library_Qwt){
#链接Library
add_library(Qwt, Qwt$${LIBRARYVER})
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接Qwt的WorkFlow
defineTest(add_link_library_Qwt){
#链接Library
add_library_Qwt()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_Qwt()
#这样包含也很好,简洁明了
#add_include(Qwt, opencv)
#add_include(Qwt, opencv2)
#add_include(Qwt, opencv2/core)
#...
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_Qwt) {
add_deploy_library(Qwt, Qwt$${LIBRARYVER})
return (1)
}
defineTest(add_dependent_library_Qwt) {
add_link_library_Qwt()
add_deploy_library_Qwt()
return (1)
}

View File

@ -1,72 +0,0 @@
#----------------------------------------------------------------
#add_library_QwtPlot3d.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#6.1.3
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_QwtPlot3d){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_QwtPlot3d(path) requires one arguments.")
command =
#basic
command += $${path}
return ($$command)
}
defineTest(add_include_QwtPlot3d){
#包含QwtPlot3d头文件的过程
header_path = $$get_add_include(QwtPlot3d)
INCLUDEPATH += $$get_add_include_QwtPlot3d($$header_path)
export(INCLUDEPATH)
return (1)
}
defineTest(add_library_QwtPlot3d){
#链接Library
add_library(QwtPlot3d, QwtPlot3d$${LIBRARYVER})
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接QwtPlot3d的WorkFlow
defineTest(add_link_library_QwtPlot3d){
#链接Library
add_library_QwtPlot3d()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_QwtPlot3d()
#这样包含也很好,简洁明了
#add_include(QwtPlot3d, opencv)
#add_include(QwtPlot3d, opencv2)
#add_include(QwtPlot3d, opencv2/core)
#...
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_QwtPlot3d) {
add_deploy_library(QwtPlot3d, QwtPlot3d$${LIBRARYVER})
return (1)
}
defineTest(add_dependent_library_QwtPlot3d) {
add_link_library_QwtPlot3d()
add_deploy_library_QwtPlot3d()
return (1)
}

View File

@ -1,92 +0,0 @@
#----------------------------------------------------------------
#add_library_SDL2.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#2
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
#修改
#defineReplace(get_add_include_SDL2){
# isEmpty(1)|!isEmpty(2) : error("get_add_include_SDL2(path) requires one arguments.")
# path = $$1
# command =
# #basic
# command += $${path}
# #这里添加$${path}下的子文件夹
# return ($$command)
#}
#这里,[get_]add_include_bundle代表macOS下Library的头文件在bundle里
defineTest(add_include_SDL2){
#包含SDL2头文件的过程
#header_path = $$get_add_include(SDL2)
#INCLUDEPATH += $$get_add_include_SDL2($$header_path)
#export(INCLUDEPATH)
#不用上边这种,这样包含也很好,简洁明了
#add_include_bundle(SDL2, SDL2, xxx)
#add_include(SDL2, SDL2, xxx)
#添加子路径
add_include(SDL2, SDL2)
add_include(SDL2, SDL2, ..)
#这个是有点分歧其实mac下SDL22 framwrok里的Headers就够用了可是某些程序当中喜欢把头文件带SDL22字样bundle里面没有所以出现了下边这个inc和上边这个inc并存的情况。
add_include_bundle(SDL2, SDL2)
return (1)
}
#这个地方add_library_bundle代表包括macOS下lib在bundle里。
#修改
defineTest(add_library_SDL2){
#添加这个SDK里的library
add_library_bundle(SDL2, SDL2$${LIBRARYVER})
return (1)
}
defineTest(add_defines_SDL2){
#添加这个SDK里的library
#add_defines(SDL2)
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接SDL2的WorkFlow
#留意
defineTest(add_link_library_SDL2){
#链接Library
add_library_SDL2()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_SDL2()
#添加宏定义
add_defines_SDL2()
return (1)
}
#发布依赖library
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_SDL2) {
add_deploy_library_bundle(SDL2, SDL2$${LIBRARYVER})
#add_deploy_libraryes(SDL2)
return (1)
}
defineTest(add_dependent_library_SDL2) {
add_link_library_SDL2()
add_deploy_library_SDL2()
return (1)
}

View File

@ -1,90 +0,0 @@
#----------------------------------------------------------------
#add_library_Template.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#_bundle的取舍在于macOS系统下使用的library为bundle形式还是dylib形式。
#######################################################################################
#初始化设置
#######################################################################################
#1.0.0
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
#修改
#defineReplace(get_add_include_Template){
# isEmpty(1)|!isEmpty(2) : error("get_add_include_Template(path) requires one arguments.")
# path = $$1
# command =
# #basic
# command += $${path}
# #这里添加$${path}下的子文件夹
# return ($$command)
#}
#这里,[get_]add_include_bundle代表macOS下Library的头文件在bundle里
defineTest(add_include_Template){
#包含Template头文件的过程
#header_path = $$get_add_include(Template)
#INCLUDEPATH += $$get_add_include_Template($$header_path)
#export(INCLUDEPATH)
#不用上边这种,这样包含也很好,简洁明了
#add_include_bundle(Template, Template, xxx)
#add_include(Template, Template, xxx)
#添加子路径
add_include(Template, Template)
return (1)
}
#这个地方add_library_bundle代表包括macOS下lib在bundle里。
#修改
defineTest(add_library_Template){
#添加这个SDK里的library
add_library(Template, Template$${LIBRARYVER})
return (1)
}
defineTest(add_defines_Template){
#添加这个SDK里的library
#add_defines(Template)
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接Template的WorkFlow
#留意
defineTest(add_link_library_Template){
#链接Library
add_library_Template()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_Template()
#添加宏定义
add_defines_Template()
return (1)
}
#发布依赖library
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_Template) {
add_deploy_library(Template, Template$${LIBRARYVER})
#add_deploy_libraryes(Template)
return (1)
}
defineTest(add_dependent_library_Template) {
add_link_library_Template()
add_deploy_library_Template()
return (1)
}

View File

@ -1,75 +0,0 @@
#----------------------------------------------------------------
#add_library_VLC.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#1.1.0
LIBRARYVER =
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_VLC){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_VLC(path) requires one arguments.")
command =
#basic
command += $${path}
command += $${path}/VLCQtCore
command += $${path}/VLCQtWidgets
return ($$command)
}
defineTest(add_include_VLC){
#包含VLC头文件的过程
header_path = $$get_add_include(VLC)
INCLUDEPATH += $$get_add_include_VLC($$header_path)
export(INCLUDEPATH)
return (1)
}
defineTest(add_library_VLC) {
#链接Library
add_library(VLC, VLCQtCore$${LIBRARYVER})
add_library(VLC, VLCQtWidgets$${LIBRARYVER})
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接VLC的WorkFlow
defineTest(add_link_library_VLC) {
#链接Library
add_library_VLC()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_VLC()
#这样包含也很好,简洁明了
#add_include(VLC, VLCQtCore)
#add_include(VLC, VLCQtWidgets)
#...
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library的函数
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_VLC) {
add_deploy_libraryes(VLC)
return (1)
}
defineTest(add_dependent_library_VLC) {
add_link_library_VLC()
add_deploy_library_VLC()
return (1)
}

View File

@ -1,78 +0,0 @@
#----------------------------------------------------------------
#add_library_log4cpp.pri
#这是给用户提供的方便pri
#这个比较common允许拷贝到用户工程中更改。
#----------------------------------------------------------------
#######################################################################################
#初始化设置
#######################################################################################
#1.0.0
LIBRARYVER = .5
#######################################################################################
#定义内部函数
#######################################################################################
defineReplace(get_add_include_log4cpp){
path = $$1
isEmpty(1)|!isEmpty(2) : error("get_add_include_log4cpp(path) requires one arguments.")
command =
#basic
command += $${path}
#这里添加$${path}下的子文件夹
command += $${path}/..
command += $${path}/threading
return ($$command)
}
defineTest(add_include_log4cpp){
#包含log4cpp头文件的过程
header_path = $$get_add_include(log4cpp)
INCLUDEPATH += $$get_add_include_log4cpp($$header_path)
export(INCLUDEPATH)
#不用上边这种,这样包含也很好,简洁明了
#add_include(log4cpp)
#add_include(log4cpp, log4cpp)
#add_include(log4cpp, log4cpp/core)
#...
return (1)
}
defineTest(add_library_log4cpp){
add_library(log4cpp, log4cpp$${LIBRARYVER})
return (1)
}
#######################################################################################
#定义外部函数
#######################################################################################
#链接log4cpp的WorkFlow
defineTest(add_link_library_log4cpp){
#链接Library
add_library_log4cpp()
#添加头文件 (如果头文件目录扩展了,就改这个函数)
add_include_log4cpp()
#添加宏定义
#add_defines(xx)
return (1)
}
#发布依赖library
#注意Android也需要这个函数使用这个函数Android才会发布Library到运行时。上边的只是链接作用。
defineTest(add_deploy_library_log4cpp) {
add_deploy_library(log4cpp, log4cpp$${LIBRARYVER})
return (1)
}
defineTest(add_dependent_library_log4cpp) {
add_link_library_log4cpp()
add_deploy_library_log4cpp()
return (1)
}

View File

@ -1,12 +0,0 @@
<EFBFBD>ٶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD>https://pan.baidu.com/s/1FPPkTUnk2XBL4rpnZsAGmw <20><><EFBFBD>룺hotz
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>SDK<EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>SDK<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>룬Multi-environ Manager<65><72><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>æ<EFBFBD><C3A6>mm<6D><6D><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>genmake<6B><65><EFBFBD>ߵȵı<C8B5><C4B1><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2A1A3><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD><E6A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB>
<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṩԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߡ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>㹻ǿ<EFBFBD>Ķ<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

View File

@ -1,220 +0,0 @@
#---------------------------------------------------------------------------------
#add_base_header.pri
#应用程序和Library的基础header。
#包含app工程、lib工程通用的宏(定义)、配置(定义)、依赖、[头文件]、编译参数、[平台]编译设置
#---------------------------------------------------------------------------------
#################################################################
##definition and configration
##need QSYS
#################################################################
#in theory, this should not be limited to 4.8.0, no limit is good.
##Qt version
QT += core sql network gui xml
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
# release open debug output
CONFIG(debug, debug|release) {
} else {
DEFINES -= QT_NO_DEBUG_OUTPUT
}
#compatible old version QQt (deperated)
#greaterThan(QT_MAJOR_VERSION, 4): DEFINES += __QT5__
#defined in qqtcore.h
#lessThan(QT_MAJOR_VERSION, 5):DEFINES += nullptr=0
#mingw要加速编译make -j20-j参数是最好的解决办法。
#close win32 no using fopen_s warning
win32:DEFINES += _CRT_SECURE_NO_WARNINGS #fopen fopen_s
#msvc支持设置
msvc {
MSVC_CCFLAGS =
#this three pragma cause mingw errors
msvc:MSVC_CCFLAGS += /wd"4819" /wd"4244" /wd"4100"
#UTF8编码
DEFINES += __MSVC_UTF8_SUPPORT__
msvc:MSVC_CCFLAGS += /execution-charset:utf-8
msvc:MSVC_CCFLAGS += /source-charset:utf-8
#msvc:MSVC_CCFLAGS += /utf-8 #这一个是快捷方式,顶上边两个。
#指定/mp编译选项编译器将使用并行编译同时起多个编译进程并行编译不同的cpp
msvc:MSVC_CCFLAGS += /MP
#指出这个FLAG只能用于MSVC
msvc:QMAKE_CFLAGS += $${MSVC_CCFLAGS}
msvc:QMAKE_CXXFLAGS += $${MSVC_CCFLAGS}
#指定stable.h这个头文件作为编译预处理文件MFC里这个文件一般叫stdafx.h 然后在 stable.h里 包含你所用到的所有 Qt 头文件
#在.pro 文件中加入一行, 加在这里,加速编译。
#msvc:PRECOMPILED_HEADER = $${PWD}/lib-qt.h
#指出precompiler header只能用于MSVC
#这个功能可用,可是编译问题比较多,不方便,所以默认不开开。
}
#CONFIG += debug_and_release
#CONFIG += build_all
#if some bug occured, maybe this help me, close some warning
CCFLAG =
!win32:CCFLAGS = -Wno-unused-parameter -Wno-reorder -Wno-c++11-extensions -Wno-c++11-long-long -Wno-comment
QMAKE_CFLAGS += $${CCFLAGS}
QMAKE_CXXFLAGS += $${CCFLAGS}
#################################################################
##version
#################################################################
#user can use app_version.pri to modify app version once, once is all. DEFINES += APP_VERSION=0.0.0 is very good.
#unix:VERSION = $${QQT_VERSION}
#bug?:open this macro, TARGET will suffixed with major version.
#win32:VERSION = $${QQT_VERSION4}
QMAKE_TARGET_FILE = "$${TARGET}"
QMAKE_TARGET_PRODUCT = "$${TARGET}"
QMAKE_TARGET_COMPANY = "www.$${TARGET}.com"
QMAKE_TARGET_DESCRIPTION = "$${TARGET} Classes"
QMAKE_TARGET_COPYRIGHT = "Copyright 2017-2022 $${TARGET} Co., Ltd. All rights reserved"
win32 {
#common to use upload, this can be ignored.
#open this can support cmake config.h.in
#configure_file(qqtversion.h.in, qqtversion.h) control version via cmake.
#qmake version config and cmake version config is conflicted
#RC_FILE += qqt.rc
#RC_ICONS=
RC_LANG=0x0004
RC_CODEPAGE=
}
#################################################################
##build lib or link lib
#################################################################
##different target:
##-----------------------------------------------
##win platform:
##build lib dll + LIB_LIBRARY
##build lib lib + LIB_STATIC_LIBRARY
##link lib lib + LIB_STATIC_LIBRARY
##link lib dll + ~~
##- - - - - - - - - - - - - - - - - - - - -
##*nix platform:
##build and link lib dll or lib + ~~
##-----------------------------------------------
#link Lib static library in some occation on windows
#when link Lib static library, if no this macro, headers can't be linked on windows.
#在这里添加了LIB_STATIC_LIBRARY 用户可以使用 还有LIB_LIBRARY
#contains(QSYS_PRIVATE, Win32|Windows|Win64 || iOS|iOSSimulator)
#header里不再使用平台进行判定而是使用工程当中定义的CONFIG static[lib] 和 dll进行判定。
#理论上mingw编译的Qt library不应该是静态的啊...
#Qt is static by mingw32 building
ios{
#on my computer, Qt library are all static library?
DEFINES += LIB_STATIC_LIBRARY
message(Build $${TARGET} LIB_STATIC_LIBRARY is defined. build and link)
}
#link and build all need this macro
contains(DEFINES, LIB_STATIC_LIBRARY) {
}
################################################################
##build cache (此处为中间目标目录,对用户并不重要)
##此处加以干涉,使目录清晰。
##此处关于DESTDIR的设置导致用户必须把这个文件的包含提前到最前边的位置才能进行App里的目录操作。
##删除干涉?
##用户注意:(done in app_base_manager), 首先include(app_link_lib_library.pri)然后做app的工作和include其他pri包括LibLib提供的其他pri保证这个顺序就不会出错了。
##对编译目标目录进行干涉管理,显得更加细腻。
##用户注意:这里相当于给编译中间目录加了一个自动校准,属于校正范畴。
##这样做保持了App工程和LibLib工程中间目录的一致性但是并不必要。
##升级后的多链接技术省略了BuildType目录这个设置有必要了。
################################################################
defineTest(add_build_dir_struct){
BUILD_DIR =
!isEmpty(1):BUILD_DIR=$$1/
OBJECTS_DIR = $${BUILD_DIR}obj
MOC_DIR = $${BUILD_DIR}obj/moc.cpp
UI_DIR = $${BUILD_DIR}obj/ui.h
RCC_DIR = $${BUILD_DIR}obj/qrc.cpp
DESTDIR = $${BUILD_DIR}bin
equals(QMAKE_HOST.os, Windows) {
OBJECTS_DIR~=s,/,\\,g
MOC_DIR~=s,/,\\,g
UI_DIR~=s,/,\\,g
RCC_DIR~=s,/,\\,g
DESTDIR~=s,/,\\,g
}
export(OBJECTS_DIR)
export(MOC_DIR)
export(UI_DIR)
export(RCC_DIR)
export(DESTDIR)
return (1)
}
#经过验证在windows下debug和release中间目标的确不同。
#在macOS里设置相同的编译目录竟然一样可是生成目标大小也一样...理论上应该不一样可能是release覆盖了debug的中间目标。
#所以这个地方编译目录无论如何debug和release要分开
add_build_dir_struct($${BUILD})
################################################################
##Lib Functions Macro
################################################################
#You need switch these more macro according to your needs when you build this library
#You can tailor Lib with these macro.
#Default: macroes is configed, some open, some close, compatibled to special accotation.
##App希望裁剪LibLib开关这个文件里的组件宏用户有必要读懂这个头文件。up to so.
##################C++11 Module###############################
#if you use C++11, open this annotation. suggest: ignore
#DEFINES += __CPP11__
contains (DEFINES, __CPP11__) {
#macOS gcc Qt4.8.7
#qobject.h fatal error: 'initializer_list' file not found,
#Qt4.8.7 can't support c++11 features
#QMAKE_CXXFLAGS += "-std=c++11"
#QMAKE_CXXFLAGS += "-std=c++0x"
#below: gcc version > 4.6.3
#Open this Config, Why in Qt4 works? see qmake config auto ignored this feature.
#In Qt5? don't need open this config, qmake auto add c++11 support on linux plat.
#on windows mingw32? need test
#CONFIG += c++11
#compile period
#LibLib need c++11 support. Please ensure your compiler version.
#LibLib used override identifier
#lambda also need c++11
}
#################################################################
##library
##################################################################
equals (QKIT_PRIVATE, iOSSimulator):{
#error need
#QMAKE_CXXFLAGS +=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
}
win32 {
LIBS += -luser32
}else: unix {
equals(QSYS_PRIVATE, macOS) {
#min macosx target
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
#deperated
#QMAKE_MAC_SDK=macosx10.12
#MACOSXSDK = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$${QMAKE_MACOSX_DEPLOYMENT_TARGET}.sdk
#QMAKE_LIBDIR = $${MACOSXSDK}
#LIBS += -F$${MACOSXSDK}/System/Library/Frameworks
#LIBS += -L$${MACOSXSDK}/usr/lib
LIBS += -framework DiskArbitration -framework Cocoa -framework IOKit
}else:contains(QSYS_PRIVATE, iOS|iOSSimulator){
QMAKE_LFLAGS += -ObjC -lsqlite3 -lz
QMAKE_IOS_DEPLOYMENT_TARGET = 8
}
}

View File

@ -1,396 +0,0 @@
#---------------------------------------------------------------------------------
#add_base_manager.pri
#应用程序和Library的基础管理器统一使用这个管理器。
#base header包揽所有的app和lib的通用设置
#base manager包揽所有app和lib启动的函数
#V2.0
#和同目录下pri组一同拷贝使用不拷贝可以使用。建议不拷贝使用可以跟进技术更新。
#设计难度:控制难度,丰富接口。
#---------------------------------------------------------------------------------
#简介
#在这个管理器里App和Lib工程其实是区分开的。
#尤其动态编译 配置开关、宏定义 是在这里处理的,但是静态编译 配置开关在这里、宏定义在base_header里。这里需要加强理解。
#这是重点。
################################################################################
#初始化
################################################################################
ADD_BASE_MANAGER_PRI_PWD = $${PWD}
################################################################################
#包含这个pri依赖的pri
#设置目标平台 QSYS
################################################################################
include ($${PWD}/add_platform.pri)
include ($${PWD}/add_function.pri)
################################################################################
#多链接技术入口
#配置重要的三个路径 APP_BUILD_ROOT APP_DEPLOY_ROOT LIB_SDK_ROOT
################################################################################
include($${PWD}/add_multi_link_technology.pri)
################################################################################
#这里的pri提供multi link的全部函数
#增加发布
#增加发布配置
#增加链接库
#增加链接库头文件
#增加SDK (lib用)
#增加版本信息
################################################################################
#app发布所需要的函数
include ($${PWD}/add_deploy.pri)
#app发布library所需要的函数
include ($${PWD}/add_deploy_library.pri)
#app发布配置项需要的函数
include ($${PWD}/add_deploy_config.pri)
#链接lib所需要的函数 包含lib头文件所需要的函数 设置lib宏所需要的函数
include ($${PWD}/add_library.pri)
#lib发布sdk所需要的函数
#注释提供修改Target名字的函数
include ($${PWD}/add_sdk.pri)
#program version
include ($${PWD}/add_version.pri)
#program language
include ($${PWD}/add_language.pri)
####################################################################################
#base manager 都做了以下这些事情
####################################################################################
#工程层级介绍:
#add_library在基本的链接层
#add_sdk add_link_library 出现在library层
#add_dependent_library add_dependent_manager 才出现在app层。当然也可以使用link层如果用户喜欢在library层一般不会用dependent只用link。
#工程管理层级上是递进关系。在二进制上他们是互相兼容的,平行关系。
#################################################################
#定义外部函数
#################################################################
#基本的,添加依赖
defineTest(add_dependent_library) {
libname = $$1
isEmpty(libname): return (0)
contains(TEMPLATE, app):add_dependent_library_$${libname}()
else:contains(TEMPLATE, lib):add_link_library_$${libname}()
else:add_link_library_$${libname}()
return (1)
}
#################################################################
#这是一个强大的函数
#调用这一个函数就可以调用add_library_XXX.pri里实现的函数
#################################################################
defineTest(add_dependent_manager){
libname = $$1
#这里出现了一个bug如果输入为空本来设置为Template的可是竟然不为空Template pri也会加入。现在返回就又好了。
isEmpty(libname):return(0)
!equals(TARGET_NAME, $${libname}):
exists($${ADD_BASE_MANAGER_PRI_PWD}/../app-lib/add_library_$${libname}.pri){
include ($${ADD_BASE_MANAGER_PRI_PWD}/../app-lib/add_library_$${libname}.pri)
contains(TEMPLATE, app):add_dependent_library_$${libname}()
else:contains(TEMPLATE, lib):add_link_library_$${libname}()
else:add_link_library_$${libname}()
}
return (1)
}
#开启app工程
defineTest(add_app_project) {
#add base manager对App的处理很少App通过函数基本上能解决所有的事情
#macOS下必须开开bundle
contains(QSYS_PRIVATE, macOS){
CONFIG += app_bundle
}
#直到现在,还没有碰到需要静态链接的场合。
#如果需要,用户可以自行设定。
export(CONFIG)
export(DEFINES)
return (1)
}
#开启lib工程
defineTest(add_lib_project) {
##base manager 对lib的处理很重要
##区分了在不同目标下Qt library的不同形态其实就是要求lib工程和Qt library保持一样的状态。
##尤其在windows平台下还提供了LIB_STATIC_LIBRARY 和 LIB_LIBRARY两个宏的支持
##帮助用户区分lib的状态。
##注意在app下永远没有dll或者static字样只有lib有
##win platform: some target, special lib lib_bundle staticlib
##only deal dynamic is ok, static all in headers dealing.
##define macro before header.
#专门为lib工程设置
contains(QSYS_PRIVATE, Win32|Windows|Win64) {
#Qt is static by mingw32 building
mingw {
#on my computer , Qt library are all static library?
#create static lib (important, only occured at builder pro)
#CONFIG += staticlib
#在add_base_header里设置
#DEFINES += LIB_STATIC_LIBRARY
#在我电脑上编译别的lib mingw下是dll格式的。
CONFIG += dll
DEFINES += LIB_LIBRARY
#mingw编译为静态有原因动态库可以编译成功但是无法链接成功。
message(Build $${TARGET} LIB_LIBRARY is defined. build)
} else {
#create dynamic lib (important, only occured at builder pro)
CONFIG += dll
#no other one deal this, define it here, right here.
DEFINES += LIB_LIBRARY
message(Build $${TARGET} LIB_LIBRARY is defined. build)
}
#*nux platform: no macro
} else {
contains(QSYS_PRIVATE, macOS) {
CONFIG += dll
#macOS下必须开开bundle
CONFIG += lib_bundle
} else:contains(QSYS_PRIVATE, iOS|iOSSimulator) {
CONFIG += static
} else {
##default build dll
CONFIG += dll
#*nix no need this macro
#DEFINES += LIB_LIBRARY
}
}
#CONFIG += build_pass
build_pass:CONFIG(debug, debug|release) {
#troublesome
#win32: TARGET = $$join(TARGET,,,d)
}
#lib 必须创建prl
#create sdk need
CONFIG += create_prl
#debug版本和release版本的所有的不同。
#Lib的TARGET在两个版本上有区别通过TARGET = add_decorate_target($$TARGET)可以解决。
#App的TARGET在两个版本上名字没有区别。
export(CONFIG)
export(DEFINES)
return (1)
}
#获取target的确切的名字
#区分debug和release用的。
#输入target_name 为空则默认为TARGET
#输出target_name?x
#这个变量用来保存原生的target name
TARGET_NAME = $$TARGET
TARGET_DECORATE_NAME = $$TARGET_NAME
#获取sdk name
#修饰TARGET _d _debug
#保证修饰
defineReplace(add_decorate_target_name){
#isEmpty(1):error(add_decorate_target_name(target_name) need one argument)
target_name = $$TARGET_NAME
!isEmpty(1):target_name = $$1
ret = $${target_name}
contains(BUILD, Debug) {
mac:ret = $${ret}_debug
win32:ret = $${ret}d
}
return ($$ret)
}
#保证还原
defineReplace(add_target_name){
return ($$TARGET_NAME)
}
#修饰
defineTest(add_decorate_target){
#isEmpty(1):error(add_decorate_target(target_name) need one argument)
target_name = $$TARGET_NAME
!isEmpty(1):target_name = $$1
ret = $$add_decorate_target_name($${target_name})
TARGET_DECORATE_NAME = $$ret
export(TARGET_DECORATE_NAME)
TARGET = $$ret
export(TARGET)
return (1)
}
#还原
defineTest(add_target){
TARGET_DECORATE_NAME = $$TARGET_NAME
export(TARGET_DECORATE_NAME)
TARGET = $$TARGET_NAME
export(TARGET)
return (1)
}
#设置模板名字
TEMPLATE_PRIVATE = $$TEMPLATE
defineTest(add_template){
#isEmpty(1):error(add_template(template_name) need one argument)
template_name = $$1
isEmpty(1):template_name = $$TEMPLATE
TEMPLATE_PRIVATE = $$template_name
export(TEMPLATE_PRIVATE)
return(1)
}
#添加源文件
defineTest(add_sources){
isEmpty(1):error(add_sources(source_name) need one argument)
source_name = $$1
SOURCES += $$source_name
export(SOURCES)
return(1)
}
#添加头文件
defineTest(add_headers) {
headername = $$1
isEmpty(1)|!isEmpty(2): error("add_headers(headername) requires one argument")
command = $${headername}
#message ($$command)
HEADERS += $${command}
export(HEADERS)
return (1)
}
defineTest(add_defines) {
defname = $$1
isEmpty(1)|!isEmpty(2): error("add_defines(defname) requires one argument")
command = $${defname}
#message ($$command)
DEFINES += $${command}
export(DEFINES)
return (1)
}
defineTest(add_post_link){
command = $$1
isEmpty(command):return(0)
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
QMAKE_POST_LINK += $$command
export(QMAKE_POST_LINK)
return (1)
}
defineTest(add_pre_link){
command = $$1
isEmpty(command):return(0)
!isEmpty(QMAKE_PRE_LINK):QMAKE_PRE_LINK += $$CMD_SEP
QMAKE_PRE_LINK += $$command
export(QMAKE_PRE_LINK)
return (1)
}
#内部默认 $$PWD
APP_SOURCE_PWD =
#内部默认 $$DESTDIR
APP_BUILD_DESTDIR =
#内部默认 $$TARGET_NAME $$libname
APP_PROJECT_NAME =
#这个值为什么初始化是空的呢?
QMAKE_PROJECT_NAME = $$TARGET
#这个目录用于读取sdk头文件进行发布
#这个目录必须设置
#如果调用这个函数的文件所在不是在源代码目录下,比如$${PWD}/../src可以通过这里修正
defineTest(add_source_dir){
APP_SOURCE_PWD = $$1
export(APP_SOURCE_PWD)
return (1)
}
#这个目录用于读取sdk库文件进行发布
#这个目录可选设置。
#destdir所在的位置如果不是准确的工程编译根目录用这个修正一下。src/$${DESTDIR}等
defineTest(add_build_dir){
APP_BUILD_DESTDIR = $$1
export(APP_BUILD_DESTDIR)
return (1)
}
#如果工程名字和目标名字不一样,需要修正。
#比如TARGET = ABC 工程名 = EFG[.pro] 就要调用这个函数设置工程名为EFG。
#默认为未修饰的TARGET名也就是初始TARGET名
defineTest(add_project_name){
APP_PROJECT_NAME = $$1
export(APP_PROJECT_NAME)
QMAKE_PROJECT_NAME = $$1
export(QMAKE_PROJECT_NAME)
return (1)
}
#################################################################
##definition and configration
##need QSYS
#################################################################
#这个编译build pane比较简洁
#CONFIG += silent
#multi-link v2.0对这个功能有良好的支持。
#CONFIG += debug_and_release
#编译全部
#CONFIG += build_all
#修饰TARGET LIB必要 APP可选 only once
#此处提醒用户:你肯定不愿意手动调用。
#格式
#debug版本_debug d无论app lib还是链接的lib发布的lib和发布的sdk都是这样的。
#release版本没有后缀。
#用户在链接库的时候需要分类处理debug版本和release版本准备哪种版本才能链接哪种版本。
#
add_decorate_target($${TARGET_NAME})
contains(TEMPLATE, app) {
#启动app工程 APP必要
add_app_project()
} else: contains(TEMPLATE, lib) {
#启动lib工程 LIB必要
add_lib_project()
}
#################################################################
#公共的基础header.pri这个的作用在于不需要区分app和lib的设置都在这里面。
#包含基本的编译设置 qqt_header.pri里的设置更详细
#这个header在所有的函数包含完以后添加因为这个header其实也依赖Multi-link技术。
#################################################################
include ($${PWD}/add_base_header.pri)
#message($$TARGET config $$CONFIG)
#message($$TARGET define $$DEFINES)
#message($$TARGET pre link $$QMAKE_PRE_LINK)
#message($$TARGET post link $$QMAKE_POST_LINK)

View File

@ -1,172 +0,0 @@
#-------------------------------------------------------------
#add_deploy.pri
#提供app发布函数只是app工程使用
#-------------------------------------------------------------
#Multi-link技术 add_deploy部分只能应用于Qt5Qt4没有windeployqt程序如果用户为Qt4编译了windeployqt那么也可以用于Qt4。
################################################################################
#内部用函数
#获取命令
################################################################################
ADD_DEPLOY_PRI_PWD = $${PWD}
##########################################
#app的发布函数命令
##########################################
#终端程序依赖Qt的必须修复Qt组件的rpath引用或者加入rpath并且Qt环境要加入路径。
#实用价值不高所以在app_base_manager里面我默认开启了app_bundle.
#如果不发布appbuild位置的app也不能运行。单独给build一个fix吗还是算了吧。
defineReplace(get_add_deploy_on_mac) {
#fix app in build pwd
contains(CONFIG, app_bundle) {
#这里或许需要加macdeployqt? build pwd 需要
command += macdeployqt $${APP_BUILD_PWD}/$${TARGET}.app -verbose=1 $$CMD_SEP
lessThan(QT_MAJOR_VERSION, 5){
command += chmod +x $${ADD_DEPLOY_PRI_PWD}/mac_deploy_qt4.sh $$CMD_SEP
command += $${ADD_DEPLOY_PRI_PWD}/mac_deploy_qt4.sh $${APP_BUILD_PWD}/$${TARGET}.app/Contents/MacOS/$${TARGET} $$CMD_SEP
}
} else {
#这里或许需要加macdeployqt? build pwd 不需要
command += macdeployqt $${APP_BUILD_PWD}/$${TARGET} -verbose=1 $$CMD_SEP
lessThan(QT_MAJOR_VERSION, 5){
command += chmod +x $${ADD_DEPLOY_PRI_PWD}/mac_deploy_qt4.sh $$CMD_SEP
command += $${ADD_DEPLOY_PRI_PWD}/mac_deploy_qt4.sh $${APP_BUILD_PWD}/$${TARGET} $$CMD_SEP
}
}
#deploy pwd
command += $$MK_DIR $${APP_DEPLOY_PWD} $$CMD_SEP
contains(CONFIG, app_bundle) {
command += $$RM_DIR $${APP_DEPLOY_PWD}/$${TARGET}.app $$CMD_SEP
command += $$COPY_DIR $${APP_BUILD_PWD}/$${TARGET}.app $${APP_DEPLOY_PWD}/$${TARGET}.app $$CMD_SEP
#这里或许需要加macdeployqt? deploy pwd 需要
command += macdeployqt $${APP_DEPLOY_PWD}/$${TARGET}.app -verbose=1 $$CMD_SEP
lessThan(QT_MAJOR_VERSION, 5){
command += chmod +x $${ADD_DEPLOY_PRI_PWD}/mac_deploy_qt4.sh $$CMD_SEP
command += $${ADD_DEPLOY_PRI_PWD}/mac_deploy_qt4.sh $${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/MacOS/$${TARGET} $$CMD_SEP
}
} else {
command += $$RM_DIR $${APP_DEPLOY_PWD}/$${TARGET} $$CMD_SEP
command += $$COPY_DIR $${APP_BUILD_PWD}/$${TARGET} $${APP_DEPLOY_PWD}/$${TARGET} $$CMD_SEP
#这里或许需要加macdeployqt? deploy pwd 需要
command += macdeployqt $${APP_DEPLOY_PWD}/$${TARGET} -verbose=1 $$CMD_SEP
lessThan(QT_MAJOR_VERSION, 5){
command += chmod +x $${ADD_DEPLOY_PRI_PWD}/mac_deploy_qt4.sh $$CMD_SEP
command += $${ADD_DEPLOY_PRI_PWD}/mac_deploy_qt4.sh $${APP_DEPLOY_PWD}/$${TARGET} $$CMD_SEP
}
}
command += echo .
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_on_windows) {
#need QQT_BUILD_PWD
command =
command += $$MK_DIR $${APP_DEPLOY_PWD} $$CMD_SEP
command += $$RM $${APP_DEPLOY_PWD}\\$${TARGET}.exe $$CMD_SEP
command += $$COPY $${APP_BUILD_PWD}\\$${TARGET}.exe $${APP_DEPLOY_PWD}\\$${TARGET}.exe
#msvc 在deploy lib上有点区别mingw不发布依赖lib在编译区也能运行msvc却不能。
#在运行区都必须发布依赖lib。
#add_deploy 仅仅发布app不管依赖的lib。
#all windows need deploy release version?
equals(BUILD, Debug) {
command += $$CMD_SEP
#command += windeployqt $${APP_DEPLOY_PWD}\\$${TARGET}.exe --debug -verbose=1
msvc{
command += windeployqt $${APP_DEPLOY_PWD}\\$${TARGET}.exe --debug -verbose=1
} else {
#过去you'yi'dua有一段时间这里必须发布release版本mingw的才能通过现在debug的才能通过
#必须release。编译dll可以链接不成功。静态编译后app必须发布release。
#注意链接库较多时候windeployqt发布不全。dll用这些库app不用windeployqt不发布。在add_deploy_library里修复。
command += windeployqt $${APP_DEPLOY_PWD}\\$${TARGET}.exe --debug -verbose=1
}
} else: equals(BUILD, Release) {
command += $$CMD_SEP
#command += windeployqt $${APP_DEPLOY_PWD}\\$${TARGET}.exe --release -verbose=1
command += windeployqt $${APP_DEPLOY_PWD}\\$${TARGET}.exe --release -verbose=1
}
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_on_linux) {
#need QQT_BUILD_PWD
command =
command += $$MK_DIR $${APP_DEPLOY_PWD} $$CMD_SEP
command += $$RM $${APP_DEPLOY_PWD}/$${TARGET} $$CMD_SEP
command += $$COPY $${APP_BUILD_PWD}/$${TARGET} $${APP_DEPLOY_PWD}/$${TARGET}
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_on_android) {
#need QQT_BUILD_PWD
command =
command += $$MK_DIR $${APP_DEPLOY_PWD} $$CMD_SEP
command += $$RM $${APP_DEPLOY_PWD}/$${TARGET} $$CMD_SEP
command += $$COPY $${APP_BUILD_PWD}/$${TARGET} $${APP_DEPLOY_PWD}/$${TARGET}
#message($$command)
return ($$command)
}
################################################################################
#外部用函数
################################################################################
defineTest(add_deploy) {
#起始位置 编译位置 中间目标位置
APP_BUILD_PWD=$${DESTDIR}
isEmpty(APP_BUILD_PWD):APP_BUILD_PWD=.
#set app deploy pwd
#APP_DEPLOY_PWD is here.
APP_DEPLOY_PWD = $${APP_DEPLOY_ROOT}/$${TARGET_NAME}/$${QSYS_STD_DIR}
#不仅仅发布目标为Windows的时候才需要改变路径
#开发机为Windows就必须改变。
#contains(QKIT_PRIVATE, WIN32||WIN64) {
equals(QMAKE_HOST.os, Windows) {
APP_DEPLOY_PWD~=s,/,\\,g
}
message($${TARGET} is deployed to $$APP_DEPLOY_PWD)
#如果 配置文件里 没有配置 APP_DEPLOY_ROOT 那么返回,不拷贝发布任何应用
#不会走到
isEmpty(APP_DEPLOY_ROOT) {
message("$${TARGET} hasn't deployed any app files")
return(0)
}
##4.8 qmake arm32 return() 函数无效
!isEmpty(APP_DEPLOY_ROOT) {
message("$${TARGET} has deployed some app files")
}
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
contains(QSYS_PRIVATE, Win32|Windows||Win64) {
#发布windows版本
QMAKE_POST_LINK += $$get_add_deploy_on_windows()
} else: contains(QSYS_PRIVATE, macOS) {
#发布苹果版本iOS版本也是这个
QMAKE_POST_LINK += $$get_add_deploy_on_mac()
} else: contains(QSYS_PRIVATE, Android||AndroidX86) {
#Qt做了
#ANDROID_EXTRA_LIBS += $$get_add_deploy_on_android()
} else {
#发布linux、e-linux这个是一样的。
QMAKE_POST_LINK += $$get_add_deploy_on_linux()
}
export(QMAKE_POST_LINK)
return (1)
}

View File

@ -1,106 +0,0 @@
#---------------------------------------------------------------------
#add_deploy_config.pri
#用于发布app的配置文件。只是app工程使用
#这个目录一般在源代码目录里
#add_deploy_config(<config_path>, <dest_path>)
#add_deploy_config_bundle(<config_path>, <dest_path>) #这个mac下bundle一定会发布到bundle里面
#---------------------------------------------------------------------
################################################################################
#内部用函数
################################################################################
defineReplace(get_add_deploy_config) {
isEmpty(1): error("get_add_deploy_config(app_config_pwd, app_target_pwd) requires at least one argument")
!isEmpty(3): error("get_add_deploy_config(app_config_pwd, app_target_pwd) requires at most two argument")
source_config_path = $$1
target_config_path = $$2
command =
#目标路径不为空,则拷贝配置文件过去。
!isEmpty(target_config_path) {
command += $$MK_DIR $${target_config_path} $$CMD_SEP
command += $$COPY_DIR $${source_config_path} $${target_config_path} $$CMD_SEP
} else {
contains(QMAKE_HOST.os, Darwin):contains(CONFIG, app_bundle){
target_config_path=$${APP_BUILD_PWD}/$${TARGET}.app/Contents/MacOS
command += $$COPY_DIR $${source_config_path} $${target_config_path} $$CMD_SEP
target_config_path=$${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/MacOS
command += $$COPY_DIR $${source_config_path} $${target_config_path} $$CMD_SEP
} else {
target_config_path=$${APP_BUILD_PWD}
command += $$COPY_DIR $${source_config_path} $${target_config_path} $$CMD_SEP
target_config_path=$${APP_DEPLOY_PWD}
command += $$COPY_DIR $${source_config_path} $${target_config_path} $$CMD_SEP
}
}
command += echo .
#message($$command)
return ($$command)
}
################################################################################
#外部用函数
################################################################################
defineTest(add_deploy_config) {
isEmpty(1): error("add_deploy_config(app_config_pwd, app_target_pwd) requires at least one argument")
!isEmpty(3): error("add_deploy_config(app_config_pwd, app_target_pwd) requires at most two argument")
APP_CONFIG_PWD = $$1
APP_TARGET_PWD = $$2
isEmpty(APP_TARGET_PWD):APP_TARGET_PWD =
equals(QMAKE_HOST.os, Windows) {
APP_CONFIG_PWD~=s,/,\\,g
APP_TARGET_PWD~=s,/,\\,g
}
#起始位置 编译位置 中间目标位置
APP_BUILD_PWD=$${DESTDIR}
isEmpty(APP_BUILD_PWD):APP_BUILD_PWD=.
#set app deploy pwd
#APP_DEPLOY_PWD is here.
#lib project会发布配置文件吗
APP_DEPLOY_PWD = $${APP_DEPLOY_ROOT}/$${TARGET_NAME}/$${QSYS_STD_DIR}
#不仅仅发布目标为Windows的时候才需要改变路径
#开发机为Windows就必须改变。
#contains(QKIT_PRIVATE, WIN32||WIN64) {
equals(QMAKE_HOST.os, Windows) {
APP_DEPLOY_PWD~=s,/,\\,g
}
#如果 TARGET 没有配置 APP_CONFIG_PWD 那么返回,不拷贝任何配置
#qmake 或逻辑为 | 或者 ||
isEmpty(APP_CONFIG_PWD):isEmpty(APP_DEPLOY_PWD) {
message("$${TARGET} hasn't deployed any config files")
return(0)
}
##4.8 qmake arm32 return() 函数无效
##qmake 与逻辑为 :
!isEmpty(APP_CONFIG_PWD):!isEmpty(APP_DEPLOY_PWD) {
message("$${TARGET} has deployed some config files")
}
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
contains(QSYS_PRIVATE, Win32|Windows||Win64) {
QMAKE_POST_LINK += $$get_add_deploy_config("$${APP_CONFIG_PWD}\\*", $${APP_TARGET_PWD})
} else: contains(QSYS_PRIVATE, Android||AndroidX86) {
#分为Host为Windows和类Unix两种情况。
#Android下使用qrc无法发布配置文件。
equals(QMAKE_HOST.os, Windows){
} else {
}
} else {
#macOS linux都走这里
QMAKE_POST_LINK += $$get_add_deploy_config("$${APP_CONFIG_PWD}/*", $${APP_TARGET_PWD})
}
export(QMAKE_POST_LINK)
return (1)
}

View File

@ -1,566 +0,0 @@
#-------------------------------------------------------------
#add_deploy_library.pri
#提供app发布library函数只是app工程使用
#-------------------------------------------------------------
#add_deploy_library
#add_deploy_library_bundle
#add_deploy_libraryes
#has_deployed_library
################################################################################
#内部用函数
#获取命令
################################################################################
ADD_DEPLOY_LIBRARY_PRI_PWD = $${PWD}
###############################################################
#app的发布library命令函数
###############################################################
#app发布lib到自己的目标里必须先发布app如果没有先发布app会出错macOS
#lib发布lib没有的事情
#解释过去从sdk到build到deploy现在从sdk到build从sdk到deploy
defineReplace(get_add_deploy_library_on_mac) {
isEmpty(1): error("get_add_deploy_library_on_mac(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("get_add_deploy_library_on_mac(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
command =
contains(CONFIG, app_bundle) {
command += $$MK_DIR $${APP_BUILD_PWD}/$${TARGET}.app/Contents/Frameworks &&
}
#拷贝sdk到build
contains(CONFIG, app_bundle) {
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_BUILD_PWD}/$${TARGET}.app/Contents/Frameworks &&
} else {
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_BUILD_PWD} &&
}
#一条代码总是拷贝实例
#command += chmod +x $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cur_path.sh $$CMD_SEP
#command += . $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cur_path.sh $$CMD_SEP
#command += $$CD $${APP_BUILD_PWD}/$${TARGET}.app/Contents/Frameworks $$CMD_SEP
#command += $$MK_DIR $${libname}.framework $$CMD_SEP
#command += $$CD $${libname}.framework $$CMD_SEP
#command += $$get_add_mac_sdk($${libname}, $${librealname}, $${libmajorver}) $$CMD_SEP
#command += $$CD .. $$CMD_SEP
#command += chmod +x $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cd_path.sh $$CMD_SEP
#command += . $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cd_path.sh $$CMD_SEP
#更改app bundle链接Lib的位置。
contains(CONFIG, app_bundle) {
command += install_name_tool -change @loader_path/lib$${librealname}.dylib \
@rpath/lib$${librealname}.dylib \
$${APP_BUILD_PWD}/$${TARGET}.app/Contents/MacOS/$${TARGET} &&
} else {
command += install_name_tool -change @loader_path/lib$${librealname}.dylib \
@executable_path/lib$${librealname}.dylib \
$${APP_BUILD_PWD}/$${TARGET} &&
}
contains(CONFIG, app_bundle) {
command += $$MK_DIR $${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/Frameworks &&
}
#拷贝sdk到build
contains(CONFIG, app_bundle) {
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/Frameworks &&
} else {
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_DEPLOY_PWD} &&
}
#一条代码总是拷贝实例
#command += chmod +x $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cur_path.sh $$CMD_SEP
#command += . $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cur_path.sh $$CMD_SEP
#command += $$CD $${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/Frameworks $$CMD_SEP
#command += $$MK_DIR $${libname}.framework $$CMD_SEP
#command += $$CD $${libname}.framework $$CMD_SEP
#command += $$get_add_mac_sdk($${libname}, $${librealname}, $${libmajorver}) $$CMD_SEP
#command += $$CD .. $$CMD_SEP
#command += chmod +x $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cd_path.sh $$CMD_SEP
#command += . $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cd_path.sh $$CMD_SEP
#更改app bundle链接Lib的位置。
contains(CONFIG, app_bundle) {
command += install_name_tool -change @loader_path/lib$${librealname}.dylib \
@rpath/lib$${librealname}.dylib \
$${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/MacOS/$${TARGET} &&
} else {
command += install_name_tool -change @loader_path/lib$${librealname}.dylib \
@executable_path/lib$${librealname}.dylib \
$${APP_DEPLOY_PWD}/$${TARGET} &&
}
command += echo . #app deploy library $$librealname progressed.
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_library_bundle_on_mac) {
isEmpty(1): error("get_add_deploy_library_bundle_on_mac(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("get_add_deploy_library_bundle_on_mac(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
#这里有个bug用户删除了SDK以后App qmake阶段读取这个SDK结果读到这个位置为0...bug其实不应该为0应该为用户设置的SDK版本号。
#解决方法一忽略第一遍编译。也就是什么SDK都没有的时候编译一遍lib生成了SDK可是不管他再qmake后编译一遍。能解决。
libmajorver =
libmajorver = $$system(readlink $${LIB_LIB_PWD}/$${libname}.framework/Versions/Current)
#这里是以防万一lib不存在 但是不能退出如果是subdirs包含Library的工程就不能退出。
isEmpty(libmajorver){
libmajorver=0
message($$TARGET deploy $$libname"," unexisted lib.)
return ("echo unexisted lib $$libname .")
}
command =
contains(CONFIG, app_bundle) {
command += $$MK_DIR $${APP_BUILD_PWD}/$${TARGET}.app/Contents/Frameworks &&
}
#拷贝sdk到build
contains(CONFIG, app_bundle) {
command += $$COPY_DIR $${LIB_LIB_PWD}/$${libname}.framework $${APP_BUILD_PWD}/$${TARGET}.app/Contents/Frameworks &&
} else {
command += $$COPY_DIR $${LIB_LIB_PWD}/$${libname}.framework $${APP_BUILD_PWD} &&
}
#一条代码总是拷贝实例
#command += chmod +x $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cur_path.sh $$CMD_SEP
#command += . $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cur_path.sh $$CMD_SEP
#command += $$CD $${APP_BUILD_PWD}/$${TARGET}.app/Contents/Frameworks $$CMD_SEP
#command += $$MK_DIR $${libname}.framework $$CMD_SEP
#command += $$CD $${libname}.framework $$CMD_SEP
#command += $$get_add_mac_sdk($${libname}, $${librealname}, $${libmajorver}) $$CMD_SEP
#command += $$CD .. $$CMD_SEP
#command += chmod +x $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cd_path.sh $$CMD_SEP
#command += . $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cd_path.sh $$CMD_SEP
#更改app bundle链接Lib的位置。
contains(CONFIG, app_bundle) {
command += install_name_tool -change $${libname}.framework/Versions/$${libmajorver}/$${libname} \
@rpath/$${libname}.framework/Versions/$${libmajorver}/$${librealname} \
$${APP_BUILD_PWD}/$${TARGET}.app/Contents/MacOS/$${TARGET} &&
} else {
command += install_name_tool -change $${libname}.framework/Versions/$${libmajorver}/$${libname} \
@executable_path/$${libname}.framework/Versions/$${libmajorver}/$${librealname} \
$${APP_BUILD_PWD}/$${TARGET} &&
}
contains(CONFIG, app_bundle) {
command += $$MK_DIR $${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/Frameworks &&
}
#拷贝sdk到 deploy
contains(CONFIG, app_bundle) {
command += $$COPY_DIR $${LIB_LIB_PWD}/$${libname}.framework $${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/Frameworks &&
} else {
command += $$COPY_DIR $${LIB_LIB_PWD}/$${libname}.framework $${APP_DEPLOY_PWD} &&
}
#一条代码总是拷贝实例
#command += chmod +x $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cur_path.sh $$CMD_SEP
#command += . $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cur_path.sh $$CMD_SEP
#command += $$CD $${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/Frameworks $$CMD_SEP
#command += $$MK_DIR $${libname}.framework $$CMD_SEP
#command += $$CD $${libname}.framework $$CMD_SEP
#command += $$get_add_mac_sdk($${libname}, $${librealname}, $${libmajorver}) $$CMD_SEP
#command += $$CD .. $$CMD_SEP
#command += chmod +x $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cd_path.sh $$CMD_SEP
#command += . $${ADD_DEPLOY_LIBRARY_PRI_PWD}/linux_cd_path.sh $$CMD_SEP
#更改app bundle链接Lib的位置。
contains(CONFIG, app_bundle) {
command += install_name_tool -change $${libname}.framework/Versions/$${libmajorver}/$${libname} \
@rpath/$${libname}.framework/Versions/$${libmajorver}/$${librealname} \
$${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/MacOS/$${TARGET} &&
} else {
command += install_name_tool -change $${libname}.framework/Versions/$${libmajorver}/$${libname} \
@executable_path/$${libname}.framework/Versions/$${libmajorver}/$${librealname} \
$${APP_DEPLOY_PWD}/$${TARGET} &&
}
command += echo . #app deploy library $$librealname progressed.
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_library_on_windows) {
isEmpty(1): error("get_add_deploy_library_on_windows(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("get_add_deploy_library_on_windows(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
DEPLOYTYPE =
equals(BUILD, Debug):DEPLOYTYPE = --debug
else:equals(BUILD, Release):DEPLOYTYPE = --release
else:DEPLOYTYPE = --release
command =
command += $$RM $${APP_BUILD_PWD}\\*$${librealname}.* $$CMD_SEP
#build的地方调试需要.lib等其他文件
command += $$COPY_DIR $${LIB_LIB_PWD}\\*$${librealname}.* $${APP_BUILD_PWD} $$CMD_SEP
#拷贝sdk到build
command += $$COPY_DIR $${LIB_BIN_PWD}\\$${librealname}.* $${APP_BUILD_PWD} $$CMD_SEP
command += $$RM $${APP_DEPLOY_PWD}\\*$${librealname}.* $$CMD_SEP
#deploy的地方不需要.lib等文件
#拷贝sdk到deploy
command += $$COPY_DIR $${LIB_BIN_PWD}\\$${librealname}.* $${APP_DEPLOY_PWD} $$CMD_SEP
#经过调试发现如果DLL引用了Qt库App却没有引用windeployqt不会发布那些库在这里发布。
command += windeployqt $${APP_DEPLOY_PWD}\\$${librealname}.dll $${DEPLOYTYPE} -verbose=1 $$CMD_SEP
command += echo . #app deploy library $$librealname progressed.
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_library_on_linux) {
isEmpty(1): error("get_add_deploy_library_on_windows(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("get_add_deploy_library_on_windows(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
command =
command += $$RM $${APP_BUILD_PWD}/lib$${librealname}.so* $$CMD_SEP
command += $$COPY_DIR $${LIB_LIB_PWD}/lib$${librealname}.so* $${APP_BUILD_PWD} $$CMD_SEP
command += $$RM $${APP_DEPLOY_PWD}/lib$${librealname}.so* $$CMD_SEP
command += $$COPY_DIR $${LIB_LIB_PWD}/lib$${librealname}.so* $${APP_DEPLOY_PWD} $$CMD_SEP
command += echo . #app deploy library $$librealname progressed.
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_library_on_android) {
isEmpty(1): error("get_add_deploy_library_on_windows(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("get_add_deploy_library_on_windows(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
LIB_ANDROID_PATH = $${LIB_LIB_PWD}/lib$${librealname}.so
equals(QMAKE_HOST.os, Windows) {
LIB_ANDROID_PATH~=s,/,\\,g
}
message(Android target $${ANDROID_TARGET_ARCH})
message(Android $${TARGET} deploy library $${LIB_ANDROID_PATH})
command =
command += $${LIB_ANDROID_PATH}
#message($$command)
return ($$command)
}
###############################################################
#app的发布librarys命令函数
###############################################################
#发布所有的library
defineReplace(get_add_deploy_libraryes_on_mac) {
command =
contains(CONFIG, app_bundle) {
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_BUILD_PWD}/$${TARGET}.app/Contents/Frameworks $$CMD_SEP
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_DEPLOY_PWD}/$${TARGET}.app/Contents/Frameworks $$CMD_SEP
} else {
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_BUILD_PWD} $$CMD_SEP
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_DEPLOY_PWD} $$CMD_SEP
}
command += echo . #app deploy library $$librealname progressed.
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_libraryes_on_windows) {
command =
#build 需要.lib .exp等文件
command += $$COPY_DIR $${LIB_LIB_PWD}\\* $${APP_BUILD_PWD} $$CMD_SEP
#拷贝sdk到build
command += $$COPY_DIR $${LIB_BIN_PWD}\\* $${APP_BUILD_PWD} $$CMD_SEP
#deploy不需要.lib .exp等文件
#拷贝sdk到deploy
command += $$COPY_DIR $${LIB_BIN_PWD}\\* $${APP_DEPLOY_PWD} $$CMD_SEP
command += echo . #app deploy library $$librealname progressed.
#message($$command)
return ($$command)
}
defineReplace(get_add_deploy_libraryes_on_linux) {
command =
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_BUILD_PWD} $$CMD_SEP
command += $$COPY_DIR $${LIB_LIB_PWD}/* $${APP_DEPLOY_PWD} $$CMD_SEP
command += echo . #app deploy library $$librealname progressed.
#message($$command)
return ($$command)
}
#这个?
defineReplace(get_add_deploy_libraryes_on_android) {
isEmpty(1): error("get_add_deploy_libraryes_on_android(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("get_add_deploy_libraryes_on_android(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
LIB_ANDROID_PATH = $${LIB_LIB_PWD}/lib$${librealname}.so
equals(QMAKE_HOST.os, Windows) {
LIB_ANDROID_PATH~=s,/,\\,g
}
message(Android target $${ANDROID_TARGET_ARCH})
message(Android $${TARGET} deploy library $${LIB_ANDROID_PATH})
command =
command += $${LIB_ANDROID_PATH}
#message($$command)
return ($$command)
}
################################################################################
#外部用函数
################################################################################
defineTest(add_deploy_library) {
isEmpty(1): error("add_deploy_library(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("add_deploy_library(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
#起始位置 编译位置 中间目标位置
APP_BUILD_PWD=$${DESTDIR}
isEmpty(APP_BUILD_PWD):APP_BUILD_PWD=.
#set app deploy pwd
#APP_DEPLOY_PWD is here.
APP_DEPLOY_PWD = $${APP_DEPLOY_ROOT}/$${TARGET_NAME}/$${QSYS_STD_DIR}
#不仅仅发布目标为Windows的时候才需要改变路径
#开发机为Windows就必须改变。
#contains(QKIT_PRIVATE, WIN32||WIN64) {
equals(QMAKE_HOST.os, Windows) {
APP_DEPLOY_PWD~=s,/,\\,g
}
LIB_STD_DIR =
LIB_STD_DIR = $${libgroupname}/$${QSYS_STD_DIR}
LIB_SDK_PWD = $${LIB_SDK_ROOT}/$${LIB_STD_DIR}
LIB_BIN_PWD = $${LIB_SDK_PWD}/bin
LIB_LIB_PWD = $${LIB_SDK_PWD}/lib
equals(QMAKE_HOST.os, Windows) {
LIB_STD_DIR~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
LIB_BIN_PWD~=s,/,\\,g
LIB_LIB_PWD~=s,/,\\,g
}
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
contains(QSYS_PRIVATE, Win32|Windows||Win64) {
#发布windows版本
QMAKE_POST_LINK += $$get_add_deploy_library_on_windows($${libgroupname}, $${libname}, $${librealname})
} else: contains(QSYS_PRIVATE, macOS) {
#发布苹果版本iOS版本也是这个
QMAKE_POST_LINK += $$get_add_deploy_library_on_mac($${libgroupname}, $${libname}, $${librealname})
} else: contains(QSYS_PRIVATE, Android||AndroidX86) {
ANDROID_EXTRA_LIBS += $$get_add_deploy_library_on_android($${libgroupname}, $${libname}, $${librealname})
} else {
##发布linux、e-linux这个是一样的。GG
QMAKE_POST_LINK += $$get_add_deploy_library_on_linux($${libgroupname}, $${libname}, $${librealname})
}
export(QMAKE_POST_LINK)
message("$${TARGET} has deployed library $${libname} ")
return (1)
}
defineTest(add_deploy_library_bundle) {
isEmpty(1): error("add_deploy_library_bundle(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("add_deploy_library_bundle(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
#起始位置 编译位置 中间目标位置
APP_BUILD_PWD=$${DESTDIR}
isEmpty(APP_BUILD_PWD):APP_BUILD_PWD=.
#set app deploy pwd
#APP_DEPLOY_PWD is here.
APP_DEPLOY_PWD = $${APP_DEPLOY_ROOT}/$${TARGET_NAME}/$${QSYS_STD_DIR}
#不仅仅发布目标为Windows的时候才需要改变路径
#开发机为Windows就必须改变。
#contains(QKIT_PRIVATE, WIN32||WIN64) {
equals(QMAKE_HOST.os, Windows) {
APP_DEPLOY_PWD~=s,/,\\,g
}
LIB_STD_DIR =
LIB_STD_DIR = $${libgroupname}/$${QSYS_STD_DIR}
LIB_SDK_PWD = $${LIB_SDK_ROOT}/$${LIB_STD_DIR}
LIB_BIN_PWD = $${LIB_SDK_PWD}/bin
LIB_LIB_PWD = $${LIB_SDK_PWD}/lib
equals(QMAKE_HOST.os, Windows) {
LIB_STD_DIR~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
LIB_BIN_PWD~=s,/,\\,g
LIB_LIB_PWD~=s,/,\\,g
}
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
contains(QSYS_PRIVATE, Win32|Windows||Win64) {
#发布windows版本
QMAKE_POST_LINK += $$get_add_deploy_library_on_windows($${libgroupname}, $${libname}, $${librealname})
} else: contains(QSYS_PRIVATE, macOS) {
#发布苹果版本iOS版本也是这个
QMAKE_POST_LINK += $$get_add_deploy_library_bundle_on_mac($${libgroupname}, $${libname}, $${librealname})
} else: contains(QSYS_PRIVATE, Android||AndroidX86) {
ANDROID_EXTRA_LIBS += $$get_add_deploy_library_on_android($${libgroupname}, $${libname}, $${librealname})
} else {
##发布linux、e-linux这个是一样的。GG
QMAKE_POST_LINK += $$get_add_deploy_library_on_linux($${libgroupname}, $${libname}, $${librealname})
}
export(QMAKE_POST_LINK)
message("$${TARGET} has deployed library $${libname}")
return (1)
}
defineTest(add_deploy_libraryes) {
isEmpty(1): error("add_deploy_library(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("add_deploy_library(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
#起始位置 编译位置 中间目标位置
APP_BUILD_PWD=$${DESTDIR}
isEmpty(APP_BUILD_PWD):APP_BUILD_PWD=.
#set app deploy pwd
#APP_DEPLOY_PWD is here.
APP_DEPLOY_PWD = $${APP_DEPLOY_ROOT}/$${TARGET_NAME}/$${QSYS_STD_DIR}
#不仅仅发布目标为Windows的时候才需要改变路径
#开发机为Windows就必须改变。
#contains(QKIT_PRIVATE, WIN32||WIN64) {
equals(QMAKE_HOST.os, Windows) {
APP_DEPLOY_PWD~=s,/,\\,g
}
LIB_STD_DIR =
LIB_STD_DIR = $${libgroupname}/$${QSYS_STD_DIR}
LIB_SDK_PWD = $${LIB_SDK_ROOT}/$${LIB_STD_DIR}
LIB_BIN_PWD = $${LIB_SDK_PWD}/bin
LIB_LIB_PWD = $${LIB_SDK_PWD}/lib
equals(QMAKE_HOST.os, Windows) {
LIB_STD_DIR~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
LIB_BIN_PWD~=s,/,\\,g
LIB_LIB_PWD~=s,/,\\,g
}
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
contains(QSYS_PRIVATE, Win32|Windows||Win64) {
#发布windows版本
QMAKE_POST_LINK += $$get_add_deploy_libraryes_on_windows($${libgroupname}, $${libname}, $${librealname})
} else: contains(QSYS_PRIVATE, macOS) {
#发布苹果版本iOS版本也是这个
QMAKE_POST_LINK += $$get_add_deploy_libraryes_on_mac($${libgroupname}, $${libname}, $${librealname})
} else: contains(QSYS_PRIVATE, Android||AndroidX86) {
ANDROID_EXTRA_LIBS += $$get_add_deploy_libraryes_on_android($${libgroupname}, $${libname}, $${librealname})
} else {
##发布linux、e-linux这个是一样的。GG
QMAKE_POST_LINK += $$get_add_deploy_libraryes_on_linux($${libgroupname}, $${libname}, $${librealname})
}
export(QMAKE_POST_LINK)
message("$${TARGET} has deployed all libraries under $${libgroupname}")
return (1)
}
#判断某个lib是否已经发布
#避免二次发布,拷贝浪费时间。
defineTest(has_deployed_library) {
return(0)
}

View File

@ -1,336 +0,0 @@
#------------------------------------------------------------------
#app_function.pri
#please dont modify this pri
#2017年12月01日14:05:43
#------------------------------------------------------------------
contains(QMAKE_HOST.os,Windows) {
SCRIPT_SUFFIX=bat
CMD_SEP = &
MOVE = move /y
COPY = copy /y
COPY_DIR = xcopy /s /q /y /i /r /h
MK_DIR = mkdir
RM = del /q
CD = cd /d
RM_DIR = rd /s /q
#PATH_SEP=\\
} else:contains(QMAKE_HOST.os, Darwin) {
SCRIPT_SUFFIX=sh
CMD_SEP = &&
MOVE = mv
COPY = cp -f
COPY_DIR = cp -R -L -f -apc
MK_DIR = mkdir -p
RM = rm -f
CD = cd
LN = ln -sfn
RM_DIR = rm -rf
#PATH_SEP=/
} else {
SCRIPT_SUFFIX=sh
CMD_SEP = &&
MOVE = mv
COPY = cp -f
COPY_DIR = cp -rf
MK_DIR = mkdir -p
RM = rm -f
CD = cd
LN = ln -sf
RM_DIR = rm -rf
#PATH_SEP=/
}
################################################
##get command string 这些函数一般内部使用
################################################
defineReplace(get_mkdir) {
filepath = $$1
isEmpty(1): error("get_mkdir(filepath) requires one argument")
command = $${MK_DIR} $${filepath}
#message($${command})
return ($${command})
}
defineReplace(get_errcode) {
cmd_exec = $$1
isEmpty(1): error("get_errcode(command) requires one argument")
contains(QMAKE_HOST.os,Windows) {
command = $${cmd_exec} >nul & echo %errorlevel%
} else {
command = "$${cmd_exec}" 2>/dev/null; echo $?
}
#message($$command)
return ($$command)
}
defineReplace(get_empty_file) {
filename = $$1
isEmpty(1): error("get_empty_file(filename) requires one argument")
command =
equals(QMAKE_HOST.os, Windows) {
command = echo . 2> $${filename}
} else {
command = echo 2> $${filename}
}
return ($$command)
}
defineReplace(get_write_file) {
filename = $$1
variable = $$2
!isEmpty(3): error("get_write_file(name, content) requires two arguments.")
isEmpty(2): error("get_write_file(name, content) requires two arguments.")
command = echo $${variable} >> $${filename}
return ($$command)
}
LINUX_CP_FILES = $${PWD}/linux_cp_files.sh
defineReplace(get_copy_dir_and_file) {
source = $$1
pattern = $$2
target = $$3
!isEmpty(4): error("get_copy_dir_and_file(source, pattern, target) requires three arguments.")
isEmpty(3) : error("get_copy_dir_and_file(source, pattern, target) requires three arguments.")
command =
equals(QMAKE_HOST.os, Windows) {
command = $${COPY_DIR} $${source}\\$${pattern} $${target}
} else {
command = chmod +x $${LINUX_CP_FILES} $${CMD_SEP}
command += $${LINUX_CP_FILES} $${source} $${pattern} $${target}
}
return ($$command)
}
WIN_READ_INI = $${PWD}/win_read_ini.bat
LINUX_READ_INI = $${PWD}/linux_read_ini.sh
defineReplace(get_read_ini_command) {
file_name = $$1
sect_name = $$2
key_name = $$3
!isEmpty(4): error("get_read_ini_command(file, section, key) requires three arguments.")
isEmpty(3) : error("get_read_ini_command(file, section, key) requires three arguments.")
command =
equals(QMAKE_HOST.os, Windows) {
#if use $${PWD}/...directoly this PWD is the refrence pri file path
command = $${WIN_READ_INI} %file_name% %sect_name% %key_name%
} else {
command = chmod +x $${LINUX_READ_INI} $$CMD_SEP
command += $${LINUX_READ_INI} $${file_name} $${sect_name} $${key_name}
}
#message ($$command)
return ($$command)
}
WIN_WRITE_INI = $${PWD}/win_write_ini.bat
LINUX_WRITE_INI = $${PWD}/linux_write_ini.sh
defineReplace(get_write_ini_command) {
file_name = $$1
sect_name = $$2
key_name = $$3
new_value = $4
!isEmpty(5): error("get_write_ini_command(file, section, key, value) requires four arguments.")
isEmpty(4) : error("get_write_ini_command(file, section, key, value) requires four arguments.")
command =
equals(QMAKE_HOST.os, Windows) {
#if use $${PWD}/...directoly this PWD is the refrence pri file path
command = $${WIN_WRITE_INI} %file_name% %sect_name% %key_name% %new_value%
} else {
command = chmod +x $${LINUX_WRITE_INI} $$CMD_SEP
command += $${LINUX_WRITE_INI} $${file_name} $${sect_name} $${key_name} $${new_value}
}
#message ($$command)
return ($$command)
}
defineReplace(get_md5_command) {
filename = $$1
isEmpty(1): error("get_md5_command(filename) requires one argument")
!isEmpty(2): error("get_md5_command(filename) requires one argument")
command =
equals(QMAKE_HOST.os, Windows) {
command = md5 -n $${filename}
} else:mac* {
command = md5 -q $${filename}
} else {
command = md5sum -b $${filename} | cut -d \' \' -f1
}
return ($$command)
}
defineReplace(get_user_home) {
command =
equals(QMAKE_HOST.os, Windows) {
command = echo %HOMEDRIVE%%HOMEPATH%
} else {
command = echo $HOME
}
#message ($$command)
return ($$command)
}
defineReplace(get_user_config_path) {
command =
#windows下编译android工程qmake CONFIG里面不包含win32而是android、linux、unix。
#win32 只有在目标是win32的时候才会在CONFIG里面出现。开发平台用QMAKE_HOST.os
#注意qmake在windows平台下无论目标明令行一律按照windows控制台风格。不以目标区分Attention!。
#win32 {
equals(QMAKE_HOST.os, Windows) {
command = echo %APPDATA%
} else {
command = echo $HOME
}
#message ($$command)
return ($$command)
}
#将路径里的[反]斜杠转换为开发机上的格式。
#注意不是按照目标进行转换的所以仅仅用于命令行操作的FLOW。
#defineReplace(get_path) {
# command =
# return ($$command)
#}
################################################
##custom functions 用户喜欢这些函数
################################################
# system is default a replace and test function, can be used in condition, but
# system execute succ return 1 fail return 0 it is not follow command error code.
# define test used in condition my impletement
# system_error return command errcode and it is a test function not a replace function
# 如果自定义的这个函数和系统函数重名,会调用系统函数。
defineTest(system_errcode) {
command = $$1
isEmpty(1): error("system_errcode(command) requires one argument")
#special process
command = $$get_errcode($$command)
#the command is only return ret(0,1) wrappered by get_errcode
ret = $$system("$${command}")
#message($$command)
#message($$ret)
#if eval configed ...
#error: if(ret) : return (false)
#erro : eval(ret = 0): return (false)
#succ:
#equals(ret, 0):return (false)
#return(true)
#succ:but msvc creator auto qmake....
return ($${ret})
}
#can be used in condition
#test function and replace function can be same name
defineTest(mkdir) {
filename = $$1
isEmpty(1): error("mkdir(name) requires one argument")
command = $$get_mkdir($${filename})
#message ($$command)
system_errcode($${command}): return (true)
return (false)
}
#can be used in values
#must $$ !
#return values. true is 'true', false is 'false', xx0, xx1 is list
defineReplace(mkdir) {
filename = $$1
isEmpty(1): error("mkdir(name) requires one argument")
command = $$get_mkdir($${filename})
result = $$system("$${command}")
return ($${result})
}
#only use in condition! return true is 1, false is 0
#refuse $$ !
#return only true(1) or false(0)
defineTest(empty_file) {
filename = $$1
isEmpty(1): error("empty_file(filename) requires one argument")
command = $$get_empty_file($$filename)
#message($$command)
system_errcode($${command}): return (true)
return(false)
}
## but system write_file where ?
## bug: but qt4 write twice... when file exist, if empty_file first, write once....
## bug: this is a test function, but it wont exec, because + 2>/dev/null.
defineTest(write_line) {
filename = $$1
variable = $$2
!isEmpty(3): error("write_line(name, content) requires two arguments.")
isEmpty(2): error("write_line(name, content) requires two arguments.")
command = $$get_write_file($${filename}, $${variable})
#message($$command)
system_errcode($${command}): return(true)
return (false)
}
defineTest(copy_dir_and_file) {
source = $$1
pattern = $$2
target = $$3
!isEmpty(4): error("copy_dir_and_file(source, pattern, target) requires three arguments.")
isEmpty(3) : error("copy_dir_and_file(source, pattern, target) requires three arguments.")
command = $$get_copy_dir_and_file($$filename)
system_errcode($${command}): return (true)
return (false)
}
defineTest(is_same_file) {
filename1 = $$1
filename2 = $$2
isEmpty(2): error("is_same_file(filename1, filename2) requires two argument")
!isEmpty(3): error("is_same_file(filename1, filename2) requires two argument")
command1 = $$get_md5_command($${filename1})
command2 = $$get_md5_command($${filename2})
result1 = $$system($${command1})
result2 = $$system($${command2})
#message($$filename1 $$result1)
#message($$filename2 $$result2)
equals(result1, $${result2}) : return(true)
return (false)
}
defineReplace(read_ini) {
file_name = $$1
sect_name = $$2
key_name = $$3
!isEmpty(4): error("read_ini(file, section, key) requires three arguments.")
isEmpty(3) : error("read_ini(file, section, key) requires three arguments.")
command = $$get_read_ini_command($${file_name}, $${sect_name}, $${key_name})
echo = $$system("$${command}")
#message($$command)
#message($$echo)
return ($${echo})
}
defineReplace(write_ini) {
file_name = $$1
sect_name = $$2
key_name = $$3
new_value = $$4
!isEmpty(5): error("write_ini_command(file, section, key, value) requires four arguments.")
isEmpty(4) : error("write_ini_command(file, section, key, value) requires four arguments.")
command = $$get_write_ini_command($${file_name}, $${sect_name}, $${key_name}, $${new_value})
echo = $$system("$${command}")
#message($$command)
#message($$echo)
return ($${echo})
}
defineReplace(user_home) {
command = $$get_user_home()
echo = $$system("$${command}")
#message($$command)
#message($$echo)
return ($${echo})
}
defineReplace(user_config_path) {
command = $$get_user_config_path()
echo = $$system("$${command}")
#message($$command)
#message($$echo)
return ($${echo})
}

View File

@ -1,171 +0,0 @@
#---------------------------------------------------------------------
#应用程序语言翻译qmake文件。通过qmake与编译调用。
#如果需要增加某国语言add_language(...)即可。
#---------------------------------------------------------------------
#$$APP_SOURCE_PWD on mac TRANSLATIONS error, why?
#APP_SOURCE_PWD=$${PWD}
#用户在macOS下下使用PWD符号
##############################################################################
#内部函数
##############################################################################
defineReplace(get_lupdate_language){
#pro file
propath = $$1
!isEmpty(2): error("get_lupdate_language(propath) requires one argument")
isEmpty(1): error("get_lupdate_language(propath) requires one argument")
command =
command = lupdate $${propath}
#message($${command})
return ($${command})
}
defineReplace(get_lrelease_language){
filepath = $$1
filename = $$2
!isEmpty(3): error("get_lrelease_language(filepath, filename) requires two argument")
isEmpty(2): error("get_lrelease_language(filepath, filename) requires two argument")
command =
command = lrelease $${filepath}/$${filename}.ts -qm $${filepath}/$${filename}.qm
#message($${command})
return ($${command})
}
##############################################################################
#公开函数
##############################################################################
defineTest(lupdate_language){
#pro file
propath = $$1
!isEmpty(2): error("lupdate_language(propath) requires one argument")
isEmpty(1): error("lupdate_language(propath) requires one argument")
command =
command += $$get_lupdate_language($${propath})
!isEmpty(QMAKE_PRE_LINK):QMAKE_PRE_LINK+=$$CMD_SEP
QMAKE_PRE_LINK += $${command}
export(QMAKE_PRE_LINK)
return (true)
}
#输入.ts的 路径 和 文件名(不带后缀)
defineTest(lrelease_language){
filepath = $$1
filename = $$2
!isEmpty(3): error("lrelease_language(filepath, filename) requires two argument")
isEmpty(2): error("lrelease_language(filepath, filename) requires two argument")
command =
command += $$get_lrelease_language($${filepath}, $${filename})
!isEmpty(QMAKE_PRE_LINK):QMAKE_PRE_LINK+=$$CMD_SEP
QMAKE_PRE_LINK += $${command}
export(QMAKE_PRE_LINK)
return (true)
}
#输入pro全路径 .ts路径 .ts文件名(不带后缀,相当于需要添加的语言类型)
#注意:.ts路径必要使用$${PWD}符号
defineTest(add_language){
propath = $$1
filepath = $$2
filename = $$3
isEmpty(3)|!isEmpty(4): error("add_language(propath, filepath, filename) requires three argument")
#翻译语言起效
TRANSLATIONS += $${filepath}/$${filename}.ts
export(TRANSLATIONS)
command =
command += $$get_lupdate_language($${propath}) $$CMD_SEP
command += $$get_lrelease_language($${filepath}, $${filename})
!isEmpty(QMAKE_PRE_LINK):QMAKE_PRE_LINK+=$$CMD_SEP
QMAKE_PRE_LINK += $${command}
export(QMAKE_PRE_LINK)
return (1)
}
defineTest(add_zh_CN_en_US){
propath = $$1
filepath = $$2
isEmpty(2)|!isEmpty(3): error("add_zh_CN_en_US(propath, filepath) requires two argument")
#翻译语言起效
TRANSLATIONS += $${filepath}/zh_CN.ts $${filepath}/en_US.ts
export(TRANSLATIONS)
command =
command += $$get_lupdate_language($${propath}) $$CMD_SEP
command += $$get_lrelease_language($${filepath}, zh_CN) $$CMD_SEP
command += $$get_lrelease_language($${filepath}, en_US)
!isEmpty(QMAKE_PRE_LINK):QMAKE_PRE_LINK+=$$CMD_SEP
QMAKE_PRE_LINK += $${command}
export(QMAKE_PRE_LINK)
return (1)
}
############################################################################################################################################################
#以下翻译过程qmake的时候执行
#以下函数设计思路正常但是qmake执行堵死请勿使用无奈。
############################################################################################################################################################
#输入pro的完整路径
defineTest(qmake_lupdate_language){
#pro file
propath = $$1
!isEmpty(2): error("qmake_lupdate_language(propath) requires one argument")
isEmpty(1): error("qmake_lupdate_language(propath) requires one argument")
command = $$get_lupdate_language($${propath})
system_errcode($${command}): return (true)
return (false)
}
#输入.ts的 路径 和 文件名(不带后缀)
defineTest(qmake_lrelease_language){
filepath = $$1
filename = $$2
!isEmpty(3): error("qmake_lrelease_language(filepath, filename) requires two argument")
isEmpty(2): error("qmake_lrelease_language(filepath, filename) requires two argument")
command = $$get_lrelease_language($${filepath}, $${filename})
system_errcode($${command}): return (true)
return (false)
}
defineTest(add_qmake_language){
propath = $$1
filepath = $$2
filename = $$3
isEmpty(3)|!isEmpty(4): error("add_qmake_language(propath, filepath, filename) requires three argument")
#翻译语言起效
TRANSLATIONS += $${filepath}/$${filename}.ts
export(TRANSLATIONS)
qmake_lupdate_language($${propath})
qmake_lrelease_language($${filepath}, $${filename})
return (1)
}
#专门为中英文定义的
defineTest(add_qmake_zh_CN_en_US){
propath = $$1
filepath = $$2
isEmpty(2)|!isEmpty(3): error("add_qmake_zh_CN_en_US(propath, filepath) requires two argument")
#翻译语言起效
TRANSLATIONS += $${filepath}/zh_CN.ts $${filepath}/en_US.ts
export(TRANSLATIONS)
qmake_lupdate_language($${propath})
qmake_lrelease_language($${filepath}, zh_CN)
qmake_lrelease_language($${filepath}, en_US)
return (1)
}

View File

@ -1,284 +0,0 @@
#-------------------------------------------------------------
#add_library.pri
#提供app链接library函数app lib工程通用
#-------------------------------------------------------------
#add_include
#add_include_bundle
#add_library
#add_library_bundle
#add_link_library
#add_link_library_bundle
#固定SDK结构请参照add_sdk.pri
################################################################################
#内部用函数
#获取命令
################################################################################
#添加链接库路径 Only 路径
defineReplace(get_add_library_path) {
isEmpty(1)|!isEmpty(3): error("get_add_library_path(libgroupname) requires one argument")
libgroupname = $$1
CUR_LIB_PWD = $${LIB_SDK_ROOT}/$${libgroupname}/$${QSYS_STD_DIR}/lib
equals(QMAKE_HOST.os, Windows) {
CUR_LIB_PWD~=s,/,\\,g
}
LINK =
contains(DEFINES, __DARWIN__) {
LINK += -F$${CUR_LIB_PWD}
}
LINK += -L$${CUR_LIB_PWD}
message(add library path $$CUR_LIB_PWD)
return ($${LINK})
}
defineTest(add_library_path) {
isEmpty(1)|!isEmpty(3): error("add_library_path(libgroupname) requires one argument")
libgroupname = $$1
command = $$get_add_library_path($${libgroupname})
LIBS += $$command
export(LIBS)
return ($${LINK})
}
#链接库的命令
#从LIB_SDK_ROOT按照标准路径QSYS_STD_DIR链接
#mac下使用bundle
defineReplace(get_add_library_bundle) {
isEmpty(1): error("get_add_library(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("get_add_library(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
CUR_LIB_PWD = $${LIB_SDK_ROOT}/$${libgroupname}/$${QSYS_STD_DIR}/lib
equals(QMAKE_HOST.os, Windows) {
CUR_LIB_PWD~=s,/,\\,g
}
LINK =
contains(DEFINES, __DARWIN__) {
LINK += -F$${CUR_LIB_PWD}
LINK += -framework $${libname}
} else {
LINK += -L$${CUR_LIB_PWD}
#win can't with the blank! error: -l QQt
LINK += -l$${librealname}
}
message(link $${libname} from $$CUR_LIB_PWD)
return ($${LINK})
}
#忽略mac bundle的add_library
#建议不设置第三个参数
defineReplace(get_add_library) {
isEmpty(1): error("get_add_library(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("get_add_library(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
CUR_LIB_PWD = $${LIB_SDK_ROOT}/$${libgroupname}/$${QSYS_STD_DIR}/lib
equals(QMAKE_HOST.os, Windows) {
CUR_LIB_PWD~=s,/,\\,g
}
LINK =
#注意macOS下使用-L -l...也就是链接.dylib .a
LINK += -L$${CUR_LIB_PWD}
#win can't with the blank! error: -l QQt
LINK += -l$${librealname}
message(link $${libname} from $$CUR_LIB_PWD)
return ($${LINK})
}
defineReplace(get_add_include_bundle) {
isEmpty(1): error("get_add_include_bundle(libgroupname, libname, libincsubpath) requires at least one argument")
!isEmpty(4): error("get_add_include_bundle(libgroupname, libname, libincsubpath) requires at most three argument")
libgroupname = $$1
libname = $$2
libincsubpath = $$3
isEmpty(libname): libname = $${libgroupname}
CUR_INC_PWD =
contains(DEFINES, __DARWIN__) {
CUR_INC_PWD = $${LIB_SDK_ROOT}/$${libgroupname}/$${QSYS_STD_DIR}/lib/$${libname}.framework/Headers
!isEmpty(libincsubpath):CUR_INC_PWD=$${CUR_INC_PWD}/$${libincsubpath}
} else {
CUR_INC_PWD = $${LIB_SDK_ROOT}/$${libgroupname}/$${QSYS_STD_DIR}/include/$${libname}
!isEmpty(libincsubpath):CUR_INC_PWD=$${CUR_INC_PWD}/$${libincsubpath}
equals(QMAKE_HOST.os, Windows) {
CUR_INC_PWD~=s,/,\\,g
}
}
INCLUDE =
INCLUDE += $${CUR_INC_PWD}
message (include $${CUR_INC_PWD})
return ($${INCLUDE})
}
#获取头文件路径
defineReplace(get_add_include) {
isEmpty(1): error("get_add_include(libgroupname, libname, libincsubpath) requires at least one argument")
!isEmpty(4): error("get_add_include(libgroupname, libname, libincsubpath) requires at most three argument")
libgroupname = $$1
libname = $$2
libincsubpath = $$3
isEmpty(libname): libname = $${libgroupname}
CUR_INC_PWD = $${LIB_SDK_ROOT}/$${libgroupname}/$${QSYS_STD_DIR}/include/$${libname}
!isEmpty(libincsubpath):CUR_INC_PWD=$${CUR_INC_PWD}/$${libincsubpath}
equals(QMAKE_HOST.os, Windows) {
CUR_INC_PWD~=s,/,\\,g
}
INCLUDE =
INCLUDE += $${CUR_INC_PWD}
message (include $${CUR_INC_PWD})
return ($${INCLUDE})
}
################################################################################
#公开给外部用函数
#执行命令
################################################################################
#包含路径
#包含library
defineTest(add_library) {
isEmpty(1): error("add_library(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("add_library(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
command =
command += $$get_add_library($${libgroupname}, $${libname}, $${librealname})
LIBS += $${command}
export(LIBS)
#message (LIBS += $$command)
return (1)
}
defineTest(add_library_bundle) {
isEmpty(1): error("add_library_bundle(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("add_library_bundle(libgroupname, libname, librealname) requires at most three argument")
libgroupname = $$1
libname = $$2
librealname = $$3
isEmpty(libname): libname = $${libgroupname}
#建议使用默认值
isEmpty(librealname): librealname = $$add_decorate_target_name($$libname)
command =
command += $$get_add_library_bundle($${libgroupname}, $${libname}, $${librealname})
LIBS += $${command}
export(LIBS)
#message (LIBS += $$command)
return (1)
}
defineTest(add_include_bundle) {
isEmpty(1): error("add_include_bundle(libgroupname, libname, libincsubpath) requires at least one argument")
!isEmpty(4): error("add_include_bundle(libgroupname, libname, libincsubpath) requires at most three argument")
libgroupname = $$1
libname = $$2
libincsubpath = $$3
isEmpty(libname): libname = $${libgroupname}
command = $$get_add_include_bundle($$libgroupname, $$libname, $$libincsubpath)
INCLUDEPATH += $${command}
export(INCLUDEPATH)
#message (INCLUDEPATH += $$command)
return (1)
}
defineTest(add_include) {
isEmpty(1): error("add_include(libgroupname, libname, libincsubpath) requires at least one argument")
!isEmpty(4): error("add_include(libgroupname, libname, libincsubpath) requires at most three argument")
libgroupname = $$1
libname = $$2
libincsubpath = $$3
isEmpty(libname): libname = $${libgroupname}
command = $$get_add_include($$libgroupname, $$libname, $$libincsubpath)
INCLUDEPATH += $${command}
export(INCLUDEPATH)
#message (INCLUDEPATH += $$command)
return (1)
}
#提供方便
#链接标准SDK
defineTest(add_link_library) {
isEmpty(1): error("add_link_library(libgroupname, libname) requires at least one argument")
!isEmpty(3): error("add_link_library(libgroupname, libname) requires at most two argument")
libgroupname = $$1
libname = $$2
isEmpty(libname): libname = $${libgroupname}
add_include($${libgroupname}, $$libname)
add_library($$libgroupname, $$libname)
return (1)
}
defineTest(add_link_library_bundle) {
isEmpty(1): error("add_link_library_bundle(libgroupname, libname) requires at least one argument")
!isEmpty(3): error("add_link_library_bundle(libgroupname, libname) requires at most two argument")
libgroupname = $$1
libname = $$2
isEmpty(libname): libname = $${libgroupname}
add_include_bundle($${libgroupname}, $$libname)
add_library_bundle($$libgroupname, $$libname)
return (1)
}

View File

@ -1,65 +0,0 @@
#--------------------------------------------------------------------------------
#multi_link_technology.pri
#提供所有multi link技术的功能函数
#包括设定必需目录的要求
#--------------------------------------------------------------------------------
################################################################################
#多链接技术的路径依赖
################################################################################
CONFIG_PATH =
CONFIG_FILE =
equals(QMAKE_HOST.os, Windows) {
#>=v2.4
CONFIG_PATH = $$user_home()\\.qmake
#CONFIG_PATH = $$user_config_path()\\qmake
CONFIG_FILE = $${CONFIG_PATH}\\app_configure.pri
} else {
CONFIG_PATH = $$user_config_path()/.qmake
CONFIG_FILE = $${CONFIG_PATH}/app_configure.pri
}
!exists($${CONFIG_FILE}) {
mkdir("$${CONFIG_PATH}")
empty_file($${CONFIG_FILE})
ret = $$system(echo APP_BUILD_ROOT = >> $${CONFIG_FILE})
ret = $$system(echo APP_DEPLOY_ROOT = >> $${CONFIG_FILE})
ret = $$system(echo LIB_SDK_ROOT = > $${CONFIG_FILE})
}
#your must config this file! following readme!
include ($${CONFIG_FILE})
#qqt build root, build station root
#link_from_build will need this path.
isEmpty(APP_BUILD_ROOT)|isEmpty(LIB_SDK_ROOT)|isEmpty(APP_DEPLOY_ROOT){
message($${TARGET} multiple linking config file: $${CONFIG_FILE})
message("APP_BUILD_ROOT = is required, please modify $${CONFIG_FILE}")
message("APP_DEPLOY_ROOT = is required [optional]")
message("LIB_SDK_ROOT = is required")
message("[linux platform, ]this pri is under multi_link_technology.pri")
error("please check $$CONFIG_FILE")
}
#message($${TARGET} build root: $$APP_BUILD_ROOT)
#message($${TARGET} deploy root: $$APP_DEPLOY_ROOT)
#equals(TEMPLATE, app):message($${TARGET} use sdk root: $$LIB_SDK_ROOT)
#else:message($${TARGET} deploy sdk root: $$LIB_SDK_ROOT)
isEmpty(APP_BUILD_ROOT){
message($${TARGET} $${CONFIG_FILE})
message(APP_BUILD_ROOT = /user/set/path is required, please modify app_configure.pri )
error(please check $$CONFIG_FILE under add_multi_link_technology.pri)
}
#deploy root
isEmpty(APP_DEPLOY_ROOT){
message($${TARGET} $${CONFIG_FILE})
message(APP_DEPLOY_ROOT = /user/set/path is required, please modify app_configure.pri )
error(please check $$CONFIG_FILE under add_multi_link_technology.pri)
}
isEmpty(LIB_SDK_ROOT){
message($${TARGET} $${CONFIG_FILE})
message(LIB_SDK_ROOT = /user/set/path is required, please modify app_configure.pri )
error(please check $$CONFIG_FILE under add_multi_link_technology.pri)
}

View File

@ -1,73 +0,0 @@
#-----------------------------------------------------------------------------
#app_platform.pri
#这个pri决定编译目标平台
#-----------------------------------------------------------------------------
#从环境变量读取QSYS保存为qmake变量QSYS_PRIVATE
QSYS_PRIVATE = $$(QSYS)
contains(QSYS_PRIVATE, Embedded) {
#embedded common macro
DEFINES += __EMBEDDED_LINUX__
} else:contains(QSYS_PRIVATE, Arm32) {
DEFINES += __EMBEDDED_LINUX__
#arm32 private
DEFINES += __ARM_LINUX__
} else:contains(QSYS_PRIVATE, Mips32) {
DEFINES += __EMBEDDED_LINUX__
#mips32 private
DEFINES += __MIPS_LINUX__
} else:contains(QSYS_PRIVATE, Linux) {
DEFINES += __LINUX__
} else:contains(QSYS_PRIVATE, Linux64) {
DEFINES += __LINUX64__
} else:contains(QSYS_PRIVATE, Win32|Windows) {
DEFINES += __WIN32__
} else:contains(QSYS_PRIVATE, Win64) {
DEFINES += __WIN64__
} else:contains(QSYS_PRIVATE, macOS) {
DEFINES += __DARWIN__
} else:contains(QSYS_PRIVATE, iOS) {
DEFINES += __IOS__
} else:contains(QSYS_PRIVATE, iOSSimulator) {
DEFINES += __IOS__
#TODO:no qcustomplot word printer process
} else:contains(QSYS_PRIVATE, Android) {
DEFINES += __ANDROID__
} else:contains(QSYS_PRIVATE, AndroidX86) {
DEFINES += __ANDROID__
DEFINES += __ANDROIDX86__ #可能废弃
}
BUILD=
CONFIG(debug, debug|profile|release):BUILD=Debug
CONFIG(profile, debug|profile|release):BUILD=Profile
CONFIG(release, debug|profile|release):BUILD=Release
QSYS_STD_DIR = $${QSYS_PRIVATE}/$${QT_VERSION}/$${BUILD}
QSYS_STD_DIR = $${QSYS_PRIVATE}/$${QT_VERSION}
QSYS_STD_DIR = $${QSYS_PRIVATE}
message(add_platform.pri)
message(Build $${TARGET} to $${QSYS_PRIVATE} \(QSYS=$${QSYS_PRIVATE} is configed in project build page.\) )
message(Build $${TARGET} at $${QSYS_STD_DIR} \(Qt Kit page FileSystem Name=$${QSYS_PRIVATE}\) )
message(Build $${TARGET} on $${QMAKE_HOST.os} \(Operating System=$${QMAKE_HOST.os}\) )
isEmpty(QSYS_PRIVATE) : message(Build $${TARGET} Qt Kit page FileSystem Name is decided by env variable QSYS. Please set it. )
isEmpty(QSYS_PRIVATE) {
message(1. you should change qt default build directory to your-pc-build-station/%{CurrentProject:Name}/%{CurrentKit:FileSystemName})
message(2. env variable QSYS is required! pleace check app_platform.pri)
error(error occured! please check build output panel.)
}
isEmpty(QSYS_PRIVATE) {
message(env variable QSYS is required!)
message(pleace check app_platform.pri)
error("error occured, please check build output panel.")
}
#in theory, this should not be limited to 4.8.0, no limit is good.
lessThan(QT_VERSION, 4.8.0) {
message(A. ensure your compiler support c++11 feature)
message(B. suggest Qt version >= 4.8.0)
#error( error occured!)
}

View File

@ -1,803 +0,0 @@
#------------------------------------------------------------------------------------------------
##add_sdk.pri, making sdk function
##install to SDK path
##把Library按照SDK格式安装到LIB_SDK_ROOT
##发布到sdk是为Multi link准备的。
##依赖add_version.pri
##please don't modify this pri
#------------------------------------------------------------------------------------------------
##SDK格式
##LibGroupName/Windows/include/libName/***.h
## /bin/libName<ver>[d].dll
## /lib/libName<ver>[d].a .lib
##LibGroupName/Linux/include/libName/***.h
## /bin/
## /lib/libName.so.*
##LibGroupName/macOS/include/libName/***.h
## /bin/
## /lib/libName<ver>.dylib
## /libName[_debug].dylib
##LibGroupName/macOS/include/libName/***.h
## /bin/
## /lib/libName.framework/Headers/***.h
## /libName[_debug]
#固定SDK结构操作系统中直接使用这个目录结构。
#没有SDK SubDir结构
################################################
#add_sdk
#add_sdk_from_subdirs
#add_sdk_to_Qt
#add_sdk_header
#del_sdk
ADD_SDK_PRI_PWD = $${PWD}
#在build path修复app (macOS专有)
#copy lib
#fix bundle路径链接
#不修复,直接拷贝,所有的快捷方式会丢失,变成实体
#拷贝temp进行修复。
defineReplace(get_add_mac_sdk_fix_building_framework) {
#这里有特点framework的名字一定是TARGET。
libname = $$TARGET
#realname也是TARGET
librealname = $$TARGET
#废弃以上代码当然它是对的but固定的。
libname = $$1
librealname = $$2
#isEmpty(1): error("get_add_mac_sdk_fix_building_framework(libname, librealname) requires at last one argument")
!isEmpty(3): error("get_add_mac_sdk_fix_building_framework(libname, librealname) requires at most two argument")
isEmpty(1):libname = $$TARGET_NAME
isEmpty(2): librealname = $${libname}
libtempname = $${libname}_temp
command =
command += chmod +x $${ADD_SDK_PRI_PWD}/linux_cur_path.sh &&
command += . $${ADD_SDK_PRI_PWD}/linux_cur_path.sh &&
#create temp
command += $$MK_DIR $${LIB_BUILD_PWD}/$${libtempname}.framework &&
#进去
command += cd $${LIB_BUILD_PWD}/$${libtempname}.framework &&
#修复framework里的快捷方式
#need APP_BUILD_PWD
create_command = $$get_add_mac_sdk($${libname}, $${librealname})
command += $${create_command} &&
command += chmod +x $${ADD_SDK_PRI_PWD}/linux_cd_path.sh &&
command += . $${ADD_SDK_PRI_PWD}/linux_cd_path.sh &&
#拷贝prl到新的里
command += $$COPY $${LIB_BUILD_PWD}/$${libname}.framework/$${librealname}.prl $${LIB_BUILD_PWD}/$${libtempname}.framework/$${librealname}.prl $$CMD_SEP
#del 原先的
command += $$RM_DIR $${LIB_BUILD_PWD}/$${libname}.framework &&
#rename 临时的 framework 到原先的
command += $$MOVE $${LIB_BUILD_PWD}/$${libtempname}.framework $${LIB_BUILD_PWD}/$${libname}.framework
#message($$command)
return ($${command})
}
################################################
##lib install functions
##variable can be private and default inherit
##内部实现
################################################
defineReplace(get_add_sdk_dir_struct) {
#if it's qt library, don't create
command =
!equals(LIB_SDK_PWD , $$[QT_INSTALL_DATA]){
contains(QSYS_PRIVATE, macOS):contains(TEMPLATE, lib_bundle) {
#bundle模式没有include目录
} else {
command += $$MK_DIR $$LIB_INC_DIR $$CMD_SEP
}
command += $$MK_DIR $$LIB_BIN_DIR $$CMD_SEP
command += $$MK_DIR $$LIB_LIB_DIR $$CMD_SEP
command += $$MK_DIR $$LIB_CMAKE_DIR $$CMD_SEP
command += $$MK_DIR $$LIB_PRI_PATH
}
return ($$command)
}
defineReplace(get_add_windows_sdk) {
#need cd sdk root
command =
#copy header
command += $${COPY_DIR} $${LIB_SRC_PWD}\\*.h* $${LIB_INC_DIR} $$CMD_SEP
#should be *.dll *.lib
command += $${COPY_DIR} $${LIB_BUILD_PWD}\\* $${LIB_LIB_DIR} $$CMD_SEP
#move *.dll
command += $${MOVE} $${LIB_LIB_DIR}\\*.dll $${LIB_BIN_DIR}
return ($$command)
}
defineReplace(get_add_linux_sdk) {
#need cd sdk root
copy_command = $$get_copy_dir_and_file($${LIB_SRC_PWD}, "*.h*", $${LIB_INC_DIR})
command =
command += $${copy_command} $$CMD_SEP
#should be *.so.* *.a
command += $$COPY_DIR $${LIB_BUILD_PWD}/* $${LIB_LIB_DIR}
return ($$command)
}
#理论上只要用户设置了Version就能读到Version Major
#add_version里面有初始化版本号所以用户什么都不设置将会是0版本号。
#从libname.framework拷贝到当前新建的framework 内部为librealname
defineReplace(get_add_mac_sdk){
#need cd framework root
#LIB_BUILD_PWD libname libmajorver
libname = $$1
librealname = $$2
#isEmpty(1): error("get_add_mac_sdk(libname, librealname) requires at last one argument")
!isEmpty(3): error("get_add_mac_sdk(libname, librealname) requires at most two argument")
isEmpty(1):libname = $$TARGET_NAME
isEmpty(2): librealname = $${libname}
libmajorver = $$VER_MAJ
isEmpty(libmajorver){
error(Have you modifyed add_version.pri, please dont modify it.)
}
#这里的isEmpty没有用。
#isEmpty(libmajorver):libmajorver = $$system(readlink $${LIB_BUILD_PWD}/$${libname}.framework/Versions/Current)
#message($${LIB_BUILD_PWD}/$${libname}.framework/Versions/Current $$TARGET major version $$libmajorver)
LIB_BUNDLE_VER_DIR = Versions/$${libmajorver}
LIB_BUNDLE_CUR_DIR = Versions/Current
LIB_BUNDLE_INC_DIR = $${LIB_BUNDLE_VER_DIR}/Headers
LIB_BUNDLE_RES_DIR = $${LIB_BUNDLE_VER_DIR}/Resources
LIB_BUNDLE_EXE_FILE = $${LIB_BUNDLE_VER_DIR}/$${librealname}
LIB_BUNDLE_CUR_INC_DIR = $${LIB_BUNDLE_CUR_DIR}/Headers
LIB_BUNDLE_CUR_RES_DIR = $${LIB_BUNDLE_CUR_DIR}/Resources
LIB_BUNDLE_CUR_EXE_FILE = $${LIB_BUNDLE_CUR_DIR}/$${librealname}
LIB_BUNDLE_CUR_LINK = Current
LIB_BUNDLE_INC_LINK = Headers
LIB_BUNDLE_RES_LINK = Resources
LIB_BUNDLE_EXE_LINK = $${librealname}
command =
command += $$MK_DIR $$LIB_BUNDLE_VER_DIR $$CMD_SEP
command += $$MK_DIR $$LIB_BUNDLE_INC_DIR $$CMD_SEP
#copy lib
#should be *
command += $$COPY_DIR $${LIB_BUILD_PWD}/$${libname}.framework/$${LIB_BUNDLE_VER_DIR}/* $$LIB_BUNDLE_VER_DIR $$CMD_SEP
#copy header
copy_command = $$get_copy_dir_and_file($${LIB_SRC_PWD}, "*.h*", $${LIB_BUNDLE_INC_DIR})
command += $${copy_command} $$CMD_SEP
#link header current resources
command += $$CD Versions $$CMD_SEP
command += $$LN $${libmajorver} $${LIB_BUNDLE_CUR_LINK} $$CMD_SEP
command += $$CD .. $$CMD_SEP
command += $$LN $$LIB_BUNDLE_CUR_INC_DIR $${LIB_BUNDLE_INC_LINK} $$CMD_SEP
command += $$LN $$LIB_BUNDLE_CUR_RES_DIR $${LIB_BUNDLE_RES_LINK} $$CMD_SEP
command += $$LN $$LIB_BUNDLE_CUR_EXE_FILE $${LIB_BUNDLE_EXE_LINK}
lessThan(QT_MAJOR_VERSION, 5){
command += $$CMD_SEP
command += chmod +x $${ADD_SDK_PRI_PWD}/mac_deploy_qt4.sh $$CMD_SEP
command += $${ADD_SDK_PRI_PWD}/mac_deploy_qt4.sh $${LIB_BUNDLE_VER_DIR}/$${libname}
}
return ($$command)
}
#这个函数是支持发布Qt Library用的add_sdk用到了。
defineReplace(get_add_Qt_lib_pri){
#need cd sdk root
#LIB_BASE_DIR libname LIB_VERSION MODULE_CNAME
##write qt_lib_qqtcore.pri
command =
command += $$get_empty_file($${LIB_PRI_FILEPATH}) $$CMD_SEP
command += echo "QT.$${liblowername}.VERSION = $${APP_VERSION}" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.name = $${libname}" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.module = $${libname}" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
contains(QSYS_PRIVATE, Win32|Windows|Win64) {
command += echo "QT.$${liblowername}.libs = \$$QT_MODULE_LIB_BASE" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.bins = \$$QT_MODULE_BIN_BASE" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
} else {
command += echo "QT.$${liblowername}.libs = '\$$QT_MODULE_LIB_BASE'" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.bins = '\$$QT_MODULE_BIN_BASE'" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
}
contains(QSYS_PRIVATE, Win32|Windows|Win64) {
command += echo "QT.$${liblowername}.includes = \$$QT_MODULE_INCLUDE_BASE \$$QT_MODULE_INCLUDE_BASE/$${libname}" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.frameworks = " >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.module_config = v2 " >> $${LIB_PRI_FILEPATH} $$CMD_SEP
}else:equals(QSYS_PRIVATE, macOS) {
command += echo "QT.$${liblowername}.includes = '\$$QT_MODULE_LIB_BASE/$${libname}.framework/Headers'" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.frameworks = '\$$QT_MODULE_LIB_BASE'" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.module_config = v2 lib_bundle" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
} else {
command += echo "QT.$${liblowername}.includes = '\$$QT_MODULE_INCLUDE_BASE \$$QT_MODULE_INCLUDE_BASE/$${libname}'" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.frameworks = " >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.module_config = v2 " >> $${LIB_PRI_FILEPATH} $$CMD_SEP
}
greaterThan(QT_MAJOR_VERSION, 4):{
command += echo "QT.$${liblowername}.depends = core sql network gui xml widgets" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
} else {
command += echo "QT.$${liblowername}.depends = core sql network gui xml" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
}
command += echo "QT.$${liblowername}.uses =" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.DEFINES = LIB_LIBRARY" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.enabled_features =" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT.$${liblowername}.disabled_features =" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT_CONFIG +=" >> $${LIB_PRI_FILEPATH} $$CMD_SEP
command += echo "QT_MODULES += $${liblowername}" >> $${LIB_PRI_FILEPATH}
return ($$command)
}
################################################
##Lib deploy sdk workflow
##SDK发布过程
################################################
defineReplace(get_add_sdk_work_flow){
#need cd sdk root
libname = $$1
librealname = $$2
#isEmpty(1): error("get_add_sdk_work_flow(libname, librealname) requires at last one argument")
!isEmpty(3): error("get_add_sdk_work_flow(libname, librealname) requires at most two argument")
isEmpty(1):libname = $$TARGET_NAME
isEmpty(2): librealname = $${libname}
liblowername = $$lower($${librealname})
command =
contains(QSYS_PRIVATE, macOS) {
#在编译路径里创作一次sdk完成framework链接等的修复工作
command += $$get_add_mac_sdk_fix_building_framework($${librealname}, $${librealname}) $$CMD_SEP
#command += echo $$libname fix framework success. $$CMD_SEP
}
#command += $$RM_DIR $${LIB_SDK_PWD} $$CMD_SEP
command += $$MK_DIR $${LIB_SDK_PWD} $$CMD_SEP
command += $$CD $${LIB_SDK_PWD} $$CMD_SEP
command += $$get_add_sdk_dir_struct() $$CMD_SEP
#这里不是目标为Windows才拷贝而是开发机是Windows就得这么拷贝。
#Windows下Win目标、Android目标都走这里。
#contains(QSYS_PRIVATE, Win32|Windows|Win64) {
equals(QMAKE_HOST.os, Windows) {
#message(create lib windows struct library)
command += $$get_add_windows_sdk() $$CMD_SEP
command += $$COPY $${LIB_BUILD_PWD}\\*.prl lib $$CMD_SEP
} else {
#macOS lib_bundle make sdk
contains(QSYS_PRIVATE, macOS):contains(CONFIG, lib_bundle) {
#message(create lib mac bundle framework)
command += $$MK_DIR lib/$${libname}.framework $$CMD_SEP
command += $$CD lib/$${libname}.framework $$CMD_SEP
command += $$get_add_mac_sdk($${librealname}, $${librealname}) $$CMD_SEP
command += $$CD ../../ $$CMD_SEP
#create prl
command += $$COPY $${LIB_BUILD_PWD}/$${librealname}.framework/$${librealname}.prl lib/$${libname}.framework/$${librealname}.prl $$CMD_SEP
} else {
#Android在linux开发机下也会走这里Android目标Lib可以发布Win和Linux两种格式的SDK。
#message(create lib linux struct library)
#macOS no bundle 也会走这里已经支持非bundle
command += $$get_add_linux_sdk() $$CMD_SEP
command += $$COPY $${LIB_BUILD_PWD}/*.prl lib $$CMD_SEP
}
}
command += $$get_add_Qt_lib_pri()
#$$CMD_SEP
#command += echo $$libname create sdk success.
return ($$command)
}
################################################
##Lib deploy sdk work flow
##初始化SDK发布过程需要的变量
################################################
defineReplace(get_add_sdk_private){
#这个判定逻辑只能用于内部,不能用于最外层。
libname = $$1
librealname = $$2
#isEmpty(1): error("get_add_sdk_private(libname, librealname) requires at last one argument")
!isEmpty(3): error("get_add_sdk_private(libname, librealname) requires at most two argument")
isEmpty(1):libname = $$TARGET_NAME
isEmpty(2): librealname = $${libname}
liblowername = $$lower($${librealname})
#qqt defined these dir struct, used from qt library
LIB_INC_DIR = include/$${TARGET_NAME}
LIB_BIN_DIR = bin
LIB_LIB_DIR = lib
LIB_CMAKE_DIR=lib/cmake/$${libname}
LIB_PRI_PATH=mkspecs/modules
LIB_PRI_FILEPATH=$${LIB_PRI_PATH}/qt_lib_$${liblowername}.pri
#不仅仅发布目标为Windows的时候需要改变
#开发Host是Windows的时候都要改变。路径问题是两种操作系统固有的痛。
#contains(QSYS_PRIVATE, Win32|Windows|Win64) {
equals(QMAKE_HOST.os, Windows) {
#on windows every path must use \ sep.
LIB_SRC_PWD~=s,/,\\,g
LIB_BUILD_PWD~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
LIB_INC_DIR~=s,/,\\,g
LIB_BIN_DIR = bin
LIB_LIB_DIR = lib
LIB_CMAKE_DIR~=s,/,\\,g
LIB_PRI_PATH~=s,/,\\,g
LIB_PRI_FILEPATH~=s,/,\\,g
#ignored
HEADERS_WIN=$${HEADERS}
HEADERS_WIN~=s,/,\\,g
#on windows, copy all *.h*, include closed feature header.
#qmake regexp use perl grammer
#HEADERS_WIN~=s/[d ]+/h+/g how to mod space to +
}
#create library struct
#create platform sdk
#create mkspec module pri
command = $$get_add_sdk_work_flow($${libname}, $${librealname})
#message ($$command)
return ($${command})
}
################################################
##用户调用的函数
################################################
#libgroupname<主目录名>
#libname 这里 libname是内定的 就是用户设置的TARGET 没有修饰的那个 如果想发布成随意的样子就改变这个。这个很重要,建议不要随便改动。
#librealname 用户自定义名称,一般省略 = 修饰名是没有问题的。
#libsrcdir PWD
#libdstdir DESTDIR 这两个参数一般不设置除非你的pri pro所在位置不是准确的源代码目录除非你的编译中间目标所在在子目录里如果subdirs工程用下边那个add_sdk函数
defineTest(add_sdk){
#isEmpty(1): error("add_sdk(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("add_sdk(libgroupname, libname, librealname) requires at most three argument")
#LIB_SDK_ROOT下
#主目录名
libgroupname = $$TARGET_NAME
!isEmpty(1):libgroupname=$$1
#这个设置是强力的直接改变了发布的lib的名字编译处的目标名字也改变了。强大。
#如果用户对TARGET名不满意用这个参数改变
#关系:
#用户最初设置TARGET 完全用户的思想
#base manager改为修饰的TARGET。
#这里允许用户重新定义TARGET完全用户的思想
#自动对名字修饰。
#不依赖libgroupname
libname = $$TARGET_NAME
!isEmpty(2): libname = $$2
!isEmpty(2) {
#libname决定target名字并且直接把TARGET改为_debug/d修饰名。
TARGET = $$libname
add_decorate_target()
#这个位置需不需要export存在分歧
export(TARGET)
}
#建议使用默认值
#这个会影响lib名的后缀_debug d或者用户定的_xxx
#如果用户对_debug d等修饰名不满意那么用这个参数改变。
#如果用户对自动修饰的名字不满意,那么用这个参数设定经过修饰的名字,自定义的
#通过这个参数,可以强制不修饰目标名 非标准 这样会影响链接时候的名字,用户链接的时候需要注意链接名
#依赖libname
librealname = $$add_decorate_target_name($$libname)
!isEmpty(3): librealname = $$3
!isEmpty(3){
TARGET = $$librealname
export(TARGET)
}
#liblowername依赖librealname
liblowername = $$lower($${librealname})
#create platform sdk need this
#源代码目录
LIB_SRC_PWD=$${APP_SOURCE_PWD}
isEmpty(LIB_SRC_PWD):LIB_SRC_PWD=$$PWD
#编译目标位置
LIB_DST_DIR=$${APP_BUILD_DESTDIR}
isEmpty(LIB_DST_DIR):LIB_DST_DIR = $$DESTDIR
libprojname=$$APP_PROJECT_NAME
isEmpty(libprojname):libprojname=$$libname
#message(lib project name $$libprojname)
LIB_BUILD_PWD=$${APP_BUILD_ROOT}/$${libprojname}/$${QSYS_STD_DIR}
!isEmpty(LIB_DST_DIR):LIB_BUILD_PWD=$${LIB_BUILD_PWD}/$${LIB_DST_DIR}
#LIB std dir is not same to app std dir
LIB_STD_DIR = $${libgroupname}/$${QSYS_STD_DIR}
#sdk path
LIB_SDK_PWD = $${LIB_SDK_ROOT}/$${LIB_STD_DIR}
#message($${TARGET_NAME} sdk install here:$${LIB_SDK_PWD})
#这里不仅仅目标为windows的时候才会转换
#开发Host为Windows的时候都要转换。
#contains(QSYS_PRIVATE, Win32|Windows||Win64) {
equals(QMAKE_HOST.os, Windows) {
APP_BUILD_ROOT~=s,/,\\,g
LIB_SDK_ROOT~=s,/,\\,g
APP_DEPLOY_ROOT~=s,/,\\,g
QSYS_STD_DIR~=s,/,\\,g
LIB_STD_DIR~=s,/,\\,g
LIB_DST_DIR~=s,/,\\,g
LIB_BUILD_PWD~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
}
command += $$get_add_sdk_private($${libname}, $${librealname})
#message($$command)
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
QMAKE_POST_LINK += $$command
export(QMAKE_POST_LINK)
return (1)
}
#依赖 libname libsrcdir libdstdir
#添加一个参数 subdirs列表 包含subdirs层 子文件夹层 说的是build路径比较深的情况
#libgroupname 一般为不修饰的target 可以为空
#PWD
#DESTDIR
#sub层列表 从头到尾 如果为空则等于add_sdk()
#librealname 建议用户不要设置
#支持Qt5不支持Qt4. Qt4 qmake比较落后。
defineTest(add_sdk_from_subdirs){
#isEmpty(1): error("add_sdk_from_subdirs(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("add_sdk_from_subdirs(libgroupname, libname, librealname) requires at most three argument")
#LIB_SDK_ROOT下
#主目录名
libgroupname = $$TARGET_NAME
!isEmpty(1):libgroupname=$$1
#这个设置是强力的直接改变了发布的lib的名字编译处的目标名字也改变了。强大。
#如果用户对TARGET名不满意用这个参数改变
#关系:
#用户最初设置TARGET 完全用户的思想
#base manager改为修饰的TARGET。
#这里允许用户重新定义TARGET完全用户的思想
#自动对名字修饰。
#不依赖libgroupname
libname = $$TARGET_NAME
!isEmpty(2): libname = $$2
!isEmpty(2) {
#libname决定target名字并且直接把TARGET改为_debug/d修饰名。
TARGET = $$libname
add_decorate_target()
#这个位置需不需要export存在分歧
export(TARGET)
}
#建议使用默认值
#这个会影响lib名的后缀_debug d或者用户定的_xxx
#如果用户对_debug d等修饰名不满意那么用这个参数改变。
#如果用户对自动修饰的名字不满意,那么用这个参数设定经过修饰的名字,自定义的
#通过这个参数,可以强制不修饰目标名 非标准 这样会影响链接时候的名字,用户链接的时候需要注意链接名
#依赖libname
librealname = $$add_decorate_target_name($$libname)
!isEmpty(3): librealname = $$3
!isEmpty(3){
TARGET = $$librealname
export(TARGET)
}
#liblowername依赖librealname
liblowername = $$lower($${librealname})
#create platform sdk need this
#源代码目录
LIB_SRC_PWD=$${APP_SOURCE_PWD}
isEmpty(LIB_SRC_PWD):LIB_SRC_PWD=$$PWD
#编译目标位置
LIB_DST_DIR=$${APP_BUILD_DESTDIR}
isEmpty(LIB_DST_DIR):LIB_DST_DIR = $$DESTDIR
libprojname=$$APP_PROJECT_NAME
isEmpty(libprojname):libprojname=$$libname
#编译目录的完全位置
LIB_BUILD_PWD=
isEmpty(4){
#add sdk level
LIB_BUILD_PWD=$${APP_BUILD_ROOT}/$${libprojname}/$${QSYS_STD_DIR}
!isEmpty(LIB_DST_DIR):LIB_BUILD_PWD=$${LIB_BUILD_PWD}/$${LIB_DST_DIR}
} else {
#sub dir level
LIB_SUBDIR_LIST=$$4
first_value = $$first(LIB_SUBDIR_LIST)
LIB_BUILD_PWD=$${APP_BUILD_ROOT}/$${first_value}/$${QSYS_STD_DIR}
LIB_SUBDIR_LIST -= $$first_value
for(dir, LIB_SUBDIR_LIST) {
LIB_BUILD_PWD=$${LIB_BUILD_PWD}/$${dir}
}
LIB_BUILD_PWD=$${LIB_BUILD_PWD}/$${TARGET}
!isEmpty(LIB_DST_DIR):LIB_BUILD_PWD=$${LIB_BUILD_PWD}/$${LIB_DST_DIR}
}
#LIB std dir is not same to app std dir
LIB_STD_DIR = $${libgroupname}/$${QSYS_STD_DIR}
#sdk path
LIB_SDK_PWD = $${LIB_SDK_ROOT}/$${LIB_STD_DIR}
#message($${TARGET} sdk install here:$${LIB_SDK_PWD})
#这里不仅仅目标为windows的时候才会转换
#开发Host为Windows的时候都要转换。
#contains(QSYS_PRIVATE, Win32|Windows||Win64) {
equals(QMAKE_HOST.os, Windows) {
APP_BUILD_ROOT~=s,/,\\,g
LIB_SDK_ROOT~=s,/,\\,g
APP_DEPLOY_ROOT~=s,/,\\,g
QSYS_STD_DIR~=s,/,\\,g
LIB_STD_DIR~=s,/,\\,g
LIB_DST_DIR~=s,/,\\,g
LIB_BUILD_PWD~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
}
command += $$get_add_sdk_private($${libname}, $${librealname})
#message($$command)
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
QMAKE_POST_LINK += $$command
export(QMAKE_POST_LINK)
return (1)
}
#if you want to use QQt with QT += QQt please open this feature
defineTest(add_sdk_to_Qt){
#isEmpty(1): error("add_sdk_to_Qt(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("add_sdk_to_Qt(libgroupname, libname, librealname) requires at most three argument")
#LIB_SDK_ROOT下
#主目录名
libgroupname = $$TARGET_NAME
!isEmpty(1):libgroupname=$$1
#这个设置是强力的直接改变了发布的lib的名字编译处的目标名字也改变了。强大。
#如果用户对TARGET名不满意用这个参数改变
#关系:
#用户最初设置TARGET 完全用户的思想
#base manager改为修饰的TARGET。
#这里允许用户重新定义TARGET完全用户的思想
#自动对名字修饰。
#不依赖libgroupname
libname = $$TARGET_NAME
!isEmpty(2): libname = $$2
!isEmpty(2) {
#libname决定target名字并且直接把TARGET改为_debug/d修饰名。
TARGET = $$libname
add_decorate_target()
#这个位置需不需要export存在分歧
export(TARGET)
}
#建议使用默认值
#这个会影响lib名的后缀_debug d或者用户定的_xxx
#如果用户对_debug d等修饰名不满意那么用这个参数改变。
#如果用户对自动修饰的名字不满意,那么用这个参数设定经过修饰的名字,自定义的
#通过这个参数,可以强制不修饰目标名 非标准 这样会影响链接时候的名字,用户链接的时候需要注意链接名
#依赖libname
librealname = $$add_decorate_target_name($$libname)
!isEmpty(3): librealname = $$3
!isEmpty(3){
TARGET = $$librealname
export(TARGET)
}
#liblowername依赖librealname
liblowername = $$lower($${librealname})
#create platform sdk need this
#源代码目录
LIB_SRC_PWD=$${APP_SOURCE_PWD}
isEmpty(LIB_SRC_PWD):LIB_SRC_PWD=$$PWD
#编译目标位置
LIB_DST_DIR=$${APP_BUILD_DESTDIR}
isEmpty(LIB_DST_DIR):LIB_DST_DIR = $$DESTDIR
libprojname=$$APP_PROJECT_NAME
isEmpty(libprojname):libprojname=$$libname
#need use qqt subdir proj
LIB_BUILD_PWD=$${APP_BUILD_ROOT}/$${libprojname}/$${QSYS_STD_DIR}
!isEmpty(LIB_DST_DIR):LIB_BUILD_PWD=$${LIB_BUILD_PWD}/$${LIB_DST_DIR}
#在发布到Qt里没用了。。
LIB_STD_DIR = $${libgroupname}/$${QSYS_STD_DIR}
#sdk path
LIB_SDK_PWD = $$[QT_INSTALL_DATA]
#message(QQt sdk install here:$${LIB_SDK_PWD})
#这里不仅仅目标为windows的时候才会转换
#开发Host为Windows的时候都要转换。
#contains(QSYS_PRIVATE, Win32|Windows||Win64) {
equals(QMAKE_HOST.os, Windows) {
APP_BUILD_ROOT~=s,/,\\,g
LIB_SDK_ROOT~=s,/,\\,g
APP_DEPLOY_ROOT~=s,/,\\,g
QSYS_STD_DIR~=s,/,\\,g
LIB_STD_DIR~=s,/,\\,g
LIB_DST_DIR~=s,/,\\,g
LIB_BUILD_PWD~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
}
command += $$get_add_sdk_private($${libname}, $${librealname})
#message($$command)
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
QMAKE_POST_LINK += $$command
export(QMAKE_POST_LINK)
return (1)
}
defineTest(del_sdk){
#isEmpty(1): error("del_sdk(libgroupname, libname, librealname) requires at least one argument")
!isEmpty(4): error("del_sdk(libgroupname, libname, librealname) requires at most three argument")
#LIB_SDK_ROOT下
#主目录名
libgroupname = $$TARGET_NAME
!isEmpty(1):libgroupname=$$1
#不依赖libgroupname
libname = $$TARGET_NAME
!isEmpty(2): libname = $$2
#依赖libname
librealname = $$add_decorate_target_name($$libname)
!isEmpty(3): librealname = $$3
#liblowername依赖librealname
liblowername = $$lower($${librealname})
#LIB std dir is not same to app std dir
LIB_STD_DIR = $${libgroupname}/$${QSYS_STD_DIR}
#sdk path
LIB_SDK_PWD = $${LIB_SDK_ROOT}/$${LIB_STD_DIR}
#message(QQt sdk install here:$${LIB_SDK_PWD})
LIB_SDK_ALL = $${LIB_SDK_PWD}/*$${libname}.*
LIB_SDK_ALL2 = $${LIB_SDK_PWD}/*$${librealname}.*
#这里不仅仅目标为windows的时候才会转换
#开发Host为Windows的时候都要转换。
#contains(QSYS_PRIVATE, Win32|Windows||Win64) {
equals(QMAKE_HOST.os, Windows) {
LIB_SDK_ROOT~=s,/,\\,g
QSYS_STD_DIR~=s,/,\\,g
LIB_STD_DIR~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
LIB_SDK_ALL~=s,/,\\,g
LIB_SDK_ALL2~=s,/,\\,g
}
command += $$RM_DIR $${LIB_SDK_ALL} $$CMD_SEP
command += $$RM_DIR $${LIB_SDK_ALL2}
#message($$command)
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += $$CMD_SEP
QMAKE_POST_LINK += $$command
export(QMAKE_POST_LINK)
return (1)
}
#发布没有后缀名的头文件
#sdkroot下主目录名 lib组
#库名字 没有修饰的库名字 保存头文件的地方
#类名 头文件的名称
#保存位置 相对路径 不写则为头文件根目录。
#头文件 不设置 为空 则为类名小写。头文件里包含的.h头
defineTest(add_sdk_header){
isEmpty(3):error(add_sdk_header(libgroupname, libname, classname, headerdir, headername) need at least one argument)
libgroupname = $$1
libname = $$2
classname = $$3
headerdir = $$4
headername = $$5
#不依赖libgroupname
isEmpty(libname):libname = $$TARGET_NAME
#依赖classname
isEmpty(headername):headername = $$lower($${classname}).h
#LIB std dir is not same to app std dir
LIB_STD_DIR = $${libgroupname}/$${QSYS_STD_DIR}
#sdk path
LIB_SDK_PWD = $${LIB_SDK_ROOT}/$${LIB_STD_DIR}
#message(QQt sdk install here:$${LIB_SDK_PWD})
LIB_INC_DIR = include/$${libname}
contains(QMAKE_HOST.os, Darwin){
contains(CONFIG, lib_bundle) {
LIB_INC_DIR = lib/$${libname}.framework/Headers
}
}
!isEmpty(headerdir):headerdir=$${headerdir}/
HEADER_FILE = $${headerdir}$${classname}
#这里不仅仅目标为windows的时候才会转换
#开发Host为Windows的时候都要转换。
#contains(QSYS_PRIVATE, Win32|Windows||Win64) {
equals(QMAKE_HOST.os, Windows) {
APP_BUILD_ROOT~=s,/,\\,g
LIB_SDK_ROOT~=s,/,\\,g
APP_DEPLOY_ROOT~=s,/,\\,g
QSYS_STD_DIR~=s,/,\\,g
LIB_STD_DIR~=s,/,\\,g
LIB_DST_DIR~=s,/,\\,g
LIB_BUILD_PWD~=s,/,\\,g
LIB_SDK_PWD~=s,/,\\,g
LIB_INC_DIR~=s,/,\\,g
HEADER_FILE~=s,/,\\,g
}
command =
command += $$CD $${LIB_SDK_PWD} $$CMD_SEP
command += $$CD $${LIB_INC_DIR} $$CMD_SEP
contains(QMAKE_HOST.os, Windows){
command += $${ADD_SDK_PRI_PWD}/win_write_header.bat $${headername} $${HEADER_FILE}
} else {
command += chmod +x $${ADD_SDK_PRI_PWD}/linux_write_header.sh $$CMD_SEP
command += $${ADD_SDK_PRI_PWD}/linux_write_header.sh $${headername} $${HEADER_FILE}
}
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK+=$$CMD_SEP
QMAKE_POST_LINK += $$command
export(QMAKE_POST_LINK)
return(1)
}

View File

@ -1,109 +0,0 @@
#################################################################
##project $${TARGET} version pri
#################################################################
#拷贝到用户用户工程目录里使用用
##add_sdk need this pri
defineReplace(get_version_string_1) {
major_version = $$1
!isEmpty(2): error("get_version_string_1(major) requires one arguments")
isEmpty(1): error("get_version_string_1(major) requires one arguments")
command = $${major_version}
return ($$command)
}
defineReplace(get_version_string_2) {
major_version = $$1
minor_version = $$2
!isEmpty(3): error("get_version_string_2(major, minor) requires two arguments")
isEmpty(2): error("get_version_string_2(major, minor) requires two arguments")
command = $${major_version}.$${minor_version}
return ($$command)
}
defineReplace(get_version_string_3) {
major_version = $$1
minor_version = $$2
patch_version = $$3
!isEmpty(4): error("get_version_string_3(major, minor, patch) requires three arguments")
isEmpty(3): error("get_version_string_3(major, minor, patch) requires three arguments")
command = $${major_version}.$${minor_version}.$${patch_version}
return ($$command)
}
defineReplace(get_version_string_4) {
major_version = $$1
minor_version = $$2
patch_version = $$3
build_version = $$4
!isEmpty(5): error("get_version_string_4(major, minor, patch, build) requires four arguments")
isEmpty(4): error("get_version_string_4(major, minor, patch, build) requires four arguments")
command = $${major_version}.$${minor_version}.$${patch_version}.$${build_version}
return ($$command)
}
#-------------------------------------------------------------------------------
#User Make Version Function
#-------------------------------------------------------------------------------
PRE_VERSION =
PRE_LIB_VERSION =
PRE_APP_VERSION =
defineTest(add_version) {
isEmpty(4):error(add_version(major, minor, patch, build) need four arguments.)
APP_MAJOR_VERSION = $$1
APP_MINOR_VERSION = $$2
APP_PATCH_VERSION = $$3
APP_BUILD_VERSION = $$4
APP_VERSION1 = $$get_version_string_1( $${APP_MAJOR_VERSION} )
APP_VERSION2 = $$get_version_string_2( $${APP_MAJOR_VERSION}, $${APP_MINOR_VERSION} )
APP_VERSION3 = $$get_version_string_3( $${APP_MAJOR_VERSION}, $${APP_MINOR_VERSION}, $${APP_PATCH_VERSION} )
APP_VERSION4 = $$get_version_string_4( $${APP_MAJOR_VERSION}, $${APP_MINOR_VERSION}, $${APP_PATCH_VERSION}, $${APP_BUILD_VERSION} )
#这两个变量赋值是什么关系?
#qmake 域变量
APP_VERSION = $${APP_VERSION3}
#清理上次的源代码 域宏
DEFINES -= $$PRE_VERSION
DEFINES -= $$PRE_LIB_VERSION
DEFINES -= $$PRE_APP_VERSION
PRE_VERSION = VERSION=$${APP_VERSION}
PRE_LIB_VERSION = LIB_VERSION=$${APP_VERSION}
PRE_APP_VERSION = APP_VERSION=$${APP_VERSION}
export(PRE_VERSION)
export(PRE_LIB_VERSION)
export(PRE_APP_VERSION)
#源代码 域宏
DEFINES += VERSION=$${APP_VERSION}
contains(TEMPLATE, lib){
DEFINES += LIB_VERSION=$${APP_VERSION}
} else : contains(TEMPLATE, app) {
DEFINES += APP_VERSION=$${APP_VERSION}
}
#工程版本设置
unix:VERSION = $${APP_VERSION}
unix:VER_MAJ = $$APP_MAJOR_VERSION
unix:VER_MIN = $$APP_MINOR_VERSION
unix:VER_PAT = $$APP_PATCH_VERSION
export(DEFINES)
export(VERSION)
export(VER_MAJ)
export(VER_MIN)
export(VER_PAT)
export(APP_VERSION)
export(APP_MAJOR_VERSION)
export(APP_MINOR_VERSION)
export(APP_PATCH_VERSION)
export(APP_BUILD_VERSION)
!equals(APP_VERSION4, 0.0.0.0):message ($${TARGET} version: v$$APP_VERSION4)
return (1)
}
#-------------------------------------------------------------------------------
#User Make Version Inition
#调用一次进行初始化,用户后续进行的更改依然有效。
#-------------------------------------------------------------------------------
add_version(0, 0, 0, 0)

View File

@ -1,2 +0,0 @@
#!/usr/bin/env bash
cd $curpath

View File

@ -1,4 +0,0 @@
#!/bin/sh
initpath=$(pwd)
(cd $1; tar -cf - $(find . -name "$2") ) | (cd $3; tar -xf -)
cd $initpath

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
#qmake syntax error, so do this
curpath=$(pwd)

View File

@ -1,12 +0,0 @@
#!/bin/sh
ReadINIfile()
{
Configfile=$1
Section=$2
Key=$3
ReadINI=`awk -F '=' '/\['$Section'\]/{a=1}a==1&&$1~/'$Key'/{print $2;exit}' $Configfile`
echo "$ReadINI"
}
ReadINIfile $1 $2 $3

View File

@ -1,3 +0,0 @@
#!/bin/bash
echo \#include \<$1\> > $2

View File

@ -1,70 +0,0 @@
#!/bin/sh
function WriteINIfile()
{
Configfile=$1
Section=$2
Key=$3
NewValue=$4
WriteINI=`sed -i "/^$Section/,/^/ {/^\[$Section/b;/^\[/b;s/^$Key*=.*/$Key=$NewValue/g;}" $Configfile`
echo $WriteINI
}
#WriteINIfile $1 $2 $3 $4
# 解析INI
rini()
{
# 判断参数数量
if [ $# -lt 2 ];then
echo 'Usage:ini <filename> <[section]> [<key>] [<newvalue>]'
_exit
fi
# 讲ini文件读取到变量
_old=`cat $1`
# 判断变量3是否为空 如果为空 显示该[]下的所有字段
if [ "$3" = "" ];then
sed -n "/\[$2\]/,/\[.*\]/{
/^\[.*\]/d
/^[ ]*$/d
s/;.*$//
p
}" $1
# 判断变量4是否为空 如果为空 显示该字段的值
elif [ "$4" = "" ];then
sed -n "/\[$2\]/,/\[.*\]/{
/^\[.*\]/d
/^[ ]*$/d
s/;.*$//
s/^[ | ]*$3[| ]*=[ | ]*\(.*\)[ | ]*/\1/p
}" $1
else
# 判断变量4是否为字符'#' 如果为'#' 删除改行
if [ "$4" = "#" ];then
sed -i "/\[$2\]/,/\[.*\]/{
s/^[ | ]*$3[ | ]*=.*/ /
}" $1
else
# 如果变量4不为空和'#' 修改该变量 有备注使用改语句修改
sed -i "/\[$2\]/,/\[.*\]/{
s/^[ | ]*$3[ | ]*=.*[ | |.*]/$3=$4 /
#s/^[ | ]*$3[ | ]*=[a-zA-Z0-9]*.[0-9]*.[0-9]*.[0-9]*/$3=$4/
}" $1
# 重新读取新文件
_new=`cat $1`
# 判断是否更改
if [ "$_new" = "$_old" ];then
# 修改没成功 使用以下语句更改
sed -i "/\[$2\]/,/\[.*\]/{
s/^[ | ]*$3[ | ]*=.*/$3=$4/
#s/^[ | ]*$3[ | ]*=[a-zA-Z0-9]*.[0-9]*.[0-9]*.[0-9]*/$3=$4/
}" $1
fi
fi
fi
}
rini $1 $2 $3 $4

View File

@ -1,9 +0,0 @@
#!/usr/bin/env bash
appname=$1
qtmodule=Qt3Support\ QtCore\ QtDBus\ QtDeclarative\ QtDesigner\ QtDesignerComponents\ QtGui\ QtHelp\ QtMultimedia\ QtNetwork\ QtOpenGL\ QtScript\ QtScriptTools\ QtSql\ QtSvg\ QtTest\ QtWebKit\ QtXml\ QtXmlPatterns\ phonon
for recur in $qtmodule
do
install_name_tool -change ${recur}.framework/Versions/4/${recur} @rpath/${recur}.framework/Versions/4/${recur} ${appname}
install_name_tool -change @executable_path/../Frameworks/${recur}.framework/Versions/4/${recur} @rpath/${recur}.framework/Versions/4/${recur} ${appname}
done
install_name_tool -add_rpath @executable_path/../Frameworks ${appname}

View File

@ -1,3 +0,0 @@
@echo off
rem for /f "skip=1 tokens=1,2 delims==" %%a IN (%1) Do if %2==%%a set %3=%%b & @echo readconfig get %%a, value is %%b
for /f "skip=1 tokens=1,2 delims==" %%a IN (%1) Do if %2==%%a @echo %%b

View File

@ -1,2 +0,0 @@
@echo off
echo #include ^<%1^> > %2

View File

@ -1,8 +0,0 @@
#Library SDK 发布中心
LIB_SDK_ROOT = /home/abel/Develop/b1-sdk
#应用编译中心 Lib编译中心
APP_BUILD_ROOT = /home/abel/Develop/c0-buildstation
#应用程序发布中心
APP_DEPLOY_ROOT = /home/abel/Develop/b0-product