summaryrefslogtreecommitdiffstats
path: root/cmake/sed.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.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 'cmake/sed.cmake')
-rw-r--r--cmake/sed.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/sed.cmake b/cmake/sed.cmake
new file mode 100644
index 0000000..feb0f1e
--- /dev/null
+++ b/cmake/sed.cmake
@@ -0,0 +1,12 @@
+set(SED_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/sed.script.cmake"
+ CACHE INTERNAL "path to sed script")
+
+function(sed input_file output_file)
+ add_custom_command(OUTPUT "${output_file}"
+ COMMAND ${CMAKE_COMMAND}
+ -Dinput_file="${input_file}"
+ -Doutput_file="${output_file}"
+ -Dreplacement_pairs="${ARGN}"
+ -P ${SED_SCRIPT}
+ DEPENDS "${input_file}")
+endfunction()