summaryrefslogtreecommitdiffstats
path: root/cmake/sed.script.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:39:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:39:03 +0000
commit408c608fc7bf1557ee987dd7fbe662fabed21a53 (patch)
tree8b07135336de378134bfedc808d49747174810d3 /cmake/sed.script.cmake
parentInitial commit. (diff)
downloadfrozen-408c608fc7bf1557ee987dd7fbe662fabed21a53.tar.xz
frozen-408c608fc7bf1557ee987dd7fbe662fabed21a53.zip
Adding upstream version 1.1.1.upstream/1.1.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--cmake/sed.script.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/sed.script.cmake b/cmake/sed.script.cmake
new file mode 100644
index 0000000..a596736
--- /dev/null
+++ b/cmake/sed.script.cmake
@@ -0,0 +1,18 @@
+string(REPLACE " " ";" replacement_pairs ${replacement_pairs})
+
+file(READ "${input_file}" text)
+
+list(LENGTH replacement_pairs length)
+math(EXPR last_index "${length} - 1")
+
+foreach(regex_index RANGE 0 ${last_index} 2)
+ math(EXPR replacement_index "${regex_index} + 1")
+ LIST(GET replacement_pairs ${regex_index} regex_expression)
+ LIST(GET replacement_pairs ${replacement_index} replacement_expression)
+ string(REPLACE
+ "${regex_expression}"
+ "${replacement_expression}"
+ text "${text}")
+endforeach()
+
+file(WRITE ${output_file} "${text}")