mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 00:19:06 +08:00
[vcpkg create, docs] Update create command's template and documentation on patching (#5370)
This commit is contained in:
parent
6e687c3a92
commit
7a18088cf2
@ -147,11 +147,11 @@ Finally, we need to apply the patch after extracting the source.
|
|||||||
```cmake
|
```cmake
|
||||||
# ports\libpng\portfile.cmake
|
# ports\libpng\portfile.cmake
|
||||||
...
|
...
|
||||||
vcpkg_extract_source_archive(${ARCHIVE})
|
vcpkg_extract_source_archive_ex(
|
||||||
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
vcpkg_apply_patches(
|
ARCHIVE ${ARCHIVE}
|
||||||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24
|
PATCHES
|
||||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch"
|
"use-abort-on-all-platforms.patch"
|
||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_configure_cmake(
|
vcpkg_configure_cmake(
|
||||||
|
@ -11,13 +11,24 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
include(vcpkg_common_functions)
|
include(vcpkg_common_functions)
|
||||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/@ROOT_NAME@)
|
|
||||||
vcpkg_download_distfile(ARCHIVE
|
vcpkg_download_distfile(ARCHIVE
|
||||||
URLS "@URL@"
|
URLS "@URL@"
|
||||||
FILENAME "@FILENAME@"
|
FILENAME "@FILENAME@"
|
||||||
SHA512 @SHA512@
|
SHA512 @SHA512@
|
||||||
)
|
)
|
||||||
vcpkg_extract_source_archive(${ARCHIVE})
|
|
||||||
|
vcpkg_extract_source_archive_ex(
|
||||||
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
|
ARCHIVE ${ARCHIVE}
|
||||||
|
# (Optional) A friendly name to use instead of the filename of the archive (e.g.: a version number or tag).
|
||||||
|
# REF 1.0.0
|
||||||
|
# (Optional) Read the docs for how to generate patches at:
|
||||||
|
# https://github.com/Microsoft/vcpkg/blob/master/docs/examples/patching.md
|
||||||
|
# PATCHES
|
||||||
|
# 001_port_fixes.patch
|
||||||
|
# 002_more_port_fixes.patch
|
||||||
|
)
|
||||||
|
|
||||||
vcpkg_configure_cmake(
|
vcpkg_configure_cmake(
|
||||||
SOURCE_PATH ${SOURCE_PATH}
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
|
Loading…
Reference in New Issue
Block a user