Add meson documentation (#761)

This commit is contained in:
MaxBrandtner 2023-07-03 03:35:30 +02:00 committed by GitHub
parent 766dd9d590
commit 543c28869e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ Ultralightweight JSON parser in ANSI C.
* [Copying the source](#copying-the-source) * [Copying the source](#copying-the-source)
* [CMake](#cmake) * [CMake](#cmake)
* [Makefile](#makefile) * [Makefile](#makefile)
* [Meson](#meson)
* [Vcpkg](#Vcpkg) * [Vcpkg](#Vcpkg)
* [Including cJSON](#including-cjson) * [Including cJSON](#including-cjson)
* [Data Structure](#data-structure) * [Data Structure](#data-structure)
@ -145,6 +146,23 @@ make all
If you want, you can install the compiled library to your system using `make install`. By default it will install the headers in `/usr/local/include/cjson` and the libraries in `/usr/local/lib`. But you can change this behavior by setting the `PREFIX` and `DESTDIR` variables: `make PREFIX=/usr DESTDIR=temp install`. And uninstall them with: `make PREFIX=/usr DESTDIR=temp uninstall`. If you want, you can install the compiled library to your system using `make install`. By default it will install the headers in `/usr/local/include/cjson` and the libraries in `/usr/local/lib`. But you can change this behavior by setting the `PREFIX` and `DESTDIR` variables: `make PREFIX=/usr DESTDIR=temp install`. And uninstall them with: `make PREFIX=/usr DESTDIR=temp uninstall`.
#### Meson
To make cjson work in a project using meson, the libcjson dependency has to be included:
```meson
project('c-json-example', 'c')
cjson = dependency('libcjson')
example = executable(
'example',
'example.c',
dependencies: [cjson],
)
```
#### Vcpkg #### Vcpkg
You can download and install cJSON using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: You can download and install cJSON using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: