Skip to content

Commit 5de51c4

Browse files
author
Colin Robertson
committed
Move library option section
1 parent 27b9cd3 commit 5de51c4

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

‎docs/build/vcpkg.md‎

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,36 @@ portaudio 19.0.6.00 PortAudio Portable Cross-platform Audio I/O API P...
5757
taglib 1.11.1-2 TagLib Audio Meta-Data Library
5858
```
5959

60+
### Install a library on your local machine
61+
62+
After you get the name of a library by using **`vcpkg search`**, you use **`vcpkg install`** to download the library and compile it. vcpkg uses the library's portfile in the *ports* directory. If a triplet isn't specified, vcpkg installs and compiles for the default triplet for the target platform: x86-windows, x64-linux.cmake, or x64-osx.cmake.
63+
64+
For Linux libraries, vcpkg depends on gcc being installed on the local machine. On macOS, vcpkg uses Clang.
65+
66+
When the portfile specifies dependencies, vcpkg downloads and installs them too. After downloading, vcpkg builds the library by using the same build system the library uses. CMake and (on Windows) MSBuild projects are preferred, but MAKE is supported along with any other build system. If vcpkg can't find the specified build system on the local machine, it downloads and installs it.
67+
68+
```cmd
69+
> vcpkg install boost:x86-windows
70+
71+
The following packages will be built and installed:
72+
boost:x86-windows
73+
* bzip2:x86-windows
74+
* zlib:x86-windows
75+
Additional packages (*) will be installed to complete this operation.
76+
```
77+
78+
For CMake projects, use `CMAKE_TOOLCHAIN_FILE` to make libraries available with `find_package()`. For example, on Linux or macOS:
79+
80+
```cmd
81+
cmake .. -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
82+
```
83+
84+
On Windows:
85+
86+
```cmd
87+
cmake .. -DCMAKE_TOOLCHAIN_FILE=vcpkg\scripts\buildsystems\vcpkg.cmake
88+
```
89+
6090
Some libraries include installable options. For example, when you search for the curl library, you'll also see a list of supported options in square brackets:
6191

6292
```cmd
@@ -91,36 +121,6 @@ curl[winssl]:x86-windows SSL support (Secure Channel / "WinSSL")
91121
zlib:x86-windows 1.2.11-6 A compression library
92122
```
93123

94-
### Install a library on your local machine
95-
96-
After you get the name of a library by using **`vcpkg search`**, you use **`vcpkg install`** to download the library and compile it. vcpkg uses the library's portfile in the *ports* directory. If a triplet isn't specified, vcpkg installs and compiles for the default triplet for the target platform: x86-windows, x64-linux.cmake, or x64-osx.cmake.
97-
98-
For Linux libraries, vcpkg depends on gcc being installed on the local machine. On macOS, vcpkg uses Clang.
99-
100-
When the portfile specifies dependencies, vcpkg downloads and installs them too. After downloading, vcpkg builds the library by using the same build system the library uses. CMake and (on Windows) MSBuild projects are preferred, but MAKE is supported along with any other build system. If vcpkg can't find the specified build system on the local machine, it downloads and installs it.
101-
102-
```cmd
103-
> vcpkg install boost:x86-windows
104-
105-
The following packages will be built and installed:
106-
boost:x86-windows
107-
* bzip2:x86-windows
108-
* zlib:x86-windows
109-
Additional packages (*) will be installed to complete this operation.
110-
```
111-
112-
For CMake projects, use `CMAKE_TOOLCHAIN_FILE` to make libraries available with `find_package()`. For example, on Linux or macOS:
113-
114-
```cmd
115-
cmake .. -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
116-
```
117-
118-
On Windows:
119-
120-
```cmd
121-
cmake .. -DCMAKE_TOOLCHAIN_FILE=vcpkg\scripts\buildsystems\vcpkg.cmake
122-
```
123-
124124
## List the libraries already installed
125125

126126
After you've installed some libraries, you can use **`vcpkg list`** to see what you have:

0 commit comments

Comments
 (0)