Getting started with AUI#
IDE#
- Recommended as "out of the box" crossplatform solution.
- Has free version for non-commercial development.
- No additional setup required.
- 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. |
- Add these lines to your
settings.json
(F1> Preferences: Open User Settings (JSON)
):
OS prerequirements#
Install msvc or clang, if you haven't already, and reboot. Also, if you use CLion:
- Ctrl+Shift+S, navigate to "Build, Execution, Deployment" > "Toolchains".
- Press
+
. - Choose Visual Studio. CLion should pick up it automatically.
- Select Visual Studio.
- Press "arrow up" button to raise priority. Visual Studio compiler should be by default!
- Press OK.
Install Xcode.
Install following dependencies:
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:
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.
# 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
:
# 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 | |
---|---|
|
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:
Build and Run Your App#
See layout managers for more info about layout managers.
See ASS for more info about styling.
See Examples for examples.