2018-10-25 20:34:45 +01:00
|
|
|
# vcpkg_add_to_path
|
|
|
|
|
2021-03-11 01:56:07 +08:00
|
|
|
The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_add_to_path.md).
|
2021-02-28 13:17:19 -08:00
|
|
|
|
2021-02-17 10:08:50 -08:00
|
|
|
Add a directory or directories to the PATH environment variable
|
2018-10-25 20:34:45 +01:00
|
|
|
|
|
|
|
```cmake
|
2021-02-17 10:08:50 -08:00
|
|
|
vcpkg_add_to_path([PREPEND] [<path>...])
|
2018-10-25 20:34:45 +01:00
|
|
|
```
|
|
|
|
|
2021-02-17 10:08:50 -08:00
|
|
|
`vcpkg_add_to_path` adds all of the paths passed to it to the PATH environment variable.
|
|
|
|
If PREPEND is passed, then those paths are prepended to the PATH environment variable,
|
|
|
|
so that they are searched first; otherwise, those paths are appended, so they are
|
|
|
|
searched after the paths which are already in the environment variable.
|
2018-10-25 20:34:45 +01:00
|
|
|
|
2021-02-17 10:08:50 -08:00
|
|
|
The paths are added in the order received, so that the first path is always searched
|
|
|
|
before a later path.
|
2018-10-25 20:34:45 +01:00
|
|
|
|
2021-02-17 10:08:50 -08:00
|
|
|
If no paths are passed, then nothing will be done.
|
2018-10-25 20:34:45 +01:00
|
|
|
|
2019-03-11 17:29:37 -07:00
|
|
|
## Examples:
|
2019-03-13 13:52:20 -07:00
|
|
|
* [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75)
|
2019-03-11 17:29:37 -07:00
|
|
|
* [folly](https://github.com/Microsoft/vcpkg/blob/master/ports/folly/portfile.cmake#L15)
|
|
|
|
* [z3](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13)
|
|
|
|
|
2018-10-25 20:34:45 +01:00
|
|
|
## Source
|
2021-02-28 13:17:19 -08:00
|
|
|
[scripts/cmake/vcpkg\_add\_to\_path.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_add_to_path.cmake)
|