diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-11-17 00:22:15 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-11-17 00:22:15 -0800 |
| commit | 875bb9a6611d51c0cd6b476983e0f220203a603d (patch) | |
| tree | 8844f9b73204964a6e1cd1ccf4392d25ae57af80 /scripts/cmake/vcpkg_replace_string.cmake | |
| parent | c4ca996583c61d311bf15c40dbbb261ce5f59047 (diff) | |
| parent | b959f70a9969551a132d691fbd12046d5ea0702e (diff) | |
| download | vcpkg-875bb9a6611d51c0cd6b476983e0f220203a603d.tar.gz vcpkg-875bb9a6611d51c0cd6b476983e0f220203a603d.zip | |
Merge branch 'qt5_modular' of https://github.com/Barath-Kannan/vcpkg into Barath-Kannan-qt5_modular
Diffstat (limited to 'scripts/cmake/vcpkg_replace_string.cmake')
| -rw-r--r-- | scripts/cmake/vcpkg_replace_string.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/cmake/vcpkg_replace_string.cmake b/scripts/cmake/vcpkg_replace_string.cmake new file mode 100644 index 000000000..3eb18d0bf --- /dev/null +++ b/scripts/cmake/vcpkg_replace_string.cmake @@ -0,0 +1,14 @@ +#.rst: +# .. command:: vcpkg_replace_string +# +# Replace a string in a file. +# +# :: +# vcpkg_replace_string(filename match_string 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}") +endfunction() |
