FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
Meson

FTXUI supports Meson as an alternative build system.

Prerequisites

  • C++17 compatible compiler (GCC >= 7, Clang >= 5, MSVC >= 2017)
  • Meson >= 1.1.0
  • Ninja (recommended backend)

Quick Start

# Configure (library only)
meson setup builddir
# Build
ninja -C builddir
# Install
ninja -C builddir install

Build Options

Option Default Description
examples false Build example applications
tests false Build and run tests

Build with examples

meson setup builddir -Dexamples=true
ninja -C builddir

Build with tests

meson setup builddir -Dtests=true
ninja -C builddir
meson test -C builddir

Build everything

meson setup builddir -Dexamples=true -Dtests=true
ninja -C builddir
meson test -C builddir

Dependencies

Google Test (tests only)

When tests are enabled, FTXUI depends on Google Test (v1.17.0).

The dependency resolution follows the same strategy as the CMake build:

  1. System-installed gtest: If gtest is available via pkg-config or system paths, it will be used directly.
  2. Automatic download (fallback): If not found on the system, Meson will automatically download gtest v1.17.0 via the WrapDB using the subprojects/gtest.wrap file.

No manual intervention is required — Meson handles this transparently.

Library Targets

The build produces three libraries:

Library Description
libftxui-screen Terminal rendering and input
libftxui-dom Layout and styling elements
libftxui-component Interactive UI components

Dependencies between them:

component → dom → screen

Using FTXUI as a Meson Subproject

To use FTXUI in your own Meson project, create a wrap file at subprojects/ftxui.wrap:

[wrap-git]
url = https://github.com/ArthurSonzogni/FTXUI.git
revision = v6.1.9
[provide]
ftxui-screen = ftxui_screen_dep
ftxui-dom = ftxui_dom_dep
ftxui-component = ftxui_component_dep

Then in your meson.build:

ftxui_component_dep = dependency('ftxui-component',
fallback: ['ftxui', 'ftxui_component_dep'],
)
executable('my_app',
'main.cpp',
dependencies: ftxui_component_dep,
)

Reconfiguring

To change options after initial configuration:

meson configure builddir -Dtests=true
ninja -C builddir

Clean Build

rm -rf builddir
meson setup builddir