File: sed.cmake

package info (click to toggle)
frozen 1.2.0-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,244 kB
  • sloc: cpp: 18,992; ansic: 788; makefile: 77
file content (12 lines) | stat: -rw-r--r-- 487 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
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()