Merge pull request #86 from ityuhui/yh-readme-0924

[Doc] Reorganize readme for vcpkg
This commit is contained in:
Kubernetes Prow Robot
2021-09-24 19:34:21 -07:00
committed by GitHub
2 changed files with 28 additions and 26 deletions

View File

@@ -46,32 +46,8 @@ make
sudo make install sudo make install
``` ```
## Installing using vcpkg ## (Optional) Installing using vcpkg on Windows
1- Download vcpkg from https://github.com/microsoft/vcpkg/ If you want to install the C client using vcpkg, please refer to [vcpkg.md](https://github.com/kubernetes-client/c/blob/master/docs/vcpkg.md)
2- Run bootstrap-vcpkg script to prepare the repo
3- Install the library using the command:
```
./vcpkg install kubernetes[:triplet]
```
To get a complete list of available triplets, run the command:
```
vcpkg help triplet
```
4- Add vcpkg integration to your project by using the toolchain parameter for cmake:
```
-DCMAKE_TOOLCHAIN_FILE=VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
```
Or using the parameter in more recent CMake versions:
```
--toolchain VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
```
5- Add the library to your project using the following CMake commands:
```
find_package(kubernetes CONFIG REQUIRED)
target_link_libraries(PROJECT PRIVATE kubernetes::kubernetes)
```
## Building an example ## Building an example
```bash ```bash

26
docs/vcpkg.md Normal file
View File

@@ -0,0 +1,26 @@
# Installing using vcpkg
1- Download vcpkg from https://github.com/microsoft/vcpkg/
2- Run bootstrap-vcpkg script to prepare the repo
3- Install the library using the command:
```
./vcpkg install kubernetes[:triplet]
```
To get a complete list of available triplets, run the command:
```
vcpkg help triplet
```
4- Add vcpkg integration to your project by using the toolchain parameter for cmake:
```
-DCMAKE_TOOLCHAIN_FILE=VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
```
Or using the parameter in more recent CMake versions:
```
--toolchain VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
```
5- Add the library to your project using the following CMake commands:
```
find_package(kubernetes CONFIG REQUIRED)
target_link_libraries(PROJECT PRIVATE kubernetes::kubernetes)
```