From 9bb4817e32a14647093876cabaf62bbd2be63fc6 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 6 Nov 2017 00:24:29 +1100 Subject: use install target in Makefiles; make all portfile uniform --- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_replace_string.cmake | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 scripts/cmake/vcpkg_replace_string.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 5dabd446e..e48b5e442 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -26,3 +26,4 @@ include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) include(vcpkg_acquire_depot_tools) +include(vcpkg_replace_string) 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() -- cgit v1.2.3