diff --git a/docs/maintainers/vcpkg_replace_string.md b/docs/maintainers/vcpkg_replace_string.md index 179b8a08d7ab31..967dd3c01a6137 100644 --- a/docs/maintainers/vcpkg_replace_string.md +++ b/docs/maintainers/vcpkg_replace_string.md @@ -5,9 +5,8 @@ The latest version of this document lives in the [vcpkg repo](https://github.com Replace a string in a file. ```cmake -vcpkg_replace_string(filename match_string replace_string) +vcpkg_replace_string( ) ``` - ## Source [scripts/cmake/vcpkg\_replace\_string.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_replace_string.cmake) diff --git a/scripts/cmake/vcpkg_replace_string.cmake b/scripts/cmake/vcpkg_replace_string.cmake index d24b8677ec0fd6..1f8b37b656fb6a 100644 --- a/scripts/cmake/vcpkg_replace_string.cmake +++ b/scripts/cmake/vcpkg_replace_string.cmake @@ -4,13 +4,12 @@ Replace a string in a file. ```cmake -vcpkg_replace_string(filename match_string replace_string) +vcpkg_replace_string( ) ``` - #]===] -function(vcpkg_replace_string filename match_string replace_string) - file(READ ${filename} _contents) - string(REPLACE "${match_string}" "${replace_string}" _contents "${_contents}") - file(WRITE ${filename} "${_contents}") +function(vcpkg_replace_string filename match replace) + file(READ "${filename}" contents) + string(REPLACE "${match}" "${replace}" contents "${contents}") + file(WRITE "${filename}" "${contents}") endfunction()