2018-10-26 03:34:45 +08:00
|
|
|
# vcpkg_add_to_path
|
|
|
|
|
2021-03-01 05:17:19 +08:00
|
|
|
The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_add_to_path.md).
|
|
|
|
|
2021-02-18 02:08:50 +08:00
|
|
|
Add a directory or directories to the PATH environment variable
|
2018-10-26 03:34:45 +08:00
|
|
|
|
|
|
|
```cmake
|
2021-02-18 02:08:50 +08:00
|
|
|
vcpkg_add_to_path([PREPEND] [<path>...])
|
2018-10-26 03:34:45 +08:00
|
|
|
```
|
|
|
|
|
2021-02-18 02: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-26 03:34:45 +08:00
|
|
|
|
2021-02-18 02: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-26 03:34:45 +08:00
|
|
|
|
2021-02-18 02:08:50 +08:00
|
|
|
If no paths are passed, then nothing will be done.
|
2018-10-26 03:34:45 +08:00
|
|
|
|
2019-03-12 08:29:37 +08:00
|
|
|
## Examples:
|
2019-03-14 04:52:20 +08:00
|
|
|
* [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75)
|
2019-03-12 08:29:37 +08: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-26 03:34:45 +08:00
|
|
|
## Source
|
2021-03-01 05: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)
|