summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-01-25 20:41:17 +0100
committerSlávek Banko <slavek.banko@axis.cz>2021-01-27 16:15:36 +0100
commitf8bcc8f59595cd15a8a88a65807a93af0e38432f (patch)
tree1a0f5d6f933ea47c7378b08ca514262e356dc96d
parent9237b11955d1ea868b459fd01c7afe7383f13610 (diff)
downloadtde-cmake-f8bcc8f59595cd15a8a88a65807a93af0e38432f.tar.gz
tde-cmake-f8bcc8f59595cd15a8a88a65807a93af0e38432f.zip
tde_create_translated_desktop: Instead of preprocessing the desktop
file for use with intltool-merge already in the configuration phase, prepare the file during the custom command call just before calling intltool-merge. This will allow the natural use of the macro with the generated files. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 1686d0e64eefa5f4036dce1800d666c41b0b5e5a)
-rw-r--r--modules/TDEMacros.cmake7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index 3c97c81..ffc890a 100644
--- a/modules/TDEMacros.cmake
+++ b/modules/TDEMacros.cmake
@@ -2017,15 +2017,14 @@ macro( tde_create_translated_desktop )
else( )
- # create template for intltool-merge
- file( READ ${_src} _src_data )
+ # prepare keywords for intltool
string( REPLACE ";" "|" _keywords_match "(${_keywords_desktop})" )
- string( REGEX REPLACE "(^|\n)${_keywords_match}[ ]*=[ ]*" "\\1_\\2=" _src_data "${_src_data}" )
- file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.in "${_src_data}" )
# merge translations command
+ get_filename_component( _src ${_src} ABSOLUTE )
add_custom_command(
OUTPUT ${_basename}${_binsuffix}
+ COMMAND ${PERL_EXECUTABLE} -p -e "'s/^${_keywords_match}[ ]*=[ ]*/_\\1=/'" < ${_src} > ${_basename}.in
COMMAND ${PERL_EXECUTABLE} ${INTLTOOL_MERGE_EXECUTABLE} -q -d ${_po_dir} ${_basename}.in ${_basename}${_binsuffix}
DEPENDS ${_src}
COMMENT "Merging translations into ${_sourcename}"