mirror of
https://github.com/jaredtao/TaoQuick.git
synced 2025-01-29 21:12:55 +08:00
simple import path
This commit is contained in:
parent
c7c9353ca1
commit
935f10efe2
@ -58,10 +58,7 @@ if (CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
${TaoQuickRes}
|
||||
)
|
||||
endif()
|
||||
add_compile_definitions(qmlPath="qrc:/Qml/")
|
||||
add_compile_definitions(contentsPath="qrc:/Contents/")
|
||||
add_compile_definitions(imgPath="qrc:/Image/")
|
||||
add_compile_definitions(transDir=":/Trans/")
|
||||
add_compile_definitions(TaoQuickShowPath="qrc:/")
|
||||
else()
|
||||
add_executable(${TargetName}
|
||||
${SRC1}
|
||||
@ -69,10 +66,7 @@ else()
|
||||
${TaoCommonFiles}
|
||||
)
|
||||
add_compile_definitions(TAODEBUG)
|
||||
add_compile_definitions(qmlPath="file:///${CMAKE_CURRENT_SOURCE_DIR}/Qml/")
|
||||
add_compile_definitions(contentsPath="file:///${CMAKE_CURRENT_SOURCE_DIR}/Contents/")
|
||||
add_compile_definitions(imgPath="file:///${CMAKE_CURRENT_SOURCE_DIR}/Image/")
|
||||
add_compile_definitions(transDir="${CMAKE_CURRENT_SOURCE_DIR}/Trans/")
|
||||
add_compile_definitions(TaoQuickShowPath="file:///${CMAKE_CURRENT_SOURCE_DIR}/")
|
||||
endif()
|
||||
|
||||
target_include_directories(${TargetName} PUBLIC . ./Src ${TaoCommonPath})
|
||||
|
@ -1,7 +1,11 @@
|
||||
#include "AppInfo.h"
|
||||
#include "DeviceAddTable/DeviceAddModel.h"
|
||||
#include "Frameless/TaoFrameLessView.h"
|
||||
|
||||
#ifndef TAODEBUG
|
||||
#include "Logger/Logger.h"
|
||||
#endif
|
||||
|
||||
#include "QuickTool/QuickTool.h"
|
||||
#include "Trans/Trans.h"
|
||||
#include <QDir>
|
||||
@ -11,10 +15,6 @@
|
||||
#include <QQuickItem>
|
||||
#include <QUrl>
|
||||
|
||||
#ifdef QMAKE_GEN_TAOMACRO
|
||||
#include "taoMacro.h"
|
||||
#endif
|
||||
|
||||
static void prepareApp()
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
@ -42,6 +42,22 @@ int main(int argc, char** argv)
|
||||
const auto appPath = QDir::cleanPath(app.applicationDirPath());
|
||||
qWarning() << "appPath" << appPath;
|
||||
|
||||
QString taoQuickShowPath = TaoQuickShowPath;
|
||||
QString transDir = taoQuickShowPath + "Trans/";
|
||||
if (transDir.startsWith("file:///"))
|
||||
{
|
||||
transDir = transDir.remove("file:///");
|
||||
}
|
||||
if (transDir.startsWith("qrc:/"))
|
||||
{
|
||||
transDir = transDir.remove("qrc");
|
||||
}
|
||||
QString qmlPath = taoQuickShowPath + "Qml/";
|
||||
QString imgPath = taoQuickShowPath + "Image/";
|
||||
QString contentsPath = taoQuickShowPath + "Contents/";
|
||||
qWarning() << "qmlPath" << qmlPath;
|
||||
qWarning() << "imgPath" << imgPath;
|
||||
qWarning() << "contentsPath" << contentsPath;
|
||||
Trans trans;
|
||||
AppInfo appInfo;
|
||||
QuickTool quickTool;
|
||||
@ -83,10 +99,10 @@ int main(int argc, char** argv)
|
||||
view.rootContext()->setContextProperty("scrollBarHasMinimumSize", false);
|
||||
#endif
|
||||
|
||||
view.rootContext()->setContextProperty("appPath", appPath);
|
||||
view.rootContext()->setContextProperty("qmlPath", qmlPath);
|
||||
view.rootContext()->setContextProperty("imgPath", imgPath);
|
||||
view.rootContext()->setContextProperty("contentsPath", contentsPath);
|
||||
view.rootContext()->setContextProperty("appPath", appPath);
|
||||
view.rootContext()->setContextProperty("view", &view);
|
||||
view.rootContext()->setContextProperty("quickTool", &quickTool);
|
||||
|
||||
|
@ -20,38 +20,17 @@ CONFIG(debug, debug|release) {
|
||||
} else {
|
||||
path=$$system("pwd")
|
||||
}
|
||||
qmlPath = \"file:///$${path}/Qml/\"
|
||||
contentsPath = \"file:///$${path}/Contents/\"
|
||||
imgPath = \"file:///$${path}/Image/\"
|
||||
transDir=\"$${path}/Trans/\"
|
||||
DEFINES +=TaoQuickShowPath=\\\"file:///$${path}/\\\"
|
||||
|
||||
OTHER_FILES += $$files($$path/Qml/*.qml, true)
|
||||
OTHER_FILES += $$files($$path/Contents/*.qml, true)
|
||||
# DEFINES += qmlPath=\\\"file:///$$PWD/Qml/\\\"
|
||||
# DEFINES += contentsPath=\\\"file:///$$PWD/Contents/\\\"
|
||||
# DEFINES += imgPath=\\\"file:///$$PWD/Image/\\\"
|
||||
|
||||
} else {
|
||||
#release模式用qrc、走资源文件。这样发布不会携带源码。
|
||||
RESOURCES += \
|
||||
$$PWD/Qml.qrc \
|
||||
$$PWD/Image.qrc \
|
||||
$$PWD/Contents.qrc
|
||||
|
||||
qmlPath = \"qrc:/Qml/\"
|
||||
contentsPath = \"qrc:/Contents/\"
|
||||
imgPath = \"qrc:/Image/\"
|
||||
transDir= \":/Trans/\"
|
||||
# DEFINES += qmlPath=\\\"qrc:/Qml/\\\"
|
||||
# DEFINES += contentsPath=\\\"qrc:/Contents/\\\"
|
||||
# DEFINES += imgPath=\\\"qrc:/Image/\\\"
|
||||
DEFINES +=TaoQuickShowPath=\\\"qrc:/\\\"
|
||||
}
|
||||
|
||||
#!android:!ios {
|
||||
|
||||
# CONFIG += file_copies
|
||||
|
||||
# trans.files = $$PWD/Trans/language_zh.json
|
||||
# trans.path = $$DESTDIR/Trans
|
||||
# COPIES += trans
|
||||
#}
|
||||
#OTHER_FILES += $$PWD/Trans/language_zh.json
|
||||
|
@ -29,19 +29,6 @@ CONFIG(debug,debug|release) {
|
||||
include($${TaoQuick_3RDPARTY_TREE}/TaoCommon/src/TaoCommon/TaoCommon.pri)
|
||||
include($${TaoQuick_SOURCE_TREE}/src/TaoQuick.pri)
|
||||
include(TaoQuickShow.pri)
|
||||
DEFINES += QMAKE_GEN_TAOMACRO
|
||||
!build_pass {
|
||||
headerContents = \
|
||||
"$${LITERAL_HASH}pragma once" \
|
||||
"$${LITERAL_HASH}define TaoQuickImportPath $${TaoQuickImportPath}" \
|
||||
"$${LITERAL_HASH}define qmlPath $${qmlPath}" \
|
||||
"$${LITERAL_HASH}define contentsPath $${contentsPath}" \
|
||||
"$${LITERAL_HASH}define imgPath $${imgPath}" \
|
||||
"$${LITERAL_HASH}define transDir $${transDir}"
|
||||
|
||||
write_file(taoMacro.h, headerContents)
|
||||
}
|
||||
|
||||
|
||||
win32:!mingw {
|
||||
RC_FILE = App.rc
|
||||
|
@ -24,32 +24,15 @@ defineTest(setTaoVersion) {
|
||||
VER_PAT = $${PAT}
|
||||
VERSION = $${Ver}
|
||||
}
|
||||
TaoREVISION=$${REVISION}
|
||||
TaoREVISIONSTR=\"$${REVISION}\"
|
||||
TaoVer=\"$${Ver}\"
|
||||
TaoMAJ=$${MAJ}
|
||||
TaoMIN=$${MIN}
|
||||
TaoPAT=$${PAT}
|
||||
TaoDATETIME=\"$${_DATE_}\"
|
||||
CXX_COMPILER_ID=\"$${QMAKE_COMPILER}\"
|
||||
|
||||
export(TaoREVISION)
|
||||
export(TaoREVISIONSTR)
|
||||
export(TaoVer)
|
||||
export(TaoMAJ)
|
||||
export(TaoMIN)
|
||||
export(TaoPAT)
|
||||
export(TaoDATETIME)
|
||||
export(CXX_COMPILER_ID)
|
||||
|
||||
DEFINES += TaoREVISION=$${REVISION}
|
||||
DEFINES += TaoREVISIONSTR=\"\\\"$${REVISION}\\\"\"
|
||||
DEFINES += TaoVer=\"\\\"$${Ver}\\\"\"
|
||||
DEFINES += TaoMAJ=$${MAJ}
|
||||
DEFINES += TaoMIN=$${MIN}
|
||||
DEFINES += TaoPAT=$${PAT}
|
||||
DEFINES += TaoDATETIME=\"\\\"$${_DATE_}\\\"\"
|
||||
DEFINES += CXX_COMPILER_ID=\"\\\"$${QMAKE_COMPILER}\\\"\"
|
||||
DEFINES *= TaoREVISION=$${REVISION}
|
||||
DEFINES *= TaoREVISIONSTR=\"\\\"$${REVISION}\\\"\"
|
||||
DEFINES *= TaoVer=\"\\\"$${Ver}\\\"\"
|
||||
DEFINES *= TaoMAJ=$${MAJ}
|
||||
DEFINES *= TaoMIN=$${MIN}
|
||||
DEFINES *= TaoPAT=$${PAT}
|
||||
DEFINES *= TaoDATETIME=\"\\\"$${_DATE_}\\\"\"
|
||||
DEFINES *= CXX_COMPILER_ID=\"\\\"$${QMAKE_COMPILER}\\\"\"
|
||||
|
||||
export(CONFIG)
|
||||
export(VER_MAJ)
|
||||
|
Loading…
x
Reference in New Issue
Block a user