]> git.tdb.fi Git - ext/openal.git/blob - cmake/bin2h.script.cmake
Tweak some types to work around an MSVC compile error
[ext/openal.git] / cmake / bin2h.script.cmake
1 # Read the input file into 'indata', converting each byte to a pair of hex
2 # characters
3 file(READ "${INPUT_FILE}" indata HEX)
4
5 # For each pair of characters, indent them and prepend the 0x prefix, and
6 # append a comma separateor.
7 # TODO: Prettify this. Should group a number of bytes per line instead of one
8 # per line.
9 string(REGEX REPLACE "(..)" "    0x\\1,\n" output "${indata}")
10
11 # Write the list of hex chars to the output file
12 file(WRITE "${OUTPUT_FILE}" "${output}")