diff options
| author | ruki <[email protected]> | 2022-06-27 10:34:42 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-06-27 10:34:42 +0800 |
| commit | 3abef95f7d8b15e88179128ecd2cbca1385c8361 (patch) | |
| tree | 5056a6f8ff20e6232cd342155df0e194c18c62e7 | |
| parent | f5471d15f8b0c45096dd00180b68a796fa544519 (diff) | |
| parent | cc71abf732f2e45f93674f65a1e2daba161315bd (diff) | |
Merge pull request #2497 from Arthapz/qml-import-path
Support of custom QML2_IMPORT_PATH and auto-add output path to import custom qmlplugins
| -rw-r--r-- | xmake/rules/qt/env/xmake.lua | 7 |
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..592ef07d9 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:values("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) |
