|
7 | 7 | [](https://coveralls.io/github/KazDragon/terminalpp?branch=master) |
8 | 8 | [](https://www.codacy.com/gh/KazDragon/terminalpp/dashboard?utm_source=github.com&utm_medium=referral&utm_content=KazDragon/terminalpp&utm_campaign=Badge_Grade) |
9 | 9 |
|
10 | | -# Terminal++ |
11 | 10 | A C++ library for interacting with ANSI/VT100 terminal or terminal emulator displays. |
12 | 11 |
|
13 | | -# Requirements |
| 12 | +## Requirements |
| 13 | + |
| 14 | +- C++20 compiler |
| 15 | +- CMake 3.16+ |
| 16 | +- Boost 1.69+ (required) |
| 17 | +- Google Test (for tests only) |
| 18 | + |
| 19 | +## Build And Install (From Source) |
| 20 | + |
| 21 | +```bash |
| 22 | +git clone https://github.com/KazDragon/terminalpp.git |
| 23 | +cd terminalpp |
| 24 | + |
| 25 | +cmake -S . -B build \ |
| 26 | + -DCMAKE_BUILD_TYPE=Release \ |
| 27 | + -DCMAKE_INSTALL_PREFIX="$HOME/.local" |
| 28 | + |
| 29 | +cmake --build build --config Release |
| 30 | +cmake --install build --config Release |
| 31 | +``` |
| 32 | + |
| 33 | +## Dependency Resolution With vcpkg |
14 | 34 |
|
15 | | -Terminal++ requires a C++20 compiler and the following libraries: |
16 | | - * Boost (At least version 1.69.0) |
17 | | - * (For testing only) Google Test |
| 35 | +Terminal++ can resolve dependencies automatically through `vcpkg`: |
18 | 36 |
|
19 | | -# Installation - CMake |
| 37 | +```bash |
| 38 | +cmake -S . -B build \ |
| 39 | + -DCMAKE_BUILD_TYPE=Release \ |
| 40 | + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" |
| 41 | +``` |
| 42 | + |
| 43 | +When using manifest mode (`vcpkg.json` in this repository), configure will |
| 44 | +trigger dependency installation automatically. |
| 45 | + |
| 46 | +## Consume From CMake (Installed Package) |
| 47 | + |
| 48 | +```cmake |
| 49 | +cmake_minimum_required(VERSION 3.16) |
| 50 | +project(my_app LANGUAGES CXX) |
20 | 51 |
|
21 | | -Terminal++ can be installed from source using CMake. This requires Boost and any other dependencies to have been installed beforehand, using their own instructions, or for the call to `cmake --configure` to be adjusted appropriately (e.g. `-DBOOST_ROOT=...`). If you do not wish to install into a system directory, and thus avoid the use of sudo, you can also pass `-DCMAKE_INSTALL_PREFIX=...` into the `cmake --configure` call. |
| 52 | +find_package(terminalpp CONFIG REQUIRED) |
22 | 53 |
|
23 | | - git clone https://github.com/KazDragon/terminalpp.git && cd terminalpp |
24 | | - mkdir build && cd build |
25 | | - cmake --configure -DCMAKE_BUILD_TYPE=Release .. |
26 | | - cmake --build . |
27 | | - sudo cmake --install . |
| 54 | +add_executable(my_app main.cpp) |
| 55 | +target_link_libraries(my_app PRIVATE KazDragon::terminalpp) |
| 56 | +``` |
| 57 | + |
| 58 | +If installed to a non-system prefix: |
| 59 | + |
| 60 | +```bash |
| 61 | +cmake -S . -B build -DCMAKE_PREFIX_PATH="$HOME/.local" |
| 62 | +``` |
28 | 63 |
|
29 | 64 | # Features / Roadmap |
30 | 65 |
|
|
0 commit comments