graph TD
A[project_template_ui_xmake] --> B[xmake.lua]
A --> C[src/]
C --> D[MainWindow.h]
C --> E[MainWindow.cpp]
C --> F[main.cpp]
A --> G[.vscode/]
G --> H[c_cpp_properties.json]
-- Specify available build configurationsadd_rules("mode.release","mode.debug")-- Specify compile commands output directory and LSP to analyze C++ code files and highlight IntelliSenseadd_rules("plugin.compile_commands.autoupdate",{outputdir=".vscode",lsp="clangd"})-- Specify C++ standard to use, as AUI uses C++20 by defaultset_languages("c++20")-- Download aui package to use for targets lateradd_requires("aui")-- Use shared GLEW to resolve LNK2019 errorsadd_requireconfs("**.glew",{override=true,configs={shared=true}})-- Define our target executable to buildtarget("aui-minimal-example")-- Add source code and headers to targetadd_files("src/*.cpp")add_includedirs("src")-- Add AUI package to target while linking only required componentsadd_packages("aui",{components={"core","image","views","xml"}})-- Add defines that point to your OS and link against required syslinks/frameworksifis_plat("windows")thenadd_defines("AUI_PLATFORM_WIN=1","AUI_PLATFORM_LINUX=0","AUI_PLATFORM_APPLE=0")add_syslinks("gdi32","ole32")elseifis_plat("linux")thenadd_defines("AUI_PLATFORM_WIN=0","AUI_PLATFORM_LINUX=1","AUI_PLATFORM_APPLE=0")elseifis_plat("macosx")thenadd_defines("AUI_PLATFORM_WIN=0","AUI_PLATFORM_LINUX=0","AUI_PLATFORM_APPLE=1")end-- Add defines that point to symbol exportsadd_defines("API_AUI_VIEWS=AUI_IMPORT","API_AUI_IMAGE=AUI_IMPORT")
#include"MainWindow.h"#include<AUI/Util/UIBuildingHelpers.h>#include<AUI/View/ALabel.h>#include<AUI/View/AButton.h>#include<AUI/Platform/APlatform.h>usingnamespacedeclarative;MainWindow::MainWindow():AWindow("Project template app",300_dp,200_dp){setContents(Centered{Vertical{Centered{Label{"Hello world from AUI!"}},_new<AButton>("Visit GitHub repo").connect(&AView::clicked,this,[]{APlatform::openUrl("https://github.com/aui-framework/aui");}),_new<AButton>("Visit docs").connect(&AView::clicked,this,[]{APlatform::openUrl("https://aui-framework.github.io/");}),_new<AButton>("Submit an issue").connect(&AView::clicked,this,[]{APlatform::openUrl("https://github.com/aui-framework/aui/issues/new");}),}});}
#include<AUI/Util/UIBuildingHelpers.h>#include<AUI/View/ALabel.h>#include<AUI/View/AButton.h>#include<AUI/Platform/APlatform.h>usingnamespacedeclarative;MainWindow::MainWindow():AWindow("Project template app",300_dp,200_dp){setContents(Centered{Vertical{Centered{Label{"Hello world from AUI!"}},_new<AButton>("Visit GitHub repo").connect(&AView::clicked,this,[]{APlatform::openUrl("https://github.com/aui-framework/aui");}),_new<AButton>("Visit docs").connect(&AView::clicked,this,[]{APlatform::openUrl("https://aui-framework.github.io/");}),_new<AButton>("Submit an issue").connect(&AView::clicked,this,[]{APlatform::openUrl("https://github.com/aui-framework/aui/issues/new");}),}});}