mirror of
https://github.com/jaredtao/TaoQuick.git
synced 2025-01-17 20:12:54 +08:00
update ImportPath
This commit is contained in:
parent
0b28f66691
commit
a258edde9d
@ -26,7 +26,8 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/3rdparty/TaoCommon/src/TaoCommon ${CMAKE_SO
|
||||
|
||||
|
||||
|
||||
include(taoQuick)
|
||||
include(${PROJECT_SOURCE_DIR}/src/taoQuick.cmake)
|
||||
|
||||
message("TaoQuickRes ${TaoQuickRes}")
|
||||
set (Res Qml.qrc Contents.qrc Image.qrc)
|
||||
if (CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
|
@ -53,10 +53,10 @@ int main(int argc, char** argv)
|
||||
appInfo.beforeUiReady(view.rootContext());
|
||||
|
||||
view.engine()->addImportPath(qmlPath);
|
||||
#ifdef TaoQuickImport
|
||||
view.engine()->addImportPath(TaoQuickImport);
|
||||
view.rootContext()->setContextProperty("taoQuickImportPath", TaoQuickImport);
|
||||
qWarning() << "TaoQuickImportPath " << TaoQuickImport;
|
||||
#ifdef TaoQuickImportPath
|
||||
view.engine()->addImportPath(TaoQuickImportPath);
|
||||
view.rootContext()->setContextProperty("taoQuickImportPath", TaoQuickImportPath);
|
||||
qWarning() << "TaoQuickImportPath " << TaoQuickImportPath;
|
||||
#endif
|
||||
|
||||
#ifdef TAODEBUG
|
||||
|
@ -33,7 +33,7 @@ DEFINES += QMAKE_GEN_TAOMACRO
|
||||
!build_pass {
|
||||
headerContents = \
|
||||
"$${LITERAL_HASH}pragma once" \
|
||||
"$${LITERAL_HASH}define TaoQuickImport $${TaoQuickImport}" \
|
||||
"$${LITERAL_HASH}define TaoQuickImportPath $${TaoQuickImportPath}" \
|
||||
"$${LITERAL_HASH}define qmlPath $${qmlPath}" \
|
||||
"$${LITERAL_HASH}define contentsPath $${contentsPath}" \
|
||||
"$${LITERAL_HASH}define imgPath $${imgPath}" \
|
||||
|
@ -6,8 +6,6 @@ CONFIG(debug,debug|release){
|
||||
} else {
|
||||
path=$$system("pwd")
|
||||
}
|
||||
TaoQuickImport=\"file:///$$path/\"
|
||||
TaoQuickImage=\"file:///$$path/TaoQuick/Images/\"
|
||||
DEFINES += TaoQuickImportPath=\\\"file:///$${path}/\\\"
|
||||
|
||||
OTHER_FILES += $$files($$path/TaoQuick/Qml/*.qml, true)
|
||||
@ -16,8 +14,6 @@ CONFIG(debug,debug|release){
|
||||
# release mode use qrc file
|
||||
RESOURCES += $$PWD/TaoQuick/TaoQuick.qrc
|
||||
# release mode set importPath with 'qrc:///'
|
||||
TaoQuickImport=\"qrc:/\"
|
||||
TaoQuickImage=\"qrc:/TaoQuick/Images/\"
|
||||
DEFINES += TaoQuickImportPath=\\\"qrc:///\\\"
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,13 @@
|
||||
set(TaoQuickPath ${CMAKE_SOURCE_DIR}/src)
|
||||
set(TaoQuickPath ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
if (CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
set(TaoQuickRes ${TaoQuickPath}/TaoQuick/TaoQuick.qrc CACHE STRING "tao quick res path")
|
||||
set(TaoQuickImport "qrc:///" CACHE STRING "tao quick import path")
|
||||
set(TaoQuickImportPath "qrc:///" CACHE STRING "tao quick import path")
|
||||
else()
|
||||
set(TaoQuickImport "file:///${TaoQuickPath}/" CACHE STRING "tao quick import path")
|
||||
set(TaoQuickImportPath "file:///${TaoQuickPath}/" CACHE STRING "tao quick import path")
|
||||
endif()
|
||||
|
||||
add_compile_definitions(TaoQuickImport="${TaoQuickImport}")
|
||||
add_compile_definitions(TaoQuickImage="${TaoQuickImage}")
|
||||
|
||||
add_compile_definitions(TaoQuickImportPath="${TaoQuickImport}")
|
||||
add_compile_definitions(TaoQuickImportPath="${TaoQuickImportPath}")
|
||||
|
||||
#add_compile_definitions(QML_IMPORT_PATH="${TaoQuickPath}")
|
||||
#add_compile_definitions(QML2_IMPORT_PATH="${TaoQuickPath}")
|
Loading…
x
Reference in New Issue
Block a user