robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

dundargocbuild: cmake cleanup1086016477

master
701 B21 linesraw
1string(TOUPPER ${INPUT_ENC} upperInputEnc)
2string(TOLOWER ${INPUT_ENC} lowerInputEnc)
3get_filename_component(inputName ${INPUT_FILE} NAME)
4execute_process(
5  COMMAND ${ICONV_PRG} -f ${INPUT_ENC} -t ${OUTPUT_ENC} ${INPUT_FILE}
6  OUTPUT_VARIABLE trans
7  ERROR_VARIABLE err
8  RESULT_VARIABLE res)
9if(res)
10  message(FATAL_ERROR "iconv failed to run correctly: ${err}")
11endif()
12
13string(REPLACE "charset=${lowerInputEnc}" "charset=${OUTPUT_CHARSET}"
14  trans "${trans}")
15string(REPLACE "charset=${upperInputEnc}" "charset=${OUTPUT_CHARSET}"
16  trans "${trans}")
17string(REPLACE "# Original translations"
18  "# Generated from ${inputName}, DO NOT EDIT"
19  trans "${trans}")
20
21file(WRITE ${OUTPUT_FILE} "${trans}")