aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmake/vcpkg_replace_string.cmake
diff options
context:
space:
mode:
authornicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>2021-07-20 12:24:58 -0500
committerGitHub <noreply@github.com>2021-07-20 10:24:58 -0700
commit0e1dc121856eef84bf1852134e548bf9898dabac (patch)
tree4bbae150d61121c81c33a2f4b7b92063e4db3060 /scripts/cmake/vcpkg_replace_string.cmake
parentb67fab9861239e33b722b9a44f5c96dec6ca807e (diff)
downloadvcpkg-0e1dc121856eef84bf1852134e548bf9898dabac.tar.gz
vcpkg-0e1dc121856eef84bf1852134e548bf9898dabac.zip
[rollup] Rollup PR 2021-07-16 (#19001)
* [rollup:2021-07-16 1/7] PR #18201 (@JackBoosY) [vcpkg-cmake] Add check for unused cmake variables * [rollup:2021-07-16 2/7] PR #18397 (@strega-nil) [vcpkg_list] add new function * [rollup:2021-07-16 3/7] PR #18782 (@strega-nil) [scripts-audit] vcpkg_build_ninja * [rollup:2021-07-16 4/7] PR #18784 (@strega-nil) [scripts-audit] vcpkg_minimum_required * [rollup:2021-07-16 5/7] PR #18785 (@strega-nil) [scripts-audit] vcpkg_replace_string * [rollup:2021-07-16 6/7] PR #18786 (@strega-nil) [scripts-audit] windows scripts * [rollup:2021-07-16 7/7] PR #18945 (@strega-nil) [many ports] remove deprecated vcpkg_check_features call [1/5] Co-authored-by: nicole mazzuca <mazzucan@outlook.com> Co-authored-by: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com>
Diffstat (limited to 'scripts/cmake/vcpkg_replace_string.cmake')
-rw-r--r--scripts/cmake/vcpkg_replace_string.cmake11
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/cmake/vcpkg_replace_string.cmake b/scripts/cmake/vcpkg_replace_string.cmake
index d24b8677e..1f8b37b65 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(<filename> <match> <replace>)
```
-
#]===]
-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()