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>
pull/68/head
Slávek Banko 4 years ago
parent a5baa2c1ab
commit 1686d0e64e
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -2017,15 +2017,14 @@ macro( tde_create_translated_desktop )
else( ) else( )
# create template for intltool-merge # prepare keywords for intltool
file( READ ${_src} _src_data )
string( REPLACE ";" "|" _keywords_match "(${_keywords_desktop})" ) 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 # merge translations command
get_filename_component( _src ${_src} ABSOLUTE )
add_custom_command( add_custom_command(
OUTPUT ${_basename}${_binsuffix} 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} COMMAND ${PERL_EXECUTABLE} ${INTLTOOL_MERGE_EXECUTABLE} -q -d ${_po_dir} ${_basename}.in ${_basename}${_binsuffix}
DEPENDS ${_src} DEPENDS ${_src}
COMMENT "Merging translations into ${_sourcename}" COMMENT "Merging translations into ${_sourcename}"

Loading…
Cancel
Save