1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 12:13:52 +00:00

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>
This commit is contained in:
ferdymercury 2024-12-11 05:25:21 +01:00 committed by GitHub
parent 063b2c911c
commit a4e5560c5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}
```