|
ttx 0.1.0
|
This package can be built either directly through CMake or using nix.
ttx application and not the terminal emulation library itself.The dius library will be found using CMake find_package unless the source is available at the path specified by ttx_dius_DIRECTORY. By default, that CMake variable is set ./dius. When using nix, the library's flake is included automatically.
The recommended setup for building ttx from source involves the following shell commands.
To manually build ttx and its library, use the following commands.
This project exports a CMake package to be used with the find_package command of CMake:
ttxttx::ttxIn general, you can either include find_package(ttx REQUIRED) somewhere in your CMake build or call add_subdirectory on the ttx source code. When using find_package, it probably makes sense to use fetch content to download the library during the build. When using add_subdirectory, this project can be included as a git submodule. Because CMake is CMake, there's several other ways to make things work, and this library tries to be as flexible as possible so that both of the above methods will succeed.
Afterwards, use the library via target_link_libraries(target PRIVATE ttx::ttx).
Any ttx package should depend on fzf as ttx requires the fzf program to be in the user's PATH on application startup.
The CMAKE_INSTALL_INCLUDEDIR is set to a path other than just include if the project is configured as a top level project to avoid indirectly including other libraries when installed to a common prefix. Please review the install-rules.cmake file for the full set of install rules.
This section assumes you are interested in the ttx library. See [./install.md] for instructions on installing the ttx application using nix.
To consume the library in your flake, add ttx as an input:
Then include inputs.ttx.packages.${system}.ttx-lib in the buildInputs of your derivation. Assuming your project is using CMake, find_package(ttx) will succeed automatically.
This flake provides takes the di and dius libraries as a flake input, so it can be overridden easily. The fzf dependency is taken from nixpkgs (which is also easy to override), and the ttx binary is wrapped by nix to ensure fzf will be in the PATH variable when running ttx.
Alternatively, use the nix command to build the library manually.
This outputs the result to ./result.