1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

update MLMA

This commit is contained in:
tianduanrui 2017-12-02 18:31:08 +08:00
parent 31adde3112
commit 6bd892de75
5 changed files with 133 additions and 9 deletions

View File

@ -46,6 +46,11 @@ include(../../src/link_qqt_library.pri)
##link Other library
################################################################
################################################################
##deploy app for install update deploy
################################################################
include(app_deploy.pri)
#-------------------------------------------------
##project environ print
#-------------------------------------------------

View File

@ -2,19 +2,36 @@
#user computer path settings
#-------------------------------------------------------------
#deploy root
equals(QMAKE_HOST.os, Darwin) {
APP_DEPLOY_ROOT = $$PWD/../../../deployer
} else: equals(QMAKE_HOST.os, Linux) {
APP_DEPLOY_ROOT = $$PWD/../../../deployer
} else: equals(QMAKE_HOST.os, Windows) {
APP_DEPLOY_ROOT = $$PWD/../../../deployer
CONFIG_PATH =
CONFIG_FILE =
win32 {
CONFIG_PATH = $$user_config_path()\\QQt
CONFIG_FILE = $${CONFIG_PATH}\\app.ini
} else {
CONFIG_PATH = $$user_config_path()/.QQt
CONFIG_FILE = $${CONFIG_PATH}/app.ini
}
message($${TARGET} config path: $$CONFIG_PATH config file: $${CONFIG_FILE})
!exists($${CONFIG_FILE}) {
empty_file($${CONFIG_FILE})
#qt4 need this ret, why?
ret = $$system(echo [$${TARGET}] >> $${CONFIG_FILE})
ret = $$system(echo APP_DEPLOY_ROOT = >> $${CONFIG_FILE})
}
isEmpty(APP_DEPLOY_ROOT): APP_DEPLOY_ROOT = $$read_ini("$${CONFIG_FILE}", "$${TARGET}", "APP_DEPLOY_ROOT")
message($${TARGET} deploy root: $$APP_DEPLOY_ROOT)
isEmpty(APP_DEPLOY_ROOT):error(APP_DEPLOY_ROOT required please check app.ini at $$CONFIG_PATH)
defineReplace(deploy_app_on_mac) {
#need QQT_BUILD_PWD
command = &&
command += rm -fr $${APP_DEPLOY_ROOT}/$${TARGET}.app &&
command += cp -fa $${DESTDIR}/$${TARGET}.app $${APP_DEPLOY_ROOT}
command += cp -fa $${DESTDIR}/$${TARGET}.app $${APP_DEPLOY_ROOT}/
message($$command)
return ($$command)
}

View File

@ -28,5 +28,4 @@ FORMS += \
system(touch main.cpp)
include(../qqtframe2/app_configure.pri)
include(../qqtframe2/app_deploy.pri)
include(../../src/app_configure.pri)

59
src/app_configure.pri Normal file
View File

@ -0,0 +1,59 @@
#-------------------------------------------------
#install app
#-------------------------------------------------
#CONFIG += can_install
can_install:equals(QKIT_PRIVATE, EMBEDDED) {
target.path = /Application
INSTALLS += target
} else: unix {
equals(QKIT_PRIVATE, macOS) {
target.path = /Applications
INSTALLS += target
}
}
############
##config defination
############
equals(QKIT_PRIVATE, macOS) {
CONFIG += app_bundle
}
contains(QKIT_PRIVATE, ANDROID|ANDROIDX86) {
CONFIG += mobility
MOBILITY =
DISTFILES += \
android/AndroidManifest.xml
ANDROID_PACKAGE_SOURCE_DIR = $${PWD}/android
}
################################################################
##build cache
################################################################
OBJECTS_DIR = obj
MOC_DIR = obj/moc.cpp
UI_DIR = obj/ui.h
RCC_DIR = qrc
DESTDIR = bin
################################################################
##link QQt
################################################################
include($${PWD}/link_qqt_library.pri)
################################################################
##link Other library
################################################################
################################################################
##deploy app for install update deploy
################################################################
include($${PWD}/app_deploy.pri)
#-------------------------------------------------
##project environ print
#-------------------------------------------------
#default
message ($${TARGET} config $${CONFIG})
message ($${TARGET} define $${DEFINES})

44
src/app_deploy.pri Normal file
View File

@ -0,0 +1,44 @@
#-------------------------------------------------------------
#user computer path settings
#-------------------------------------------------------------
#deploy root
CONFIG_PATH =
CONFIG_FILE =
win32 {
CONFIG_PATH = $$user_config_path()\\QQt
CONFIG_FILE = $${CONFIG_PATH}\\app.ini
} else {
CONFIG_PATH = $$user_config_path()/.QQt
CONFIG_FILE = $${CONFIG_PATH}/app.ini
}
message($${TARGET} config path: $$CONFIG_PATH config file: $${CONFIG_FILE})
!exists($${CONFIG_FILE}) {
empty_file($${CONFIG_FILE})
#qt4 need this ret, why?
ret = $$system(echo [$${TARGET}] >> $${CONFIG_FILE})
ret = $$system(echo APP_DEPLOY_ROOT = >> $${CONFIG_FILE})
}
isEmpty(APP_DEPLOY_ROOT): APP_DEPLOY_ROOT = $$read_ini("$${CONFIG_FILE}", "$${TARGET}", "APP_DEPLOY_ROOT")
message($${TARGET} deploy root: $$APP_DEPLOY_ROOT)
isEmpty(APP_DEPLOY_ROOT):error(APP_DEPLOY_ROOT required please check app.ini at $$CONFIG_PATH)
defineReplace(deploy_app_on_mac) {
#need QQT_BUILD_PWD
command = &&
command += rm -fr $${APP_DEPLOY_ROOT}/$${TARGET}.app &&
command += cp -fa $${DESTDIR}/$${TARGET}.app $${APP_DEPLOY_ROOT}/
message($$command)
return ($$command)
}
CONFIG += deploy_app
contains(CONFIG, deploy_app) {
contains(QKIT_PRIVATE, macOS) {
QMAKE_POST_LINK += $$deploy_app_on_mac()
}
}