diff --git a/src/wx/check-pot-updated.cmake b/src/wx/check-pot-updated.cmake index 7793dcb9..0183cd77 100644 --- a/src/wx/check-pot-updated.cmake +++ b/src/wx/check-pot-updated.cmake @@ -2,9 +2,22 @@ if(NOT EXISTS ${BIN_DIR}/wxvbam.pot) return() endif() -file(READ ${SRC_DIR}/wxvbam.pot src_ver) +macro(read_pot path var) + file(READ ${path} ${var}_file) -file(READ ${BIN_DIR}/wxvbam.pot new_ver) + string(REGEX REPLACE ";" "\\\\;" ${var}_file ${${var}_file}) + string(REGEX REPLACE "\r?\n" ";" ${var}_file ${${var}_file}) + + # Ignore timestamp. + foreach(line IN LISTS ${var}_file) + if(NOT line MATCHES [=[^"POT-Creation-Date: ]=]) + list(APPEND ${var} ${line}) + endif() + endforeach() +endmacro() + +read_pot(${SRC_DIR}/wxvbam.pot src_ver) +read_pot(${BIN_DIR}/wxvbam.pot new_ver) if(NOT src_ver STREQUAL new_ver) file(COPY ${BIN_DIR}/wxvbam.pot DESTINATION ${SRC_DIR})