From a4e5560c5d05bef5dac0c948fb305195c3b8c254 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 11 Dec 2024 05:25:21 +0100 Subject: [PATCH] mention how to install from Linux system packages (#1102) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- book/chapters/installation.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/book/chapters/installation.md b/book/chapters/installation.md index 5ac74339..f44fe8d6 100644 --- a/book/chapters/installation.md +++ b/book/chapters/installation.md @@ -276,3 +276,32 @@ them are unknown yet. If building with WASI it is necessary to add the flag `-lc-printscan-long-double` to the build to allow long double support. See #841 for more details. + +## Default system packages on Linux + +If you are not worried about latest features or recent bug fixes, you can +install a stable version of CLI11 using: + +`sudo apt install libcli11-dev` for Ubuntu, or: `sudo dnf install cli11-devel` +on Fedora/Almalinux. + +Then, in your CMake project, just call: + +```cmake +find_package(CLI11 CONFIG REQUIRED) +target_link_libraries(MyTarget PRIVATE CLI11::CLI11) +``` + +and in your C++ file: + +```cpp +#include "CLI/App.hpp" +#include "CLI/Formatter.hpp" +#include "CLI/Config.hpp" + +int main(int argc, char** argv)) { + CLI::App app{"MyApp"}; + // Here your flags / options + CLI11_PARSE(app, argc, argv); +} +```