[Doc] Reorganize readme for vcpkg

This commit is contained in:
Hui Yu
2021-09-24 14:02:44 +08:00
parent 2d109a9edd
commit cdb55c8c46
2 changed files with 28 additions and 26 deletions

View File

@@ -46,32 +46,8 @@ make
sudo make install
```
## 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)
```
## (Optional) Installing using vcpkg on Windows
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)
## Building an example
```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)
```