forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Rewrite docs for vcpkg_cmake_build and vcpkg_cmake_install (mi…
…crosoft#25477) * [docs] Rewrite docs for vcpkg_cmake_build and vcpkg_cmake_install * [docs] Fix broken links * [docs] Add notes about parent helper port
- Loading branch information
1 parent
cd5e794
commit 23cc584
Showing
12 changed files
with
139 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# vcpkg_cmake_build | ||
|
||
**The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_cmake_build.md).** | ||
|
||
Build a cmake project with a custom install target. | ||
|
||
Conventionally, CMake uses the target `install` to build and copy binaries into the [`CMAKE_INSTALL_PREFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html). In rare circumstances, a project might have more specific targets that should be used instead. | ||
|
||
Ports should prefer calling [`vcpkg_cmake_install()`](vcpkg_cmake_install.md) when possible. | ||
|
||
## Usage | ||
|
||
```cmake | ||
vcpkg_cmake_build( | ||
[TARGET <target>] | ||
[LOGFILE_BASE <base>] | ||
[DISABLE_PARALLEL] | ||
[ADD_BIN_TO_PATH] | ||
) | ||
``` | ||
|
||
To use this function, you must depend on the helper port [`vcpkg-cmake`](ports/vcpkg-cmake.md): | ||
```no-highlight | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
} | ||
] | ||
``` | ||
|
||
## Parameters | ||
|
||
All supported parameters to [`vcpkg_cmake_install()`] are supported by `vcpkg_cmake_build()`. See [`vcpkg_cmake_install()`] for additional parameter documentation. | ||
|
||
[`vcpkg_cmake_install()`]: vcpkg_cmake_install.md#parameters | ||
|
||
### TARGET | ||
The CMake target to build. | ||
|
||
If this parameter is not passed, no target will be passed to the build. | ||
|
||
### LOGFILE_BASE | ||
An alternate root name for the logs. | ||
|
||
Defaults to `build-${TARGET_TRIPLET}`. It should not contain any path separators. Logs will be generated matching the pattern `${CURRENT_BUILDTREES_DIR}/${LOGFILE_BASE}-<suffix>.log` | ||
|
||
## Examples | ||
|
||
```cmake | ||
vcpkg_from_github(OUT_SOURCE_PATH source_path ...) | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${source_path}" | ||
OPTIONS | ||
-DBUILD_EXAMPLES=OFF | ||
-DBUILD_TESTS=OFF | ||
) | ||
vcpkg_cmake_build(TARGET my.install.target) | ||
``` | ||
|
||
[Search microsoft/vcpkg for Examples](https://github.com/microsoft/vcpkg/search?q=vcpkg_cmake_build+path%3A%2Fports) | ||
|
||
## Remarks | ||
|
||
This command replaces [`vcpkg_build_cmake()`](vcpkg_build_cmake.md). | ||
|
||
## Source | ||
[ports/vcpkg-cmake/vcpkg\_cmake\_build.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-cmake/vcpkg_cmake_build.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# vcpkg_cmake_install | ||
|
||
**The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_cmake_install.md).** | ||
|
||
Build and install a cmake project. | ||
|
||
## Usage | ||
|
||
```cmake | ||
vcpkg_cmake_install( | ||
[DISABLE_PARALLEL] | ||
[ADD_BIN_TO_PATH] | ||
) | ||
``` | ||
|
||
To use this function, you must depend on the helper port [`vcpkg-cmake`](ports/vcpkg-cmake.md): | ||
```no-highlight | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
} | ||
] | ||
``` | ||
|
||
## Parameters | ||
|
||
### DISABLE_PARALLEL | ||
Disables running the build in parallel. | ||
|
||
By default builds are run with up to [VCPKG_MAX_CONCURRENCY](../users/config-environment.md#VCPKG_MAX_CONCURRENCY) jobs. This option limits the build to a single job and should be used only if the underlying build is unable to run correctly with concurrency. | ||
|
||
### ADD_BIN_TO_PATH | ||
Adds the configuration-specific `bin/` directory to the `PATH` during the build. | ||
|
||
When building for a Windows dynamic triplet, newly built executables may not be immediately executable because their dependency DLLs may not be findable from the build environment. This flag instructs vcpkg to add any additional paths needed to locate those dependency DLLs to the `PATH` environment variable. This is required if the project needs to execute newly built binaries as part of the build (such as to generate code). | ||
|
||
## Examples: | ||
|
||
```cmake | ||
vcpkg_from_github(OUT_SOURCE_PATH source_path ...) | ||
vcpkg_cmake_configure(SOURCE_PATH "${source_path}") | ||
vcpkg_cmake_install() | ||
``` | ||
|
||
[Search microsoft/vcpkg for Examples](https://github.com/microsoft/vcpkg/search?q=vcpkg_cmake_install+path%3A%2Fports) | ||
|
||
## Remarks | ||
|
||
This command replaces [`vcpkg_install_cmake()`](vcpkg_install_cmake.md). | ||
|
||
## Source | ||
[ports/vcpkg-cmake/vcpkg\_cmake\_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-cmake/vcpkg_cmake_install.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters