summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2022-06-25 20:41:55 +0200
committerArthur LAURENT <[email protected]>2022-06-25 20:41:55 +0200
commit68a3eac3dcd93793f2ec8e73c86b02d031239f31 (patch)
treea23730120930bd26859ecb17eecfc3f6ca8c1fd9
parentad3d6a56521f7389b93bcac78a4f97969d1fb0dc (diff)
Support of custom QML2_IMPORT_PATH and auto-add output path to import custom qmlplugins
-rw-r--r--xmake/rules/qt/env/xmake.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/rules/qt/env/xmake.lua b/xmake/rules/qt/env/xmake.lua
index 4cc39794c..fa62fdf78 100644
--- a/xmake/rules/qt/env/xmake.lua
+++ b/xmake/rules/qt/env/xmake.lua
@@ -30,13 +30,18 @@ rule("qt.env")
qt = assert(find_qt(nil, {verbose = true}), "Qt SDK not found!")
target:data_set("qt", qt)
end
+
+ local qmlimportpath = target:get("qt.env.qmlimportpath") or {}
if target:is_plat("windows") or (target:is_plat("mingw") and is_host("windows")) then
target:add("runenvs", "PATH", qt.bindir)
- target:set("runenv", "QML2_IMPORT_PATH", qt.qmldir)
+ table.append(qmlimportpath, qt.qmldir)
+ -- add targetdir in QML2_IMPORT_PATH in case of the user have qml plugins
+ table.append(qmlimportpath, target:targetdir())
target:set("runenv", "QML_IMPORT_TRACE", "1")
elseif target:is_plat("msys", "cygwin") then
raise("please run `xmake f -p mingw --mingw=/mingw64` to support Qt/Mingw64 on Msys!")
end
+ target:set("runenv", "QML2_IMPORT_PATH", qmlimportpath)
end)