Skip to content

Getting started with AUI#

IDE#

  • Recommended as "out of the box" crossplatform solution.
  • Has free version for non-commercial development.
  • No additional setup required.
  1. Install following extensions:
Extension Description
cpp tools pack Introduces basic C/C++ support and CMake integration.
vscode-clangd C++ language server for extensive code navigation, autocomplete, etc.
  1. Add these lines to your settings.json (F1 > Preferences: Open User Settings (JSON)):
settings.json
"clangd.arguments": [
    "--compile-commands-dir=build/"
],

OS prerequirements#

Install msvc or clang, if you haven't already, and reboot. Also, if you use CLion:

  1. Ctrl+Shift+S, navigate to "Build, Execution, Deployment" > "Toolchains".
  2. Press +.
  3. Choose Visual Studio. CLion should pick up it automatically.

  1. Select Visual Studio.
  2. Press "arrow up" button to raise priority. Visual Studio compiler should be by default!
  3. Press OK.

Install Xcode.

Install following dependencies:

sudo apt update
sudo apt install pkg-config libglew-dev zlib1g-dev libssl-dev libcurl4-openssl-dev libgtk-3-dev libdbus-1-dev libfontconfig-dev ninja-build libpulse-dev git cmake g++

Install following dependencies:

sudo dnf install fontconfig-devel gtk3-devel dbus-devel libXi libglvnd-devel libstdc++-static glew-devel pulseaudio-libs-devel git cmake g++

Installation#

AUI does not provide "traditional" installation methods that involve manual downloading and deploying; instead, package managers are used to ensure easily reproducible builds. They compile and link all required dependencies automatically to free you from dependency management and focus you right to development of your application.

You can use our App Template ⚡ to set up a new project quickly with AUI's .clang-format, Github Actions and other features out-of-the-box. The template is based on CMake and aui.boot.

Clone https://github.com/aui-framework/example_app with your IDE or via terminal:

git clone https://github.com/aui-framework/example_app

and open that directory in your IDE.

AUI provides support to several package managers, to choose at your own.

aui.boot is *official* way of using AUI. It is a CMake-based package manager that requires nothing but CMake.

CMakeLists.txt
# Standard routine
cmake_minimum_required(VERSION 3.16)
project(project_template)

# Use AUI.Boot
file(
    DOWNLOAD 
    https://raw.githubusercontent.com/aui-framework/aui/master/aui.boot.cmake 
    ${CMAKE_CURRENT_BINARY_DIR}/aui.boot.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/aui.boot.cmake)

# import AUI
auib_import(
    aui https://github.com/aui-framework/aui 
    COMPONENTS core views
    VERSION v8.0.0-rc.8
    )


# Create the executable. This function automatically links all sources from the src/ folder, creates CMake target and
# places the resulting executable to bin/ folder.
aui_executable(project_template)

# Link required libs
aui_link(project_template PRIVATE aui::core aui::views)

CMake's missing package manager is a small CMake script for setup-free, cross-platform, reproducible dependency management.

Download CPM to your project directory:

mkdir -p cmake
wget -O cmake/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake

Then, create a CMakeLists.txt:

CMakeLists.txt
# Standard routine
cmake_minimum_required(VERSION 3.16)
project(project_template)

# import AUI
include(cmake/CPM.cmake)
CPMAddPackage("gh:aui-framework/aui#v7.1.2")

# Create the executable. This function automatically links all sources from the src/ folder, creates CMake target and
# places the resulting executable to bin/ folder.
aui_executable(project_template)

# Link required libs
aui_link(project_template PRIVATE aui::core aui::views)

aui_executable hooks all CPP files from src/ directory. You need to create src/ directory and a CPP file in it.

src/main.cpp
/*
 * AUI Framework - Declarative UI toolkit for modern C++20
 * Copyright (C) 2020-2025 Alex2772 and Contributors
 *
 * SPDX-License-Identifier: MPL-2.0
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#include <AUI/Platform/Entry.h>
#include <AUI/Platform/AWindow.h>
#include <AUI/Util/UIBuildingHelpers.h>
#include <AUI/View/AButton.h>

using namespace ass;
using namespace declarative;

AUI_ENTRY {
    auto window = _new<AWindow>("Button", 600_dp, 300_dp);
    window->setContents(Centered {
      Button { "Click me" },
    });
    window->show();
    return 0;
}

Why CMake or IDE doesn't recognize a new CPP file?

This indicates that the IDE's build system needs to be initialized or refreshed.

Reload CMake project to hook up a newly added CPP file:

File > Reload CMake Project or right-click on CMakeLists.txt > Load/Reload CMake project.

  1. Please make sure you have followed setup procedure listed in the beginning on this page.
  2. F1 >CMake: Configure. If it asks for a toolchain, choose Unspecified.
cmake -S . -B build

Build and Run Your App#

Run -> Run "project name" or green arrow in top right corner.

  1. F1 >CMake: Configure.
  2. Choose CMake logo in the left panel (where the extensions tab live).
  3. Right click on project's target > Set Build target and Set Launch/Debug target.
  4. F1 >CMake: Debug.
cmake -S . -B build
cmake --build build

See layout managers for more info about layout managers.

See ASS for more info about styling.

See Examples for examples.