From 963cd1b347331c501a2bbb8a1caef7512fbab905 Mon Sep 17 00:00:00 2001 From: MrSimbax Date: Fri, 10 Jul 2020 10:53:38 +0200 Subject: [PATCH 1/2] Fix sed cmd not working with MSBuild Fixes the `'\1' is not recognized as an internal or external command` error when trying to run the target `update-pot` with MSBuild. The `|` characters probably messed with cmd.exe or PowerShell syntax rules so they were replaced with slashes `/`. Also, at least some implementations of sed for Windows would produce CRLF line endings instead of LF line endings. The issue is fixed by adding the flag `-b`. --- po/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 6a5d7073..28229f32 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -12,7 +12,7 @@ add_custom_command(OUTPUT ${_potFile} COMMAND ${XGETTEXT_CMD} ${colobot_SOURCE_DIR}/src/app/app.cpp --output=${_potFile} --no-wrap COMMAND ${XGETTEXT_CMD} ${colobot_SOURCE_DIR}/src/common/restext.cpp --output=${_potFile} --no-wrap --join-existing --no-location --keyword=TR COMMAND ${XGETTEXT_CMD} ${colobot_SOURCE_DIR}/src/script/script.cpp --output=${_potFile} --no-wrap --join-existing --no-location - COMMAND sed -i -e "s|^\\(\"POT-Creation-Date:\\).*$|\\1 DATE\\\\n\"|" ${_potFile} + COMMAND sed -bi -e "s/^\\(\"POT-Creation-Date:\\).*$/\\1 DATE\\\\n\"/" ${_potFile} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Extract translatable messages to ${_potFile}" From bf1982f4e4a4d511563df07d0601b91aedbe4c11 Mon Sep 17 00:00:00 2001 From: MrSimbax Date: Fri, 10 Jul 2020 11:01:47 +0200 Subject: [PATCH 2/2] Change `make update-pot` comment to cmake command `make update-pot` only works if a generator producing Makefiles was used with `cmake`. The `cmake` command to build a specific target will work for any generator. --- src/common/restext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/restext.cpp b/src/common/restext.cpp index 40b34565..cd05d59f 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -48,8 +48,8 @@ const char* stringsCbot[CBot::CBotErrMAX] = { nullptr }; */ #define TR(x) x -/* Please run `make update-pot` after changing this file - * in order to update translation files. Thank you. +/* Please run `cmake --build --target update-pot` + * after changing this file in order to update translation files. Thank you. */ void InitializeRestext()