diff options
| author | Barath Kannan <barathsotd@gmail.com> | 2017-11-06 00:24:29 +1100 |
|---|---|---|
| committer | Barath Kannan <barathsotd@gmail.com> | 2017-11-06 00:24:29 +1100 |
| commit | 9bb4817e32a14647093876cabaf62bbd2be63fc6 (patch) | |
| tree | dbbf4d5766b6484c73f88f002a7fc5232be3ebef /scripts/cmake/vcpkg_replace_string.cmake | |
| parent | 6b83925dd6b88233410f1511993350bab6ef984a (diff) | |
| download | vcpkg-9bb4817e32a14647093876cabaf62bbd2be63fc6.tar.gz vcpkg-9bb4817e32a14647093876cabaf62bbd2be63fc6.zip | |
use install target in Makefiles; make all portfile uniform
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() |
