aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmake/vcpkg_replace_string.cmake
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-01-18 10:51:18 -0800
committerGitHub <noreply@github.com>2018-01-18 10:51:18 -0800
commitd35866018a43c108b2fa04587917c8d53740d4e6 (patch)
treec0f4ea145071bc6da23a99862b5004e2b6ed6af0 /scripts/cmake/vcpkg_replace_string.cmake
parentb4c041df93663f1abc82d0cfb79420fc02d4546e (diff)
parentb47b4346f8c5b09cfb9826a083fc2d034a2ea9b4 (diff)
downloadvcpkg-d35866018a43c108b2fa04587917c8d53740d4e6.tar.gz
vcpkg-d35866018a43c108b2fa04587917c8d53740d4e6.zip
Merge pull request #1993 from Barath-Kannan/qt5_modular
Qt5 modular
Diffstat (limited to 'scripts/cmake/vcpkg_replace_string.cmake')
-rw-r--r--scripts/cmake/vcpkg_replace_string.cmake14
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()