summaryrefslogtreecommitdiff
path: root/tests/plugins/pack/qtapp/xmake.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/plugins/pack/qtapp/xmake.lua')
-rw-r--r--tests/plugins/pack/qtapp/xmake.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/plugins/pack/qtapp/xmake.lua b/tests/plugins/pack/qtapp/xmake.lua
new file mode 100644
index 000000000..fb10ae741
--- /dev/null
+++ b/tests/plugins/pack/qtapp/xmake.lua
@@ -0,0 +1,33 @@
+set_version("1.0.0")
+add_rules("mode.debug", "mode.release")
+
+includes("@builtin/xpack")
+
+target("qtapp")
+ add_rules("qt.widgetapp")
+ add_headerfiles("src/*.h")
+ add_files("src/*.cpp")
+ add_files("src/mainwindow.ui")
+ add_files("src/mainwindow.h")
+
+xpack("qtapp")
+ set_formats("nsis", "dmg", "appimage", "zip", "targz")
+ set_title("Qt Widget App")
+ set_author("ruki <[email protected]>")
+ set_description("A Qt Widget Application example for xpack.")
+ set_homepage("https://xmake.io")
+ set_license("Apache-2.0")
+ set_licensefile("LICENSE.md")
+ add_targets("qtapp")
+
+ on_load(function (package)
+ package:set("basename", "qtapp-$(plat)-$(arch)-v$(version)")
+ -- set icon file based on format (use PNG for appimage, ICO for other formats)
+ local scriptdir = os.scriptdir()
+ if package:format() == "appimage" then
+ package:set("iconfile", path.join(scriptdir, "src/assets/xmake.png"))
+ else
+ package:set("iconfile", path.join(scriptdir, "src/assets/xmake.ico"))
+ end
+ end)
+