mirror of
https://github.com/nlohmann/json.git
synced 2025-07-29 23:01:16 +03:00
📝 add documentation for integration via vcpkg
This commit is contained in:
@ -110,7 +110,40 @@ If you are using [Buckaroo](https://buckaroo.pm), you can install this library's
|
||||
|
||||
## vcpkg
|
||||
|
||||
If you are using [vcpkg](https://github.com/Microsoft/vcpkg/) on your project for external dependencies, then you can use the [nlohmann-json package](https://github.com/Microsoft/vcpkg/tree/master/ports/nlohmann-json). Please see the vcpkg project for any issues regarding the packaging.
|
||||
If you are using [vcpkg](https://github.com/Microsoft/vcpkg/) on your project for external dependencies, then you can install the [nlohmann-json package](https://github.com/Microsoft/vcpkg/tree/master/ports/nlohmann-json) with `vcpkg install nlohmann-json` and follow the then displayed descriptions. Please see the vcpkg project for any issues regarding the packaging.
|
||||
|
||||
??? example
|
||||
|
||||
1. Create the following files:
|
||||
|
||||
=== "CMakeLists.txt"
|
||||
|
||||
```cmake
|
||||
--8<-- "integration/vcpkg/CMakeLists.txt"
|
||||
```
|
||||
|
||||
=== "example.cpp"
|
||||
|
||||
```cpp
|
||||
--8<-- "integration/vcpkg/example.cpp"
|
||||
```
|
||||
|
||||
2. Install package:
|
||||
|
||||
```sh
|
||||
vcpkg install nlohmann-json
|
||||
```
|
||||
|
||||
3. Build:
|
||||
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
cmake --build .
|
||||
```
|
||||
|
||||
Note you need to adjust `/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake` to your system.
|
||||
|
||||
## cget
|
||||
|
||||
|
Reference in New Issue
Block a user