Install Git LFS first; the fonts are stored in LFS. Then add TachyonUI as a submodule:
mkdir my_app
cd my_app
git init
git submodule add https://github.com/LogicalError/TachyonUI.git external/TachyonUI
git submodule update --init --recursive
--recursive fetches TachyonUI's dependencies, such as SDL and HarfBuzz, so the build
needs no network.
The project's layout:
my_app/
CMakeLists.txt
my_app.h the panels and the app class
my_app.cpp what the panels and the app draw
main.cpp
external/TachyonUI/
cmake_minimum_required(VERSION 3.22)
project(my_app LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(external/TachyonUI)
add_executable(my_app main.cpp my_app.cpp my_app.h)
target_link_libraries(my_app PRIVATE TachyonUI::gui_docking TachyonUI::gui_controls TachyonUI::gui_backend_default)-
gui_controlsis the UI, andgui_backend_defaultthe backends it draws and opens windows with: Vulkan (Metal on macOS) and SDL. -
gui_dockingis the docked panels the app is made of, a library on top ofgui_controls. -
Shaders, theme and fonts are built in, and SDL is linked in. No files or DLLs go next to the program.
-
As a subproject, TachyonUI builds only its libraries, not its examples or tests.
-
For an installed TachyonUI, replace
add_subdirectorywithfind_package(TachyonUI 1.1 CONFIG REQUIRED); see Adding the library to a build.
cmake -S . -B build
cmake --build build --config Debug
- On Linux and macOS, add
-G "Ninja Multi-Config"to the first line. - The first configure builds the third-party libraries. This takes a few minutes, once.
- The build fails until the three source files exist; the next steps write them.