diff options
| author | myd7349 <myd7349@gmail.com> | 2019-06-29 01:17:39 +0800 |
|---|---|---|
| committer | Curtis J Bezault <curtbezault@gmail.com> | 2019-06-28 10:17:39 -0700 |
| commit | b4675fd65a5baebe93d0e60e082ae43013ed246f (patch) | |
| tree | 33a18d50181b38e0805c4ad7f032d32d5e6b9ae5 /docs | |
| parent | 5b6b66512b84267c1b93ef577dea3a811a255c82 (diff) | |
| download | vcpkg-b4675fd65a5baebe93d0e60e082ae43013ed246f.tar.gz vcpkg-b4675fd65a5baebe93d0e60e082ae43013ed246f.zip | |
[vcpkg] Add vcpkg_check_features (#6958)
* [vcpkg] Add vcpkg_check_feature, vcpkg_check_features
* [vcpkg] Remove vcpkg_check_feature
* [oniguruma,xtensor] Use vcpkg_check_features
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/maintainers/portfile-functions.md | 1 | ||||
| -rw-r--r-- | docs/maintainers/vcpkg_check_features.md | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index c4b810dc0..b98d89192 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -6,6 +6,7 @@ - [vcpkg\_apply\_patches](vcpkg_apply_patches.md)
- [vcpkg\_build\_cmake](vcpkg_build_cmake.md)
- [vcpkg\_build\_msbuild](vcpkg_build_msbuild.md)
+- [vcpkg\_check\_features](vcpkg_check_features.md)
- [vcpkg\_check\_linkage](vcpkg_check_linkage.md)
- [vcpkg\_clean\_msbuild](vcpkg_clean_msbuild.md)
- [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md)
diff --git a/docs/maintainers/vcpkg_check_features.md b/docs/maintainers/vcpkg_check_features.md new file mode 100644 index 000000000..ca2debf85 --- /dev/null +++ b/docs/maintainers/vcpkg_check_features.md @@ -0,0 +1,41 @@ +# vcpkg_check_features + +Check if one or more features are part of the package installation. + +## Usage +```cmake +vcpkg_check_features( + <feature1> <output_variable1> + [<feature2> <output_variable2>] + ... +) +``` + +`vcpkg_check_features` accepts a list of (feature, output_variable) pairs. +The syntax is similar to the `PROPERTIES` argument of `set_target_properties`. + +`vcpkg_check_features` will create a variable `FEATURE_OPTIONS` in the +parent scope, which you can pass as a part of `OPTIONS` argument when +calling functions like `vcpkg_config_cmake`: +```cmake +vcpkg_config_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=ON + ${FEATURE_OPTIONS} +) +``` + +## Notes +`vcpkg_check_features` is supposed to be called only once. Otherwise, the +`FEATURE_OPTIONS` variable set by a previous call will be overwritten. + +## Examples + +* [czmq](https://github.com/microsoft/vcpkg/blob/master/ports/czmq/portfile.cmake) +* [oniguruma](https://github.com/microsoft/vcpkg/blob/master/ports/oniguruma/portfile.cmake) +* [xtensor](https://github.com/microsoft/vcpkg/blob/master/ports/xtensor/portfile.cmake) + +## Source +[scripts/cmake/vcpkg_check_features.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_features.cmake)
|
